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: | Java Editor and code completions doesn't recognize the generated classes in the imported/included library project | ||
---|---|---|---|
Product: | webservices | Reporter: | _ hong_lin <hong_lin> |
Component: | JAXB | Assignee: | _ gmpatil <gmpatil> |
Status: | RESOLVED WORKSFORME | ||
Severity: | blocker | CC: | dkonecny, michaelnazarov, mkuchtiak, pjiricka, rcruz, tzezula, vidhya |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 105645 | ||
Bug Blocks: | |||
Attachments: |
Sample app, including project JavaLibrary1 and JavaLibrary2
CVS diff for CompiledSourceForBinaryQuery.java in 'j2seproject' module |
Description
_ hong_lin
2007-08-29 22:02:58 UTC
Created attachment 47754 [details]
Sample app, including project JavaLibrary1 and JavaLibrary2
This is due to optimization in Java project system when jar in library is created thru another Netbeans project. Code completion and classpath seems to aggregated from the included Project meta-data rather than from the built jar itself. #105645 requests API to add generated Java source root by other modules. Till the API is implemented, if 'j2seproject' team agrees we can add JAXB Wizard specific change in 'j2seproject' project's class CompiledSourceForBinaryQuery. release note added beta 1 Hi Tomas, We have an issue where code completion and Java Editor does not recognize JAXB Wizard generated classes, when generated classes are in imported Java SE Project/Class library. I have modified and tested JAXB Wiz specific changes to CompiledSourceForBinaryQuery. After the change, Editor is recognizing the JAXB generated classes as well as code-completion is working in the target project. Let me know if these changes are Ok, I have attached the CVS diff file. Thanks, -Girish Created attachment 49391 [details]
CVS diff for CompiledSourceForBinaryQuery.java in 'j2seproject' module
The patch seems good to me, feel free to integrate it. The only minor thing is that the new java.io.File is created and not normalized by FileUtil.normalizeFile (), but the wssupport also doesn't do it. It is probably save not to call FileUtil.normalizeFile () in this case since you created the folder and you know the correct character capitalization. Thanks Tomas, I have checked-in the changes. Hong, Please verify using CB #3512 or later. Yes, the changes look fine. Regressed in recent builds. See http://www.netbeans.org/issues/show_bug.cgi?id=117698 Re-opening the issue. *** Issue 118696 has been marked as a duplicate of this issue. *** Implemented Classpath provider and registered using lookup merger, similar to Web Services. Hong, Michael, fix is in the trunk, once it works for you guys, I will request for check-in to release60_beta2. Changed files. http://xml.netbeans.org/source/browse/xml/jaxb/src/org/netbeans/modules/xml/jaxb/model/JAXBWizLookupProvider.java?r1=1.2&r2=1.3 http://xml.netbeans.org/source/browse/xml/jaxb/src/org/netbeans/modules/xml/jaxb/model/JAXBGenSourceClassPathProvider.java?rev=1.1&content-type=text/vnd.viewcvs-markup Build 200710150000 Well it works somehow but not completely as I understood from description. So I opened both projects and found exclamation mark within both projects. Opened java files are clear. After some manipulations like Cleanup and Build some of tree error marks gone. After reopening all marks gone. But I was unable to find any subnodes under expanded "JavaLibrary2 -> Libraries -> JavaLibrary1". Not sure is this other issue or no. So finally editor works fine, libraries looks corrupted. Sometimes exclamation mark comes back but editor still looks normal and compilation works. Michael, Regarding your first issue is synchronization of error hints between Editor and nodes in explorer. I think it takes some times few seconds to both synchronize. Regarding library node expansion, "JavaLibrary2 -> Libraries ->JavaLibrary1" will not expand if library is of project type. It will expand if you add library as 'Jar/Folder'. Marking as fixed. I think issues observed by Michael, especially error hint synchronization between explorer nodes and Editor needs to be address separately if it is agreed as an issue. Product Version: NetBeans IDE 6.0 RC1 (Build 200711120000) Java: 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105 System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb) Looks like issue come back. Downloaded from http://bits.netbeans.org/download/6.0/nightly/latest_rc1/ BTW I used our own scenarios as specified in duplicate issue and did not check using these ones. Sorry, I'm unable to establish exact steps to reproduce now while in previous builds it was pretty easy. I'm not sure is it regression or random error with unknown nature. It's better to leave as fixed for a while. I'll try to investigate more. Product Version: NetBeans IDE 6.0.1 dev (Build 200801230000) Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19 System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb) Actually issues come back in last build with JDK6u4, but I think this is due to build not due to JDK. Willl check with previous JDK as well but this requires some time to reinstall JDK. Details about steps to reproduce are in issue 118696. I am unable to reproduce using the latest build. I had wait 5-6 secs before imports were resolved, Product Version: NetBeans IDE Dev (Build 20080130185640) Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06 System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb) Userdir: C:\Documents and Settings\gpatil\.netbeans\dev Product Version: NetBeans IDE Dev (Build 200802050005) Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19 System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb) Works for me as well. Okey, this feature looks strange and rises time to time from random build. I think this is bad behavior, but I know nothing about reasons of this situation. Possibly this is side effect of code changes. As for waiting for few seconds -- if this works it works momentarily for me, if if doesn't it doesn't even after hour of waiting. Closing for now, as unable reproduce. Product Version: NetBeans IDE Dev (Build 200803250006) Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19 System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb) It doesn't work again. This is one of the issues which work or no under strange conditions. For example: if I started IDE and created JAXB manually then IDE unable to complete import statement or class name in code correctly. But after manual import IDE able to complete class names in code. Fix Imports doesn't work. If IDE started and JAXB created from automated tests then IDE able to complete class names and Fix Imports works fine. I believe we need to spend some more time and fix this one. One more addition: looks like if binding created from "supported" xsd then code completion doesn't work, if used "unsupported" wsdl file then code completion works. Sorry, one more addition again: completion doesn't work after first binding creation. If one deleted first binding then created it again -- completion looks workable... Anyway -- this is very strange behavior. With single project I am not able to simulate, but able to with original use case. 1. Create Java Library project - JL. 2. Create JAXB Binding using XSD. 3. Code completion for import works in JL 4. Create Java SE project JSE, add Project JL to Library. 5. In JSE code completion does not work while tryping import statements. Michael is this what you are seeing? Marking "Incomplete". NB 6.1 in HRM, working to find solution to the scenario described earlier, assuming Michael is describing the same. Seems like issue is not confined to JAXB-Wiz. Tried with refreshing the "build" folder FileObject in JAXBGenSourceClassPathProvider as well at the end of the JAXB Wizard. Also hard coding the generated source path J2SE project's SourcePathImplementation did not help. Code completion works in the project JAXB Binding is created but not in the project using the first project as library. Tried creating Webservice client in the first project, observed WsImport generated classes are also not available for code completion in the second project. moving opened issues where TM != dev to TM=TBD *** Issue 134159 has been marked as a duplicate of this issue. *** *** Issue 130389 has been marked as a duplicate of this issue. *** *** Issue 136088 has been marked as a duplicate of this issue. *** *** Issue 136496 has been marked as a duplicate of this issue. *** Seems like issue is fixed in latest build. Product Version: NetBeans IDE Dev (Build 20080723164810) Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-b05 System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb) *** Issue 140602 has been marked as a duplicate of this issue. *** *** Issue 139138 has been marked as a duplicate of this issue. *** This is not INCOMPLETE - issue 139138 gives clear steps how to reproduce the problem. I've downladed last updates for NB 6.1 (maybe those named patch 3) and this issue has arised again. More, if project A has some JAXB bindings and it's libraries are imported to project B and project B serves EJB, then neither editor nor compiler can see any packages of project A. If you take those jaxb bindings to another project and include them, it doesn't works. But if ypu copy the jaxb generated sources as regular packages and classes and erase that jaxb bindings, the editor can now see all packages also the compiler. If the issue isn't reproducible in 6.5, the bug can be marked as fixed. I noticed, the SourceForBinaryQuery interface was implemented already. With latest NB 6.5 I am not able to simulate the issue. Product Version: NetBeans IDE Dev (Build 20080923152338) Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-b05 System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb) Userdir: C:\tmp\nb65_0923 Tried below test cases, - Java SE project importing another Java SE project. - Web Application project importing Java SE project. - EJB project importing Java SE project. - EJB project importing another EJB project. aperezymadrid, Could you try latest build and let us know steps to reproduce. Closing as worksforme due to last comment and no reporter feedback for more than two months. It should work now without no problem. Regarding CC, the generated sources are now handled as normal sources. See the issue 105645. |