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 253409

Summary: [81cat] Unwanted order changes in project.properties
Product: apisupport Reporter: cezariusz <cezariusz>
Component: ProjectAssignee: Martin Kozeny <mkozeny>
Status: NEW ---    
Severity: normal CC: cezariusz, omolenkamp
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Other   
Issue Type: DEFECT Exception Reporter:
Attachments: Java project - before
Java project - after
Files changed in platform sources

Description cezariusz 2015-07-10 14:48:08 UTC
Product Version: NetBeans IDE Dev (Build 201507040001)
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b15
System: Windows 8 version 6.2 running on amd64; UTF-8; pl_PL (nb)

Opening a Java project created with NetBeans 8.0.x in NB 8.1 (dev) changes the order of entries in project.properies. It creates a mess in a source control system and makes it hard to review changes.
Comment 1 cezariusz 2015-07-10 14:51:18 UTC
Created attachment 154564 [details]
Java project - before
Comment 2 cezariusz 2015-07-10 14:51:35 UTC
Created attachment 154565 [details]
Java project - after
Comment 3 cezariusz 2015-07-10 15:02:59 UTC
Created attachment 154566 [details]
Files changed in platform sources

I've opened platform sources with 8.1 (dev) - on the screenshot you can see how many files had been changed.
Comment 4 cmolodo 2015-11-10 15:07:26 UTC
I'm seeing a similar issue in the newly released 8.1 Build 201510222201.  It doesn't happen when a project is opened, but when you change any property, the property keys in the project.properties file are no longer in alphabetical order.  It's enough of a problem that I'm going back to 8.0.2 rather than deal with the source control headache of having project.properties files being completely rearranged.

Maybe related to bug 248307?
Comment 5 omolenkamp 2016-11-14 12:51:11 UTC
It looks like project.properties is edited using Properties instead of AntProjectHelper/EditableProperties in (at least) these source files:

  j2ee.samples/src/org/netbeans/modules/j2ee/samples/SampleProjectGenerator.java
  jmx.common/src/org/netbeans/modules/jmx/common/runtime/J2SEProjectType.java
  junit.ant.ui/src/org/netbeans/modules/junit/ant/ui/JUnitProjectOpenedHook.java

When using Properties, the order of the properties is not preserved.
Comment 6 cmolodo 2017-03-22 17:10:31 UTC
This issue affects version 8.2 as well.  Any chance it will be addressed?  We can't upgrade from 8.0.2 until this is resolved.