diff --git a/src/org/ntlab/traceDebugger/JavaEditorOperator.java b/src/org/ntlab/traceDebugger/JavaEditorOperator.java index 8b7c7c8..9dace41 100644 --- a/src/org/ntlab/traceDebugger/JavaEditorOperator.java +++ b/src/org/ntlab/traceDebugger/JavaEditorOperator.java @@ -36,6 +36,7 @@ public class JavaEditorOperator { // private static List markers = new ArrayList<>(); + private static String previousJavaProjectPath = ""; /** * �����œn����meCaller���ɂ���methodExecution����`����Ă���N���X�̃\�[�X�R�[�h��Ώ�Eclipse�̃G�f�B�^�ŊJ������ @@ -227,22 +228,48 @@ declaringClassName = declaringClassName.replace(".", ""); return findIType(methodExecution, declaringClassName); } - + public static IType findIType(MethodExecution methodExecution, String declaringClassName) { String projectPath = getLoaderPath(methodExecution, declaringClassName); IType type = null; if (projectPath != null) { IJavaProject javaProject = findJavaProject(projectPath); if (javaProject != null) { + previousJavaProjectPath = projectPath; try { type = javaProject.findType(declaringClassName); } catch (JavaModelException e) { e.printStackTrace(); } } + } else { + IJavaProject javaProject = findJavaProject(previousJavaProjectPath); + if (javaProject != null) { + try { + type = javaProject.findType(declaringClassName); + } catch (JavaModelException e) { + e.printStackTrace(); + } + } } return type; } + +// public static IType findIType(MethodExecution methodExecution, String declaringClassName) { +// String projectPath = getLoaderPath(methodExecution, declaringClassName); +// IType type = null; +// if (projectPath != null) { +// IJavaProject javaProject = findJavaProject(projectPath); +// if (javaProject != null) { +// try { +// type = javaProject.findType(declaringClassName); +// } catch (JavaModelException e) { +// e.printStackTrace(); +// } +// } +// } +// return type; +// } private static String getLoaderPath(MethodExecution methodExecution, String declaringClassName) { TraceJSON traceJSON = (TraceJSON)TraceDebuggerPlugin.getAnalyzer().getTrace();