IDEA-98542 (help a guy to poison$ poor actor)

This commit is contained in:
Roman Shevchenko
2013-01-07 20:34:19 +01:00
parent 7e01ca7141
commit f201185868
5 changed files with 30 additions and 6 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,14 +42,15 @@ public class ClassFileViewProvider extends SingleRootFileViewProvider {
if (fileIndex.isInLibraryClasses(vFile) || !fileIndex.isInSource(vFile)) {
String name = vFile.getName();
// skip inners & anonymous
// skip inners & anonymous (todo: read actual class name from file)
int dotIndex = name.lastIndexOf('.');
if (dotIndex < 0) dotIndex = name.length();
int index = name.lastIndexOf('$', dotIndex);
if (index > 0) return null; // todo: read actual class name from file
return new ClsFileImpl((PsiManagerImpl)PsiManager.getInstance(project), this);
if (index <= 0 || index == dotIndex - 1) {
return new ClsFileImpl((PsiManagerImpl)PsiManager.getInstance(project), this);
}
}
return null;
}
@@ -0,0 +1,11 @@
// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available
package pkg;
class BuckClass$ {
BuckClass$() { /* compiled code */ }
static pkg.BuckClass$ getInstance() { /* compiled code */ }
}
@@ -0,0 +1,11 @@
package pkg;
class BuckClass$ {
BuckClass$() {
System.out.println(this);
}
static BuckClass$ getInstance() {
return new BuckClass$();
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@ public class ClsMirrorBuildingTest extends LightIdeaTestCase {
public void testParameterNames() { doTest(); }
public void testEmptyEnum() { doTest(); }
public void test$BuckClass() { doTest(); }
public void testBuckClass$() { doTest(); }
public void testExtMethods() { doTest(); }
public void testMethodReceiver() { doTest(); }
public void testPackageInfo() { doTest("package-info"); }