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.

Bug 135332

Summary: Massive code duplication between jmx and jconsole modules
Product: contrib Reporter: Jesse Glick <jglick>
Component: JMXAssignee: Joel Feraud <jferaud>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P1    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Jesse Glick 2008-05-19 16:30:07 UTC
Changeset #c96ac50ad906 ("JMX module split into jmx.common (autoload) + JMX + JConsole modules.") seems to have *copied*
JMX sources into JConsole rather than *moving* them. There are now numerous classes shared between the two modules. This
causes errors such as

http://hlemyzd-2.czech.sun.com:8080/hudson/job/NB_Trunk_Production/197/testReport/org.netbeans.core.projects/ValidateLayerConsistencyTest/testAreAttributesFine/

ClassNotFoundException: Will not load class org.netbeans.modules.jmx.configwizard.JMXConfigWizardIterator arbitrarily
from one of org.netbeans.StandardModule$OneModuleClassLoader@2f031310[org.netbeans.modules.jmx] and
org.netbeans.StandardModule$OneModuleClassLoader@ffce2f2[org.netbeans.modules.jconsole]; see
http://wiki.netbeans.org/DevFaqModuleCCE
	at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:244)

or

http://hlemyzd-2.czech.sun.com:8080/hudson/job/NB_Trunk_Production/205/testReport/org.netbeans.core.projects/ValidateLayerConsistencyTest/testValidShadows/

Will not load class org.netbeans.modules.jmx.jconsole.LaunchAction arbitrarily ...

Please go through these modules, figure out what belongs where, and remove the duplicates.

In the meantime, I am removing the jconsole module from AU, as its presence is breaking production builds.
Comment 1 Jesse Glick 2008-05-19 16:33:40 UTC
Removing jconsole from AU temporarily: #32725ced3c03
Comment 2 Joel Feraud 2008-05-19 17:52:27 UTC
Hi,

The issue is only with the sources in main repository, not with the modules from the update center.

The jmx.common (autoload) + JMX + JConsole modules submitted to the 6.1 stable UC (issue
http://www.netbeans.org/issues/show_bug.cgi?id=132190 )are *correct* :

If I look at the contents of org-netbeans-modules-jmx.jar it does not contain the classes which have been moved to
JConsole (such as the configwizard package for example).
 

I think I understand what happened when I pushed the sources to the main repository: I did an hg update before doing my
hg commit and push, so that brought over again in my repo the removed file. So the hp push pushed only the modified and
new files, and not the removed ones, I did not notice this mistake in the changeset
http://hg.netbeans.org/main/rev/c96ac50ad906 Sorry about that.

Note that the correct modules with the classes correctly moved/removed were first built and correctly validated and then
submitted to UC (Apr 17), and the mistake in the source push occurred only afterwards (Apr 18).

I am going to fix the state of the main repository ASAP.


Comment 3 Joel Feraud 2008-05-19 17:56:11 UTC
Jesse,

Since the nbm files from the update center are correct, and meanwhile I remove from the netbeans repository the files
that mistakenly remained in the jmx module source tree, would you agree to:

1. make again JConsole module available from the update center,

2. downgrade this issue to P2.

Thanks,
Joel
Comment 4 Joel Feraud 2008-05-19 18:29:08 UTC
FIXED: JConsole files which mistakenly remained in jmx module sources have been removed from NetBeans main hg repository.
Changeset: http://hg.netbeans.org/main/rev/df2461dc050b

Joel
Comment 5 Jesse Glick 2008-05-19 18:56:38 UTC
I am talking about the problem in trunk sources, which was breaking trunk builds; 6.1 AU is your concern.

Since #df2461dc050b seems to have removed the duplication, I will readd jconsole to the AU config: #2c4e3a938669

GenerateLocalizedPropertiesFiles.java is in both modules and should probably be deleted; even if it is still needed
(which I doubt), it is used only during the build and should never have been put in src/ to begin with.
Comment 6 Jesse Glick 2008-05-19 19:07:07 UTC
BTW the original mistake seems to be due to a misuse of Mercurial.

1. If you had used 'hg ren', the files in the old locations would have been correctly marked as removed (and you would
now have the ability to follow history and line-level annotations across the rename).

2. You should not generally do an update before a commit, because then you are committing something different from what
you actually tested. Do you work, commit, fetch, and push. Normal workflow does not involve the update command at all.

3. You should use 'hg out -pvM' before pushing to review your outgoing changes.
Comment 7 Quality Engineering 2008-05-20 05:06:22 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #206 build
Changeset: http://hg.netbeans.org/main/rev/32725ced3c03
User: Jesse Glick <jglick@netbeans.org>
Log: Removing jconsole from AU until #135332 is fixed.
Comment 8 Quality Engineering 2008-05-21 04:46:21 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #208 build
Changeset: http://hg.netbeans.org/main/rev/aa43b1f0a501
User: jferaud@netbeans.org
Log: update test generation of localized properties for jmx and jconsole (follow up to #135332)