[ 
https://issues.apache.org/jira/browse/KNOX-2131?focusedWorklogId=345430&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-345430
 ]

ASF GitHub Bot logged work on KNOX-2131:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Nov/19 17:26
            Start Date: 18/Nov/19 17:26
    Worklog Time Spent: 10m 
      Work Description: risdenk commented on pull request #201: KNOX-2131 - 
Fixed sonarcloud bugs
URL: https://github.com/apache/knox/pull/201#discussion_r347508488
 
 

 ##########
 File path: 
gateway-provider-rewrite/src/main/java/org/apache/knox/gateway/filter/rewrite/impl/html/HtmlFilterReaderBase.java
 ##########
 @@ -264,19 +262,12 @@ private String getNamespace( String prefix ) {
       return getNamespaces().get( prefix );
     }
 
-    private QName getQName( String name ) {
-      String prefix;
-      String local;
-      int colon = ( name == null ? -1 : name.indexOf( ':' ) );
-      if( colon < 0 ) {
-        prefix = "";
-        local = name;
-      } else {
-        prefix = name.substring( 0, colon );
-        local = ( colon + 1 < name.length() ? name.substring( colon + 1 ) : "" 
);
-      }
-      String namespace = getNamespace( prefix );
-      return new QName( namespace, local, prefix );
+    private QName getQName(String name) {
+      final int colon = name == null ? -1 : name.indexOf(':');
+      final String prefix = name != null && colon > 0 ? name.substring(0, 
colon) : "";
 
 Review comment:
   Might make sense for helper methods like `getPrefix` and `getLocal`. The 
`local` processing is a bit involved for one line.
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 345430)
    Time Spent: 20m  (was: 10m)

> Fixing bugs found in sonarcloud - 2019 Nov
> ------------------------------------------
>
>                 Key: KNOX-2131
>                 URL: https://issues.apache.org/jira/browse/KNOX-2131
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: Server
>    Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.3.0
>            Reporter: Sandor Molnar
>            Assignee: Sandor Molnar
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: Screen Shot 2019-11-18 at 5.13.03 PM.png
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> I browsed the list of {{bugs}} in 
> [https://sonarcloud.io/project/issues?id=knox-gateway&resolved=false&types=BUG]
>  and I believe those issue should be fixed:
>  * possible NPE being thrown
>  * eliminating "always true" conditions
>  * serializing only {{Serializable}} objects
>  
> !Screen Shot 2019-11-18 at 5.13.03 PM.png|thumbnail!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to