wang3820 commented on code in PR #2097:
URL: https://github.com/apache/jena/pull/2097#discussion_r1398231848


##########
jena-core/src/main/java/org/apache/jena/shared/impl/PrefixMappingImpl.java:
##########
@@ -187,7 +189,7 @@ public String getNsPrefixURI( String prefix )
         
     @Override
     public Map<String, String> getNsPrefixMap()
-        { return CollectionFactory.createHashedMap( prefixToURI ); }
+        { return new LinkedHashMap<>( prefixToURI ); }

Review Comment:
   I think the problems is in `pmTestAbbrev`. For test 
`org.apache.jena.riot.system.TestPrefixMapOverPrefixMapping#prefixMap_abbrev_10 
`, when this line is called, 
   
https://github.com/apache/jena/blob/fc01d33e6c11eed68784f820bf2dd161868d1d37/jena-arq/src/test/java/org/apache/jena/riot/system/AbstractTestPrefixMap.java#L313
   either `(p0,b)` or `(p1,)` could be returned, as order in `prefixToURI` is 
not predictable. But the implemetation of this function
   
https://github.com/apache/jena/blob/fc01d33e6c11eed68784f820bf2dd161868d1d37/jena-arq/src/test/java/org/apache/jena/riot/system/AbstractTestPrefixMap.java#L326
   would only return `"p0:b"`. So if line 313 returns (p1,), the assertion here 
would fail.
   
https://github.com/apache/jena/blob/fc01d33e6c11eed68784f820bf2dd161868d1d37/jena-arq/src/test/java/org/apache/jena/riot/system/AbstractTestPrefixMap.java#L328
   
   
   However, I do agree that putting the `LinkedHashMap` there is not a good 
fix. All that does is to make nondex, the tool I was using, not to shuffle that 
map so that the test does not fail. 
   
   I hope this offers some clarification. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to