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.
Summary: | Entities didn't appear in the model until IDE restart | ||
---|---|---|---|
Product: | javaee | Reporter: | Jan Stola <jstola> |
Component: | Code | Assignee: | Andrei Badea <abadea> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | abadea, blaha, emononen, jvagner, pjiricka, tzezula |
Priority: | P2 | Keywords: | RANDOM |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Events
log file RepositoryUpdater diff which fixes the java side and does logging |
Description
Jan Stola
2007-04-20 09:18:31 UTC
No "added" ClassIndex events seem to be sent for DiscountCode, only "changed" events. Tomasi, could you please look at it? I can work around by checking if changed types are entity classes (which I should do anyway), but still, the "added" events should be sent too. With the following diff to ClassIndexImpl -----%<----- Index: ClassIndexImpl.java =================================================================== RCS file: /cvs/java/source/src/org/netbeans/modules/java/source/usages/ClassIndexImpl.java,v retrieving revision 1.4 diff -u -r1.4 ClassIndexImpl.java --- ClassIndexImpl.java 11 Apr 2007 11:45:51 -0000 1.4 +++ ClassIndexImpl.java 20 Apr 2007 10:26:41 -0000 @@ -107,12 +107,15 @@ ClassIndexImplListener l = lr.get(); if (l != null) { if (added != null) { + System.out.println("added " + added.getTypes()); l.typesAdded(added); } if (removed != null) { + System.out.println("removed " + removed.getTypes()); l.typesRemoved(removed); } if (changed != null) { + System.out.println("changed " + changed.getTypes()); l.typesChanged(changed); } } -----%<----- I obtained the attached log, which does not contain an "added" event for DiscountCode. Created attachment 41329 [details]
Events
Don't you generate the classes by java.io.File? Are the generated classes visible in the GoToType? The files are created using GenerationUtils, which uses DataObject.createFromTemplate(). I assume that uses FileObject's, right? Yes, both classes are visible in Go To Type. I just got "added" events for both classes during a debug session. Adding some logging and checking and adding new objects to the model also on "changed" events. This needs to be done anyway, and in this case it also works around the "added" events not being sent. Checking in j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/AnnotationScanner.java; /cvs/j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/AnnotationScanner.java,v <-- AnnotationScanner.java new revision: 1.3; previous revision: 1.2 done Checking in j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/ObjectProvider.java; /cvs/j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/ObjectProvider.java,v <-- ObjectProvider.java new revision: 1.3; previous revision: 1.2 done Checking in j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObject.java; /cvs/j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObject.java,v <-- PersistentObject.java new revision: 1.3; previous revision: 1.2 done Checking in j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManager.java; /cvs/j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManager.java,v <-- PersistentObjectManager.java new revision: 1.4; previous revision: 1.3 done Checking in j2ee/metadata/support/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManagerTest.java; /cvs/j2ee/metadata/support/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManagerTest.java,v <-- PersistentObjectManagerTest.java new revision: 1.4; previous revision: 1.3 done Checking in j2ee/persistenceapi/src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/EntityImpl.java; /cvs/j2ee/persistenceapi/src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/EntityImpl.java,v <-- EntityImpl.java new revision: 1.3; previous revision: 1.2 done Checking in j2ee/persistenceapi/src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/EntityMappingsImpl.java; /cvs/j2ee/persistenceapi/src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/EntityMappingsImpl.java,v <-- EntityMappingsImpl.java new revision: 1.4; previous revision: 1.3 done Previous commit had a commit log referring to issue 101719 instead of this one. Committing again with the right commit log. Checking in j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/AnnotationScanner.java; /cvs/j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/AnnotationScanner.java,v <-- AnnotationScanner.java new revision: 1.5; previous revision: 1.4 done Checking in j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/ObjectProvider.java; /cvs/j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/ObjectProvider.java,v <-- ObjectProvider.java new revision: 1.5; previous revision: 1.4 done Checking in j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObject.java; /cvs/j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObject.java,v <-- PersistentObject.java new revision: 1.5; previous revision: 1.4 done Checking in j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManager.java; /cvs/j2ee/metadata/support/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManager.java,v <-- PersistentObjectManager.java new revision: 1.6; previous revision: 1.5 done Checking in j2ee/metadata/support/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManagerTest.java; /cvs/j2ee/metadata/support/test/unit/src/org/netbeans/modules/j2ee/metadata/model/api/support/annotation/PersistentObjectManagerTest.java,v <-- PersistentObjectManagerTest.java new revision: 1.6; previous revision: 1.5 done Checking in j2ee/persistenceapi/src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/EntityImpl.java; /cvs/j2ee/persistenceapi/src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/EntityImpl.java,v <-- EntityImpl.java new revision: 1.5; previous revision: 1.4 done Checking in j2ee/persistenceapi/src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/EntityMappingsImpl.java; /cvs/j2ee/persistenceapi/src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/EntityMappingsImpl.java,v <-- EntityMappingsImpl.java new revision: 1.6; previous revision: 1.5 done The remaining part is up to Tomas, assigning to Java module. *** Issue 102161 has been marked as a duplicate of this issue. *** J1_STOPPER? Probably I've missed something. To reproduce this issue I have to turn off "workaround" which is in the frozen trunk. So even if I fix this no one in trunk or tomorrow on the branch will notice anything. Can you explain more deeply what effect will have the fix on J1 build except of possible destabilization? I've did some changes to prevent javac to generate more signature files + logging. But it seems that problem is somewhere in model. See attached log file. The TYPES_ADDED events are fired from ClassIndex for all the generated classes, but the wizard crashes. It's strange that at the beginning there are 2 ClassIndexes and after while there are 4. Created attachment 41660 [details]
log file
Created attachment 41661 [details]
RepositoryUpdater diff which fixes the java side and does logging
I'm sorry, I thought that the issue isn't workarounded and should be fixed in java module. In case nobody is able to reproduce in the latest daily build, let's to downgrade, remove SW and fix after M9. If Andrei's workaround works fine I will be rather not to integrate it into M9 since it seems that the fix is not isolated in single (java) module. jstola or jvagner can you check whether Andrei's workaround resolves the issue? Thanks, Petr Cool, now Master/Detail Form wizard works perfectly. NetBeans IDE Dev (Build 20070426-0113) 1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02 Linux version 2.6.17-10-386 running on i386 en_US (nb); UTF-8 I suggest to downgrade the bug now since workaround works. Workaround exists, decreasing priority. |