This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I added a package to openide/text, org.netbeans.modules.openide.text, and I moved the indentation engine beaninfo and editor from core to this package. Then I created a bridge module openide/text/indentation-bridge. I moved the indentation engine beaninfo and editor from core to this module. Then I realized I didn't need the bridge module if I killed IndentEngineEditor (well, removed its custom editor and inheritance from ServiceTypeEditor). So I recreated o.n.m.o.text and moved the sources back there. The following exception was thrown: java.lang.IllegalStateException: Cannot call getTreeMaker before toPhase. at org.netbeans.api.java.source.WorkingCopy.getTreeMaker(WorkingCopy.java:124) at org.netbeans.modules.refactoring.java.spi.RefactoringVisitor.setWorkingCopy(RefactoringVisitor.java:50) at org.netbeans.modules.refactoring.java.plugins.MoveTransformer.setWorkingCopy(MoveTransformer.java:52) at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$TransformTask.run(JavaRefactoringPlugin.java:253) at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$TransformTask.run(JavaRefactoringPlugin.java:240) at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:795) at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:217) at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.createAndAddElements(JavaRefactoringPlugin.java:229) at org.netbeans.modules.refactoring.java.plugins.MoveRefactoringPlugin.prepare(MoveRefactoringPlugin.java:224) at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:316) at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:173) at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:708) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)
Raising to p2 - this appears to happen with any use of Move Class on multiple classes when moving between modules. Afterwards, memory usage remains high and the UI has very poor responsiveness until a restart.
Cannot reproduce. Moreover it cannot happen: public void setWorkingCopy(WorkingCopy workingCopy) { this.workingCopy = workingCopy; try { this.workingCopy.toPhase(JavaSource.Phase.RESOLVED); } catch (IOException ioe) { ErrorManager.getDefault().notify(ioe); } this.make = workingCopy.getTreeMaker(); } Anyone able to reproduce it?
Is it possible to have some kind of race condition here? Or for getTreeMaker() to return the wrong one? What I am left with after this exception is that the files are copied, but their package statements are wrong. So I think when the files are being parsed, they have been moved to a new package on disk, but the package statements are wrong. I've noticed some weird behavior with the java editor when the package statement is incorrect on a java source - perhaps this is a clue of how it can happen? Exact steps to reproduce: Open core. Create a new module project, core/property-editors Select all the property editors which are *not* NB-specific in org.netbeans.beaninfo.editors (i.e. editors for jdk classes - rectangle, point, dimension, etc.) Move them to the new package.
Jirko, can you reproduce it?
I can remember, I've seen it once, while developing tests, but I cannot reproduce it in current build
BTW: Honzo, you should be checking the return value of the toPhase method - it may happen that there is not enough memory to parser/attribute the file - the toPhase method will then return the phase that was reached. If the phase you need was not reached, you should finish the Task immediately - it should be called again for the same file.
Checking in spi/RefactoringVisitor.java; /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/spi/RefactoringVisitor.java,v <-- RefactoringVisitor.java new revision: 1.3; previous revision: 1.2 done RCS file: /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/spi/ToPhaseException.java,v done Checking in spi/ToPhaseException.java; /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/spi/ToPhaseException.java,v <-- ToPhaseException.java initial revision: 1.1 done Checking in spi/JavaRefactoringPlugin.java; /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/spi/JavaRefactoringPlugin.java,v <-- JavaRefactoringPlugin.java new revision: 1.7; previous revision: 1.6 done Checking in plugins/CopyTransformer.java; /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/CopyTransformer.java,v <-- CopyTransformer.java new revision: 1.6; previous revision: 1.5 done Checking in plugins/FindVisitor.java; /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/FindVisitor.java,v <-- FindVisitor.java new revision: 1.2; previous revision: 1.1 done Checking in plugins/JavaWhereUsedQueryPlugin.java; /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/JavaWhereUsedQueryPlugin.java,v <-- JavaWhereUsedQueryPlugin.java new revision: 1.20; previous revision: 1.19 done Checking in plugins/InnerToOuterTransformer.java; /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/InnerToOuterTransformer.java,v <-- InnerToOuterTransformer.java new revision: 1.6; previous revision: 1.5 done Checking in plugins/VarUsagesVisitor.java; /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/VarUsagesVisitor.java,v <-- VarUsagesVisitor.java new revision: 1.5; previous revision: 1.4 done Checking in plugins/PullUpTransformer.java; /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/PullUpTransformer.java,v <-- PullUpTransformer.java new revision: 1.10; previous revision: 1.9 done Checking in plugins/MoveTransformer.java; /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/MoveTransformer.java,v <-- MoveTransformer.java new revision: 1.11; previous revision: 1.10 done Checking in plugins/UseSuperTypeRefactoringPlugin.java; /cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/UseSuperTypeRefactoringPlugin.java,v <-- UseSuperTypeRefactoringPlugin.java new revision: 1.9; previous revision: 1.8 done