geertjanw closed pull request #343: [NETBEANS-230] Workarounding
CompletionFailure from javac in a specif?
URL: https://github.com/apache/incubator-netbeans/pull/343
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/java.source.base/src/org/netbeans/modules/java/source/save/ElementOverlay.java
b/java.source.base/src/org/netbeans/modules/java/source/save/ElementOverlay.java
index 4fc56ea5c..94d9c99d8 100644
---
a/java.source.base/src/org/netbeans/modules/java/source/save/ElementOverlay.java
+++
b/java.source.base/src/org/netbeans/modules/java/source/save/ElementOverlay.java
@@ -771,7 +771,17 @@ public Element getEnclosingElement() {
@Override
public List<? extends Element> getEnclosedElements() {
- return wrap(ast, elements, delegateTo.getEnclosedElements());
+ //NETBEANS-230: workaround for javac bug JDK-8024687. See also
test:
+
//refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/CopyClassTest.java#testCopyClassToSamePackage
+ //Should be just:
+// return wrap(ast, elements, delegateTo.getEnclosedElements());
+ while (true) {
+ try {
+ return wrap(ast, elements,
delegateTo.getEnclosedElements());
+ } catch (Symbol.CompletionFailure cf) {
+ //ignore
+ }
+ }
}
@Override
diff --git
a/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/RefactoringTestBase.java
b/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/RefactoringTestBase.java
index 062889d36..010215f36 100644
---
a/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/RefactoringTestBase.java
+++
b/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/RefactoringTestBase.java
@@ -45,6 +45,7 @@
import org.netbeans.api.project.Sources;
import org.netbeans.core.startup.Main;
import org.netbeans.junit.NbTestCase;
+import org.netbeans.modules.java.source.TestUtil;
import org.netbeans.modules.java.source.indexing.JavaCustomIndexer;
import org.netbeans.modules.parsing.api.indexing.IndexingManager;
import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
@@ -202,7 +203,7 @@ protected void setUp() throws Exception {
public ClassPath findClassPath(FileObject file, String
type) {
if (sourcePath != null && sourcePath.contains(file)){
if (ClassPath.BOOT.equals(type)) {
- return
ClassPathSupport.createClassPath(System.getProperty("sun.boot.class.path"));
+ return TestUtil.getBootClassPath();
}
if (ClassPath.COMPILE.equals(type)) {
return
ClassPathSupport.createClassPath(new FileObject[0]);
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists