diff --git a/org.ntlab.reverseDebugger/src/org/ntlab/reverseDebugger/JavaEditorOperator.java b/org.ntlab.reverseDebugger/src/org/ntlab/reverseDebugger/JavaEditorOperator.java index 682f842..2c45d96 100644 --- a/org.ntlab.reverseDebugger/src/org/ntlab/reverseDebugger/JavaEditorOperator.java +++ b/org.ntlab.reverseDebugger/src/org/ntlab/reverseDebugger/JavaEditorOperator.java @@ -60,10 +60,8 @@ IType type = findIType(meCaller); if (type != null) { IMethod method = findIMethod(meCaller, type); - if (method != null) { - openSrcFileOfIMethod(type, method); - highlight(highlightLineNo); - } + openSrcFile(type, method); + highlight(highlightLineNo); } } catch (InvalidTypeException | ClassNotLoadedException | InvocationException | IncompatibleThreadStateException e) { @@ -72,6 +70,17 @@ } /** + * �����œn����IType��IMethod�ɑΉ�����\�[�X�R�[�h��Ώ�Eclipse�̃G�f�B�^�ŊJ������ + * + * @param type + * @param method + */ + private void openSrcFile(IType type, IMethod method) throws InvalidTypeException, ClassNotLoadedException, + InvocationException, IncompatibleThreadStateException { + openInJavaEditor(type, method); + } + + /** * ���݃G�f�B�^�ŊJ����Ă���t�@�C���̎w�肵���s�Ƀn�C���C�g�������� * @param lineNo �n�C���C�g��������s�� */ @@ -91,28 +100,18 @@ } } } - - /** - * �����œn����IType��IMethod�ɑΉ�����\�[�X�R�[�h��Ώ�Eclipse�̃G�f�B�^�ŊJ������ - * - * @param type - * @param method - */ - private void openSrcFileOfIMethod(IType type, IMethod method) throws InvalidTypeException, ClassNotLoadedException, - InvocationException, IncompatibleThreadStateException { - openInJavaEditor(type, method); - } - + public IType findIType(JDIInstanceMethodCaller meCaller) throws InvalidTypeException, ClassNotLoadedException, InvocationException, IncompatibleThreadStateException { - StringReference declaringClassName = (StringReference)meCaller.callInstanceMethod("getDeclaringClassName"); - String projectPath = getLoaderPath(meCaller, declaringClassName); + String declaringClassName = ((StringReference)meCaller.callInstanceMethod("getDeclaringClassName")).value(); + declaringClassName = declaringClassName.replace(".", ""); + String projectPath = getLoaderPath(meCaller, meCaller.getVm().mirrorOf(declaringClassName)); IType type = null; if (projectPath != null) { IJavaProject javaProject = findJavaProject(projectPath); if (javaProject != null) { try { - type = javaProject.findType(declaringClassName.value()); + type = javaProject.findType(declaringClassName); } catch (JavaModelException e) { e.printStackTrace(); } @@ -165,10 +164,14 @@ private void openInJavaEditor(IType type, IMethod method) { try { - if (type != null && method != null) { + if (type != null) { IEditorPart editor = JavaUI.openInEditor(type); if (!type.isLocal() && !type.isMember()) { - JavaUI.revealInEditor(editor, (IJavaElement) method); + if (method != null) { + JavaUI.revealInEditor(editor, (IJavaElement)method); + } else { + JavaUI.revealInEditor(editor, (IJavaElement)type); + } } } } catch (PartInitException | JavaModelException e) {