HansBrende commented on a change in pull request #151: ANY23-445 Review 
spotbugs issues
URL: https://github.com/apache/any23/pull/151#discussion_r336324532
 
 

 ##########
 File path: api/src/main/java/org/apache/any23/vocab/Vocabulary.java
 ##########
 @@ -142,12 +142,12 @@ public IRI getProperty(String name, IRI defaultValue) {
      */
     public IRI getPropertyCamelCase(String property) {
         String[] names = property.split("\\W");
-        String camelCase = names[0];
+        StringBuilder camelCase = new 
StringBuilder(property.length()).append(names[0]);
         for (int i = 1; i < names.length; i++) {
             String tmp = names[i];
-            camelCase += tmp.replaceFirst("(.)", tmp.substring(0, 
1).toUpperCase(java.util.Locale.ROOT));
+            camelCase.append(tmp.replaceFirst("(.)", tmp.substring(0, 
1).toUpperCase(java.util.Locale.ROOT)));
 
 Review comment:
   I suppose it is true that this class in particular is part of any23 `api` 
rather than `core`, and `core` has the commons-lang3 dependency, so this would 
add that extra dependency to `api`. I'm not sure if this is a big problem since 
most people are using `core` rather than `api` alone... however if you'd rather 
not add an extra dependency to `api` I suppose we could leave it as-is for now 
(however I'd like to improve the implementation of that method at some point in 
the future).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to