Bug 229144 - ApplicationConfig broken
ApplicationConfig broken
Status: VERIFIED FIXED
Product: java
Classification: Unclassified
Component: Source
7.3.1
PC Windows 7
: P1 (vote)
: 7.3.1
Assigned To: Jan Lahoda
issues@java
73patch2-verified
: RANDOM
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-29 08:50 UTC by Jiri Skrivanek
Modified: 2013-05-08 02:25 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Broken ApplicationConfig. (1.50 KB, text/plain)
2013-04-29 08:50 UTC, Jiri Skrivanek
Details
Thread dump when shutting the IDE down. (47.40 KB, text/plain)
2013-04-29 08:51 UTC, Jiri Skrivanek
Details
test project (10.35 KB, application/x-gzip)
2013-05-01 23:59 UTC, David Konecny
Details
video.ogv (4.52 MB, application/octet-stream)
2013-05-02 00:01 UTC, David Konecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2013-04-29 08:50:46 UTC
Created attachment 133915 [details]
Broken ApplicationConfig.

ApplicationConfig.java gets broken while generating RESTful Web Services from Patterns. To reproduce:

- create Maven web project with GlassFish 4 (Java EE 6)
- open new file wizard
- choose "Web Services|RESTful Web Services from Patterns" and click Next
- click Next
- provide package name
- click Finish
- ApplicationConfig.java is broken because inserted block of code is at the wrong place

Product Version: NetBeans IDE Dev (Build web-main-javaee7-267-on-20130429)
Java: 1.7.0_17; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b02
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Comment 1 Jiri Skrivanek 2013-04-29 08:51:33 UTC
Created attachment 133916 [details]
Thread dump when shutting the IDE down.
Comment 2 David Konecny 2013-04-29 20:12:15 UTC
Sometimes I can see this issue all the type and other times it disappears and looks like it has been resolved. I will try to look into it again.
Comment 3 David Konecny 2013-05-01 22:59:44 UTC
More of a refactoring to simplify the code: 6c06faafd1c6
Comment 4 David Konecny 2013-05-01 23:54:57 UTC
I'm lost at what is the problem here. I debugged it and the values which are passed to java.source APIs seems to be correct yet Java code generated by java.source seems to be randomly broken. I would like to ask java.source owner for evaluation.

First, could you please just have a look at websvc.restapi/src/org/netbeans/modules/websvc/rest/ApplicationSubclassGenerator.java (trunk version should be OK) at reconfigApplicationClass() method whether it seems to be updating an existing java source correctly? If there is nothing obviously wrong then simplest test case I could narrow this down to is following:

#1) in websvc.restapi/src/org/netbeans/modules/websvc/rest/ApplicationSubclassGenerator.java search for "new TreeSet" and replace it with "new ArrayList" - that will cause the problem to happen more often

#2) rebuild the module - 'ant -q -f websvc.restapi/build.xml clean netbeans'

#3) start the IDE and open maven project which I will attach shortly. The project is simple but build it just in case to get all dependencies resolved. The project requires JDK 7. You will not need to deploy it so do not worry about application server.

#4) open two files from the test project: Astronaut.java and ApplicationConfig.java and align them next to each other for easier testing and watch the video which I'm going to attach to see the problem (the video is OGG video and should be playable directly in Chrome browser)

The problem is that for some reason content of ModificationResult before "res.commit()" is wrong and differs from what actually has changed.

Often it looks like java.source was not refreshed and keep operating on some older version of ApplicationConfig.class - sort of a workaround is to make a change in ApplicationCOnfig and save it and that makes problem go away for few iterations.

Thanks! As this can corrupt user's existing source code I'm raising priority to P1.
Comment 5 David Konecny 2013-05-01 23:59:42 UTC
Created attachment 134018 [details]
test project
Comment 6 David Konecny 2013-05-02 00:01:47 UTC
Created attachment 134019 [details]
video.ogv
Comment 7 Jan Lahoda 2013-05-03 12:51:40 UTC
I tried this:
http://hg.netbeans.org/jet-main/rev/4a53e1ca6991

Could you please try if it helps once this arrives to your repository? Thanks.
Comment 8 Petr Jiricka 2013-05-03 15:02:39 UTC
Thanks a lot Honzo.
Comment 9 Quality Engineering 2013-05-05 02:30:33 UTC
Integrated into 'main-golden', will be available in build *201305042300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/4a53e1ca6991
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #229144: correcting matching of tree selects (don't depend on Symbols, use plain names).
Comment 10 David Konecny 2013-05-05 19:45:08 UTC
Thanks. It does seem to fix the problem. I've transplanted the fix into javaee7 branch as 3c4ac580e908.

Jirka, could you verify please? Thanks.
Comment 11 Jiri Skrivanek 2013-05-06 11:52:41 UTC
It seems to be fixed. So far I haven't seen any breakage.
Comment 12 Quality Engineering 2013-05-07 00:20:07 UTC
Integrated into 'releases', will be available in build *201305062200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/3c4ac580e908
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #229144: correcting matching of tree selects (don't depend on Symbols, use plain names).
(transplanted from 4a53e1ca699152b0f84e176ba6d24220fe158491)
Comment 13 Quality Engineering 2013-05-08 02:25:11 UTC
Integrated into 'main-golden', will be available in build *201305072300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3d2a975ef087
User: David Konecny <dkonecny@netbeans.org>
Log: #229144 - ApplicationConfig broken
just refactoring which makes the problem to happen less often but it still happens - it needs more investigation from java.source guys


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo