diff --git a/src/org/ntlab/traceDebugger/JavaEditorOperator.java b/src/org/ntlab/traceDebugger/JavaEditorOperator.java index f6ec6ef..a12b4cd 100644 --- a/src/org/ntlab/traceDebugger/JavaEditorOperator.java +++ b/src/org/ntlab/traceDebugger/JavaEditorOperator.java @@ -1,23 +1,10 @@ package org.ntlab.traceDebugger; -import java.util.ArrayList; -import java.util.List; -import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; @@ -30,9 +17,7 @@ import org.eclipse.ui.ide.IDE; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditor; -import org.ntlab.traceAnalysisPlatform.tracer.trace.ClassInfo; import org.ntlab.traceAnalysisPlatform.tracer.trace.MethodExecution; -import org.ntlab.traceAnalysisPlatform.tracer.trace.TraceJSON; public class JavaEditorOperator { @@ -42,23 +27,13 @@ * @param methodExecution */ public static void openSrcFileOfMethodExecution(MethodExecution methodExecution, int highlightLineNo) { - IType type = findIType(methodExecution); + IType type = JavaElementFinder.findIType(methodExecution); if (type != null) { - IMethod method = findIMethod(methodExecution, type); + IMethod method = JavaElementFinder.findIMethod(methodExecution, type); openSrcFile(type, method); highlightCurrentJavaFile(highlightLineNo); } } - - /** - * �����œn����IType��IMethod�ɑΉ�����\�[�X�R�[�h��Ώ�Eclipse�̃G�f�B�^�ŊJ������ - * - * @param type - * @param method - */ - private static void openSrcFile(IType type, IMethod method) { - openInJavaEditor(type, method); - } /** * ���݃G�f�B�^�ŊJ����Ă���t�@�C���̎w�肵���s�Ƀn�C���C�g�������� @@ -90,107 +65,16 @@ } } - public static IFile findIFile(MethodExecution methodExecution) { - TraceJSON trace = (TraceJSON)TraceDebuggerPlugin.getAnalyzer().getTrace(); - String declaringClassName = methodExecution.getDeclaringClassName(); - declaringClassName = declaringClassName.replace(".", ""); - ClassInfo info = trace.getClassInfo(declaringClassName); - if (info == null) return null; - - String tmp = info.getPath(); - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IProject[] projects = workspace.getRoot().getProjects(); - String projectName = ""; - String srcForderName = "/src"; - boolean hasFoundSrcForderName = false; - for (IProject project : projects) { - projectName = project.getFullPath().toString(); - if (!(tmp.contains(projectName + "/"))) continue; - IJavaProject javaProject = JavaCore.create(project); - try { - for (IClasspathEntry entry : javaProject.getResolvedClasspath(true)) { - if (entry.getEntryKind() != IClasspathEntry.CPE_SOURCE) continue; - IPath srcForderPath = entry.getPath(); - srcForderName = srcForderPath.toString(); - hasFoundSrcForderName = true; - break; - } - } catch (JavaModelException e) { - e.printStackTrace(); - } - if (hasFoundSrcForderName) break; - } -// tmp = tmp.replace(tmp.substring(0, tmp.lastIndexOf(projectName)), ""); - tmp = tmp.replace(tmp.substring(0, tmp.indexOf(projectName)), ""); - tmp = tmp.replace("/bin", srcForderName.substring(srcForderName.lastIndexOf("/"))); - tmp = tmp.replace(".class", ".java"); - String filePath = tmp; - IPath path = new Path(filePath); - return ResourcesPlugin.getWorkspace().getRoot().getFile(path); + /** + * �����œn����IType��IMethod�ɑΉ�����\�[�X�R�[�h��Ώ�Eclipse�̃G�f�B�^�ŊJ������ + * + * @param type + * @param method + */ + private static void openSrcFile(IType type, IMethod method) { + openInJavaEditor(type, method); } - - public static IType findIType(MethodExecution methodExecution) { - String declaringClassName = methodExecution.getDeclaringClassName(); - declaringClassName = declaringClassName.replace(".", ""); - return findIType(methodExecution, declaringClassName); - } - - public static IType findIType(MethodExecution methodExecution, String declaringClassName) { - String projectPath = getLoaderPath(methodExecution, declaringClassName); -// if (projectPath == null) projectPath = previousJavaProjectPath; - if (projectPath != null) { - IJavaProject javaProject = findJavaProject(projectPath); - if (javaProject != null) { -// previousJavaProjectPath = projectPath; - try { - return javaProject.findType(declaringClassName); - } catch (JavaModelException e) { - e.printStackTrace(); - } - } - } - return null; - } - - private static String getLoaderPath(MethodExecution methodExecution, String declaringClassName) { - TraceJSON traceJSON = (TraceJSON)TraceDebuggerPlugin.getAnalyzer().getTrace(); - ClassInfo classInfo = traceJSON.getClassInfo(declaringClassName); - if (classInfo == null && methodExecution != null) { - declaringClassName = methodExecution.getThisClassName(); - classInfo = traceJSON.getClassInfo(declaringClassName); - } - String loaderPath = null; - if (classInfo != null) { - // �Ȃ���loaderPath���擾�ł��Ă��Ȃ����߁A���ۂɏo�͂����JSON�g���[�X���Q�l�ɂ���path����^���Ă݂� - String path = classInfo.getPath(); - String declaringClassNameString = declaringClassName.replace(".", "/"); - loaderPath = path.substring(0, path.lastIndexOf(declaringClassNameString)); // path����N���X�̊��S���薼�ȍ~��S�ĊO�������̂�projectPath�ɂ��Ă݂� - } - return loaderPath; - } - - private static IJavaProject findJavaProject(String projectPath) { - IJavaProject javaProject = null; - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IProject[] projects = root.getProjects(); - for (IProject project : projects) { - if (checkProjectPath(project, projectPath)) { - javaProject = JavaCore.create(project); - break; - } - } - return javaProject; - } - - private static boolean checkProjectPath(IProject project, String projectPath) { - String projectLocation = project.getLocation().toString(); - if (projectPath.startsWith(projectLocation)) { - String[] projectPathSplit = projectPath.split(projectLocation); - return (projectPathSplit[1].charAt(0) == '/'); // �v���W�F�N�g���̑O����v�ɂ�鑼�v���W�F�N�g�Ƃ̌딻�������� - } - return false; - } - + private static void openInJavaEditor(IType type, IMethod method) { try { if (type != null) { @@ -207,120 +91,4 @@ e.printStackTrace(); } } - - public static IMethod findIMethod(MethodExecution methodExecution, IType type) { - IMethod method = null; - if (type != null) { - String methodSignature = methodExecution.getSignature(); - method = findIMethod(type, methodSignature); - } - return method; - } - - public static IMethod findIMethod(IType type, String methodSignature) { - try { - for (IMethod method : type.getMethods()) { - if (checkMethodSignature(type, method, methodSignature)) { - return method; - } - } - } catch (JavaModelException e) { - e.printStackTrace(); - } - return null; - } - - private static boolean checkMethodSignature(IType type, IMethod method, String methodSignature) { - String fqcn = type.getFullyQualifiedName(); - try { - StringBuilder jdtMethodSignature = new StringBuilder(); - jdtMethodSignature.append((method.isConstructor()) ? (fqcn + "(") : (fqcn + "." + method.getElementName() + "(")); - if (methodSignature.contains(jdtMethodSignature)) { - // ������v���Ă����ꍇ�Ɍ���A�������X�g����������ł���v���邩�ǂ����𔻒� (�I�[�o�[���[�h�ɂ��딻��������) - jdtMethodSignature.append(String.join(",", parseFQCNParameters(type, method)) + ")"); // �S�����̃V�O�l�`�������S����N���X���ɕϊ�����,�ŋ�؂��������� - return methodSignature.contains(jdtMethodSignature); - } - } catch (JavaModelException e) { - e.printStackTrace(); - } - return false; - } - - public static String resolveType(IType type, String typeName) { - try { - String[][] resolveTypes = type.resolveType(typeName); - if (resolveTypes != null) { - if (resolveTypes[0][0].isEmpty()) { - return (resolveTypes[0][1]); // �f�t�H���g�p�b�P�[�W�̏ꍇ�̓p�b�P�[�W����.�͓���Ȃ� - } else { - return (resolveTypes[0][0] + "." + resolveTypes[0][1]); // ���S����N���X�� - } - } - } catch (JavaModelException e) { - e.printStackTrace(); - } - return null; - } - - /** - * IMethod����擾�ł���S�����̃V�O�l�`�������S����N���X���ɒu�������Ċi�[�������X�g��Ԃ� - * - * @param type - * @param method - * @return - */ - private static List parseFQCNParameters(IType type, IMethod method) throws JavaModelException { - List parameters = new ArrayList<>(); - for (String parameterType : method.getParameterTypes()) { - String readableType = Signature.toString(parameterType); // �V�O�l�`���̕�������^���̕�����ɕϊ� (�z��͌���[]���‚�) - String[] readableTypeSplit = { "", "" }; // �^����[]�̕����p - int firstBracketIndex = readableType.indexOf("[]"); - final int NO_BRACKET_INDEX = -1; - if (firstBracketIndex == NO_BRACKET_INDEX) { - readableTypeSplit[0] = readableType; // �^�� - } else { - readableTypeSplit[0] = readableType.substring(0, firstBracketIndex); // �^�� - readableTypeSplit[1] = readableType.substring(firstBracketIndex); // �^���̌���[]�S�� - } - String tmp = resolveType(type, readableTypeSplit[0]); - if (tmp != null) { - readableTypeSplit[0] = tmp; - } - parameters.add(readableTypeSplit[0] + readableTypeSplit[1]); - } - return parameters; - } - -// /** -// * IMethod����擾�ł���S�����̃V�O�l�`�������S����N���X���ɒu�������Ċi�[�������X�g��Ԃ� -// * -// * @param type -// * @param method -// * @return -// */ -// private static List parseFQCNParameters(IType type, IMethod method) throws JavaModelException { -// List parameters = new ArrayList<>(); -// for (String parameterType : method.getParameterTypes()) { -// String readableType = Signature.toString(parameterType); // �V�O�l�`���̕�������^���̕�����ɕϊ� (�z��͌���[]���‚�) -// String[] readableTypeSplit = { "", "" }; // �^����[]�̕����p -// int firstBracketIndex = readableType.indexOf("[]"); -// final int NO_BRACKET_INDEX = -1; -// if (firstBracketIndex == NO_BRACKET_INDEX) { -// readableTypeSplit[0] = readableType; // �^�� -// } else { -// readableTypeSplit[0] = readableType.substring(0, firstBracketIndex); // �^�� -// readableTypeSplit[1] = readableType.substring(firstBracketIndex); // �^���̌���[]�S�� -// } -// String[][] resolveType = type.resolveType(readableTypeSplit[0]); // �p�b�P�[�W���ƃN���X���̑g�ݍ��킹���擾 -// if (resolveType != null) { -// if (resolveType[0][0].isEmpty()) { -// readableTypeSplit[0] = (resolveType[0][1]); // �f�t�H���g�p�b�P�[�W�̏ꍇ�̓p�b�P�[�W����.�͓���Ȃ� -// } else { -// readableTypeSplit[0] = (resolveType[0][0] + "." + resolveType[0][1]); // ���S����N���X�� -// } -// } -// parameters.add(readableTypeSplit[0] + readableTypeSplit[1]); -// } -// return parameters; -// } } diff --git a/src/org/ntlab/traceDebugger/JavaElementFinder.java b/src/org/ntlab/traceDebugger/JavaElementFinder.java new file mode 100644 index 0000000..896af8e --- /dev/null +++ b/src/org/ntlab/traceDebugger/JavaElementFinder.java @@ -0,0 +1,209 @@ +package org.ntlab.traceDebugger; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.jdt.core.IClasspathEntry; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.IMethod; +import org.eclipse.jdt.core.IType; +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.Signature; +import org.ntlab.traceAnalysisPlatform.tracer.trace.ClassInfo; +import org.ntlab.traceAnalysisPlatform.tracer.trace.MethodExecution; +import org.ntlab.traceAnalysisPlatform.tracer.trace.TraceJSON; + +public class JavaElementFinder { + + public static IFile findIFile(MethodExecution methodExecution) { + TraceJSON trace = (TraceJSON)TraceDebuggerPlugin.getAnalyzer().getTrace(); + String declaringClassName = methodExecution.getDeclaringClassName(); + declaringClassName = declaringClassName.replace(".", ""); + ClassInfo info = trace.getClassInfo(declaringClassName); + if (info == null) return null; + + String tmp = info.getPath(); + IWorkspace workspace = ResourcesPlugin.getWorkspace(); + IProject[] projects = workspace.getRoot().getProjects(); + String projectName = ""; + String srcForderName = "/src"; + boolean hasFoundSrcForderName = false; + for (IProject project : projects) { + projectName = project.getFullPath().toString(); + if (!(tmp.contains(projectName + "/"))) continue; + IJavaProject javaProject = JavaCore.create(project); + try { + for (IClasspathEntry entry : javaProject.getResolvedClasspath(true)) { + if (entry.getEntryKind() != IClasspathEntry.CPE_SOURCE) continue; + IPath srcForderPath = entry.getPath(); + srcForderName = srcForderPath.toString(); + hasFoundSrcForderName = true; + break; + } + } catch (JavaModelException e) { + e.printStackTrace(); + } + if (hasFoundSrcForderName) break; + } +// tmp = tmp.replace(tmp.substring(0, tmp.lastIndexOf(projectName)), ""); + tmp = tmp.replace(tmp.substring(0, tmp.indexOf(projectName)), ""); + tmp = tmp.replace("/bin", srcForderName.substring(srcForderName.lastIndexOf("/"))); + tmp = tmp.replace(".class", ".java"); + String filePath = tmp; + IPath path = new Path(filePath); + return ResourcesPlugin.getWorkspace().getRoot().getFile(path); + } + + public static IType findIType(MethodExecution methodExecution) { + String declaringClassName = methodExecution.getDeclaringClassName(); + declaringClassName = declaringClassName.replace(".", ""); + return findIType(methodExecution, declaringClassName); + } + + public static IType findIType(MethodExecution methodExecution, String declaringClassName) { + String projectPath = getLoaderPath(methodExecution, declaringClassName); +// if (projectPath == null) projectPath = previousJavaProjectPath; + if (projectPath != null) { + IJavaProject javaProject = findJavaProject(projectPath); + if (javaProject != null) { +// previousJavaProjectPath = projectPath; + try { + return javaProject.findType(declaringClassName); + } catch (JavaModelException e) { + e.printStackTrace(); + } + } + } + return null; + } + + private static String getLoaderPath(MethodExecution methodExecution, String declaringClassName) { + TraceJSON traceJSON = (TraceJSON)TraceDebuggerPlugin.getAnalyzer().getTrace(); + ClassInfo classInfo = traceJSON.getClassInfo(declaringClassName); + if (classInfo == null && methodExecution != null) { + declaringClassName = methodExecution.getThisClassName(); + classInfo = traceJSON.getClassInfo(declaringClassName); + } + String loaderPath = null; + if (classInfo != null) { + // �Ȃ���loaderPath���擾�ł��Ă��Ȃ����߁A���ۂɏo�͂����JSON�g���[�X���Q�l�ɂ���path����^���Ă݂� + String path = classInfo.getPath(); + String declaringClassNameString = declaringClassName.replace(".", "/"); + loaderPath = path.substring(0, path.lastIndexOf(declaringClassNameString)); // path����N���X�̊��S���薼�ȍ~��S�ĊO�������̂�projectPath�ɂ��Ă݂� + } + return loaderPath; + } + + private static IJavaProject findJavaProject(String projectPath) { + IJavaProject javaProject = null; + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + IProject[] projects = root.getProjects(); + for (IProject project : projects) { + if (checkProjectPath(project, projectPath)) { + javaProject = JavaCore.create(project); + break; + } + } + return javaProject; + } + + private static boolean checkProjectPath(IProject project, String projectPath) { + String projectLocation = project.getLocation().toString(); + if (projectPath.startsWith(projectLocation)) { + String[] projectPathSplit = projectPath.split(projectLocation); + return (projectPathSplit[1].charAt(0) == '/'); // �v���W�F�N�g���̑O����v�ɂ�鑼�v���W�F�N�g�Ƃ̌딻�������� + } + return false; + } + + public static IMethod findIMethod(MethodExecution methodExecution, IType type) { + IMethod method = null; + if (type != null) { + String methodSignature = methodExecution.getSignature(); + method = findIMethod(type, methodSignature); + } + return method; + } + + public static IMethod findIMethod(IType type, String methodSignature) { + try { + for (IMethod method : type.getMethods()) { + if (checkMethodSignature(type, method, methodSignature)) { + return method; + } + } + } catch (JavaModelException e) { + e.printStackTrace(); + } + return null; + } + + private static boolean checkMethodSignature(IType type, IMethod method, String methodSignature) { + String fqcn = type.getFullyQualifiedName(); + try { + StringBuilder jdtMethodSignature = new StringBuilder(); + jdtMethodSignature.append((method.isConstructor()) ? (fqcn + "(") : (fqcn + "." + method.getElementName() + "(")); + if (methodSignature.contains(jdtMethodSignature)) { + // ������v���Ă����ꍇ�Ɍ���A�������X�g����������ł���v���邩�ǂ����𔻒� (�I�[�o�[���[�h�ɂ��딻��������) + jdtMethodSignature.append(String.join(",", parseFQCNParameters(type, method)) + ")"); // �S�����̃V�O�l�`�������S����N���X���ɕϊ�����,�ŋ�؂��������� + return methodSignature.contains(jdtMethodSignature); + } + } catch (JavaModelException e) { + e.printStackTrace(); + } + return false; + } + + public static String resolveType(IType type, String typeName) { + try { + String[][] resolveTypes = type.resolveType(typeName); + if (resolveTypes != null) { + if (resolveTypes[0][0].isEmpty()) { + return (resolveTypes[0][1]); // �f�t�H���g�p�b�P�[�W�̏ꍇ�̓p�b�P�[�W����.�͓���Ȃ� + } else { + return (resolveTypes[0][0] + "." + resolveTypes[0][1]); // ���S����N���X�� + } + } + } catch (JavaModelException e) { + e.printStackTrace(); + } + return null; + } + + /** + * IMethod����擾�ł���S�����̃V�O�l�`�������S����N���X���ɒu�������Ċi�[�������X�g��Ԃ� + * + * @param type + * @param method + * @return + */ + private static List parseFQCNParameters(IType type, IMethod method) throws JavaModelException { + List parameters = new ArrayList<>(); + for (String parameterType : method.getParameterTypes()) { + String readableType = Signature.toString(parameterType); // �V�O�l�`���̕�������^���̕�����ɕϊ� (�z��͌���[]���‚�) + String[] readableTypeSplit = { "", "" }; // �^����[]�̕����p + int firstBracketIndex = readableType.indexOf("[]"); + final int NO_BRACKET_INDEX = -1; + if (firstBracketIndex == NO_BRACKET_INDEX) { + readableTypeSplit[0] = readableType; // �^�� + } else { + readableTypeSplit[0] = readableType.substring(0, firstBracketIndex); // �^�� + readableTypeSplit[1] = readableType.substring(firstBracketIndex); // �^���̌���[]�S�� + } + String tmp = resolveType(type, readableTypeSplit[0]); + if (tmp != null) { + readableTypeSplit[0] = tmp; + } + parameters.add(readableTypeSplit[0] + readableTypeSplit[1]); + } + return parameters; + } +} diff --git a/src/org/ntlab/traceDebugger/Variable.java b/src/org/ntlab/traceDebugger/Variable.java index bb4c2cf..657043d 100644 --- a/src/org/ntlab/traceDebugger/Variable.java +++ b/src/org/ntlab/traceDebugger/Variable.java @@ -195,7 +195,7 @@ private void getFieldsState() { // �t�B�[���h��ID��Type���擾���ĕ\�� - IType type = JavaEditorOperator.findIType(null, valueClassName); + IType type = JavaElementFinder.findIType(null, valueClassName); if (type == null) return; getFieldsState(type); // getFieldStateForSuperClass(type); // �e�N���X��k���Ă����A�����̃N���X�Œ�`���ꂽ�t�B�[���h�̏����擾���Ă��� (�������������������Ĕ��ɏd���Ȃ�) @@ -210,9 +210,9 @@ while (true) { String superClassName = type.getSuperclassName(); if (superClassName == null) break; - String fullyQualifiedSuperClassName = JavaEditorOperator.resolveType(type, superClassName); + String fullyQualifiedSuperClassName = JavaElementFinder.resolveType(type, superClassName); if (fullyQualifiedSuperClassName == null) break; - type = JavaEditorOperator.findIType(null, fullyQualifiedSuperClassName); + type = JavaElementFinder.findIType(null, fullyQualifiedSuperClassName); if (type == null) break; getFieldsState(type); } diff --git a/src/org/ntlab/traceDebugger/Variables.java b/src/org/ntlab/traceDebugger/Variables.java index 530e729..561e41d 100644 --- a/src/org/ntlab/traceDebugger/Variables.java +++ b/src/org/ntlab/traceDebugger/Variables.java @@ -115,9 +115,9 @@ // methodExecution������arguments���擾(ArrayList)���A����arguments�̃T�C�Y���擾(int) List args = methodExecution.getArguments(); if (args.size() > 0) { - IType type = JavaEditorOperator.findIType(methodExecution); + IType type = JavaElementFinder.findIType(methodExecution); String methodSignature = methodExecution.getSignature(); - IMethod method = JavaEditorOperator.findIMethod(type, methodSignature); + IMethod method = JavaElementFinder.findIMethod(type, methodSignature); String[] argNames = getParameterNames(method); // ������IMethod���牼���������擾���� for (int i = 0; i < args.size(); i++) { String argName = (argNames.length == args.size()) ? argNames[i] : "arg" + i; // ���Ȃ��Ƃ������̌����s��v�̂Ƃ��͐����������������Ă��Ȃ� diff --git a/src/org/ntlab/traceDebugger/analyzerProvider/DeltaMarkerManager.java b/src/org/ntlab/traceDebugger/analyzerProvider/DeltaMarkerManager.java index 6f87917..c84806e 100644 --- a/src/org/ntlab/traceDebugger/analyzerProvider/DeltaMarkerManager.java +++ b/src/org/ntlab/traceDebugger/analyzerProvider/DeltaMarkerManager.java @@ -37,6 +37,7 @@ import org.ntlab.traceAnalysisPlatform.tracer.trace.Statement; import org.ntlab.traceAnalysisPlatform.tracer.trace.TracePoint; import org.ntlab.traceDebugger.JavaEditorOperator; +import org.ntlab.traceDebugger.JavaElementFinder; public class DeltaMarkerManager { private Map> markerIdToMarkers = new HashMap<>(); @@ -169,7 +170,7 @@ } private void markAndOpenJavaFileForAlias(Alias alias, String message, String markerId) { - IFile file = JavaEditorOperator.findIFile(alias.getMethodExecution()); + IFile file = JavaElementFinder.findIFile(alias.getMethodExecution()); if (file != null) { IMarker marker = addMarkerForAlias(alias, file, message, markerId); JavaEditorOperator.markAndOpenJavaFile(marker); @@ -180,7 +181,7 @@ MethodExecution me = creationPoint.getMethodExecution(); String objectId = reference.getSrcObjectId() + " -> " + reference.getDstObjectId(); String objectType = reference.getSrcClassName() + " -> " + reference.getDstClassName(); - IFile file = JavaEditorOperator.findIFile(me); + IFile file = JavaElementFinder.findIFile(me); if (file != null) { IMarker marker = addMarkerForCreationPoint(creationPoint, file, message, objectId, objectType, markerId); JavaEditorOperator.markAndOpenJavaFile(marker); @@ -188,7 +189,7 @@ } private void markAndOpenJavaFileForCoordinator(MethodExecution methodExecution, String message, String markerId) { - IFile file = JavaEditorOperator.findIFile(methodExecution); + IFile file = JavaElementFinder.findIFile(methodExecution); if (file != null) { String objectId = methodExecution.getThisObjId(); String objectType = methodExecution.getThisClassName(); @@ -278,8 +279,8 @@ provider.connect(input); ASTParser parser = ASTParser.newParser(AST.JLS10); MethodExecution methodExecution = alias.getMethodExecution(); - IType type = JavaEditorOperator.findIType(methodExecution); - IMethod method = JavaEditorOperator.findIMethod(methodExecution, type); + IType type = JavaElementFinder.findIType(methodExecution); + IMethod method = JavaElementFinder.findIMethod(methodExecution, type); if (method != null) { ICompilationUnit unit = method.getCompilationUnit(); parser.setSource(unit); @@ -918,8 +919,8 @@ private void setAttributesForCoordinator(final Map attributes, MethodExecution methodExecution, IFile file) { // note: ���\�b�h�V�O�l�`�����n�C���C�g - IType type = JavaEditorOperator.findIType(methodExecution); - final IMethod method = JavaEditorOperator.findIMethod(methodExecution, type); + IType type = JavaElementFinder.findIType(methodExecution); + final IMethod method = JavaElementFinder.findIMethod(methodExecution, type); if (method == null) return; ASTParser parser = ASTParser.newParser(AST.JLS10); ICompilationUnit unit = method.getCompilationUnit();