@@ -53,17 +53,12 @@ public enum ErrorHandling {
53
53
private static final Map <String , String > ZONE2COUNTRY =
54
54
STANDARD_CODES .zoneParser .getZoneToCountry ();
55
55
56
- /** <Description, Markdown> */
57
- private static final PathDescriptionParser parser = new PathDescriptionParser ();
58
-
59
- private static final PathDescriptionParser hintsParser = new PathDescriptionParser ();
60
-
61
56
private static RegexLookup <Pair <String , String >> pathHandling = null ;
62
57
63
58
private static RegexLookup <Pair <String , String >> pathHintsHandling = null ;
64
59
65
- /** markdown to append */
66
- private static final String references = parser . getReferences () ;
60
+ /** Markdown to append from PathDescriptions.md. Initialized in getPathHandling */
61
+ private static String references = null ;
67
62
68
63
/** for tests, returns the big string */
69
64
static String getBigString (String fileName ) {
@@ -77,17 +72,22 @@ static String getBigString(String fileName) {
77
72
}
78
73
}
79
74
80
- /** for tests */
75
+ /** Public for tests */
81
76
public static RegexLookup <Pair <String , String >> getPathHandling () {
82
77
if (pathHandling == null ) {
78
+ PathDescriptionParser parser = new PathDescriptionParser ();
83
79
pathHandling = parser .parse (pathDescriptionFileName );
80
+ references = parser .getReferences ();
84
81
}
85
82
return pathHandling ;
86
83
}
87
84
88
85
private static RegexLookup <Pair <String , String >> getPathHintsHandling () {
89
86
if (pathHintsHandling == null ) {
87
+ PathDescriptionParser hintsParser = new PathDescriptionParser ();
90
88
pathHintsHandling = hintsParser .parse (pathDescriptionHintsFileName );
89
+ // Note: Hints currently use no references. If they did, they could be
90
+ // initialized here by hintReferences = hintsParser.getReferences()
91
91
}
92
92
return pathHintsHandling ;
93
93
}
@@ -143,7 +143,6 @@ public String getRawDescription(String path, Object context) {
143
143
}
144
144
145
145
public String getHintRawDescription (String path , Object context ) {
146
-
147
146
status .clear ();
148
147
final Pair <String , String > entry = getPathHintsHandling ().get (path , context , pathArguments );
149
148
if (entry == null ) {
0 commit comments