Use deterministic order for configuration properties metadata

This commit updates the annotation processor to write metadata in a
consistent way. Groups, properties and hints are written and each item
is ordered alphabetically based on its name.

Also, deprecated items are written last.

Closes gh-14347
This commit is contained in:
Stephane Nicoll
2018-09-08 08:20:43 +02:00
parent d3ecd02987
commit 0493355241
6 changed files with 118 additions and 61 deletions

View File

@@ -18,8 +18,8 @@ package org.springframework.boot.configurationprocessor.json;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
// Note: this class was written without inspecting the non-free org.json source code.
@@ -111,7 +111,7 @@ public class JSONObject {
* Creates a {@code JSONObject} with no name/value mappings.
*/
public JSONObject() {
this.nameValuePairs = new HashMap<>();
this.nameValuePairs = new LinkedHashMap<>();
}
/**