[ 
https://issues.apache.org/jira/browse/TIKA-3400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17346376#comment-17346376
 ] 

ASF GitHub Bot commented on TIKA-3400:
--------------------------------------

tballison commented on a change in pull request #441:
URL: https://github.com/apache/tika/pull/441#discussion_r633762174



##########
File path: 
tika-eval/tika-eval-core/src/main/java/org/apache/tika/eval/core/tokens/URLEmailNormalizingFilterFactory.java
##########
@@ -69,11 +69,10 @@ public boolean incrementToken() throws IOException {
                 return false;
             }
             //== is actually substantially faster than .equals(String)
-            if (typeAtt.type() == 
UAX29URLEmailTokenizer.TOKEN_TYPES[UAX29URLEmailTokenizer.URL]) {
+            if 
(typeAtt.type().equals(UAX29URLEmailTokenizer.TOKEN_TYPES[UAX29URLEmailTokenizer.URL]))
 {

Review comment:
       This relies on the Lucene not changing the underlying static strings: 
https://github.com/apache/lucene/blob/main/lucene/analysis/common/src/java/org/apache/lucene/analysis/email/UAX29URLEmailTokenizer.java#L61

##########
File path: 
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/onenote/FileNode.java
##########
@@ -257,11 +257,11 @@ public void print(OneNoteDocument document, OneNotePtr 
pointer, int indentLevel)
                     subType.revisionManifest.revisionRole);
 
         }
-        if ((gctxid != ExtendedGUID.nil() ||
+        if ((!gctxid.equals(ExtendedGUID.nil()) ||

Review comment:
       To be clear, I'm not asking you to do the static thing on this issue.  
Your catch is important.  Thank you!




-- 
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:
us...@infra.apache.org


> Use equals for Object and String Comparison Instead of ==
> ---------------------------------------------------------
>
>                 Key: TIKA-3400
>                 URL: https://issues.apache.org/jira/browse/TIKA-3400
>             Project: Tika
>          Issue Type: Bug
>    Affects Versions: 1.26
>            Reporter: Furkan Kamaci
>            Priority: Major
>             Fix For: 1.27
>
>
> equals() is used for object and string comparison but == compares them by 
> identity.



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

Reply via email to