Revision: 17532
          http://sourceforge.net/p/gate/code/17532
Author:   markagreenwood
Date:     2014-03-04 18:11:10 +0000 (Tue, 04 Mar 2014)
Log Message:
-----------
fixed some dead code warnings by moving the null checks to the right locations, 
and removed some unused imports that had somehow slipped back in

Modified Paths:
--------------
    gate/trunk/src/main/gate/corpora/SerialCorpusImpl.java
    gate/trunk/src/main/gate/creole/orthomatcher/MatchRule10.java
    gate/trunk/src/main/gate/creole/orthomatcher/MatchRule11.java
    gate/trunk/src/main/gate/creole/orthomatcher/MatchRule12.java
    gate/trunk/src/main/gate/creole/orthomatcher/MatchRule13.java
    gate/trunk/src/main/gate/creole/orthomatcher/MatchRule14.java
    gate/trunk/src/main/gate/creole/orthomatcher/MatchRule15.java
    gate/trunk/src/main/gate/creole/orthomatcher/MatchRule3.java
    gate/trunk/src/main/gate/creole/orthomatcher/MatchRule6.java
    gate/trunk/src/main/gate/creole/orthomatcher/MatchRule7.java
    gate/trunk/src/main/gate/creole/orthomatcher/MatchRule8.java
    gate/trunk/src/main/gate/creole/orthomatcher/MatchRule9.java
    gate/trunk/src/main/gate/gui/docview/CorefEditor.java
    gate/trunk/src/test/gate/creole/TestCreole.java
    gate/trunk/src/test/gate/creole/annic/test/AnnicIndexing.java

Modified: gate/trunk/src/main/gate/corpora/SerialCorpusImpl.java
===================================================================
--- gate/trunk/src/main/gate/corpora/SerialCorpusImpl.java      2014-03-04 
17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/corpora/SerialCorpusImpl.java      2014-03-04 
18:11:10 UTC (rev 17532)
@@ -796,9 +796,9 @@
 
   @Override
   public boolean equals(Object o) {
+    if(o == null) return false;
     if(!(o instanceof SerialCorpusImpl)) return false;
-    SerialCorpusImpl oCorpus = (SerialCorpusImpl)o;
-    if(oCorpus == null) return false;
+    SerialCorpusImpl oCorpus = (SerialCorpusImpl)o;    
     if(oCorpus == this) return true;
     if((oCorpus.lrPersistentId == this.lrPersistentId || (this.lrPersistentId 
!= null && this.lrPersistentId
             .equals(oCorpus.lrPersistentId)))

Modified: gate/trunk/src/main/gate/creole/orthomatcher/MatchRule10.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/MatchRule10.java       
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/creole/orthomatcher/MatchRule10.java       
2014-03-04 18:11:10 UTC (rev 17532)
@@ -1,6 +1,5 @@
 package gate.creole.orthomatcher;
 
-import gate.Annotation;
 
 
 /**

Modified: gate/trunk/src/main/gate/creole/orthomatcher/MatchRule11.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/MatchRule11.java       
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/creole/orthomatcher/MatchRule11.java       
2014-03-04 18:11:10 UTC (rev 17532)
@@ -1,6 +1,5 @@
 package gate.creole.orthomatcher;
 
-import gate.Annotation;
 
 /**
  * RULE #11: does one name consist of contractions

Modified: gate/trunk/src/main/gate/creole/orthomatcher/MatchRule12.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/MatchRule12.java       
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/creole/orthomatcher/MatchRule12.java       
2014-03-04 18:11:10 UTC (rev 17532)
@@ -1,6 +1,5 @@
 package gate.creole.orthomatcher;
 
-import gate.Annotation;
 
 /**
  * RULE #12: do the first and last tokens of one name

Modified: gate/trunk/src/main/gate/creole/orthomatcher/MatchRule13.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/MatchRule13.java       
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/creole/orthomatcher/MatchRule13.java       
2014-03-04 18:11:10 UTC (rev 17532)
@@ -1,6 +1,5 @@
 package gate.creole.orthomatcher;
 
-import gate.Annotation;
 
 /**
  * RULE #12: do the first and last tokens of one name

Modified: gate/trunk/src/main/gate/creole/orthomatcher/MatchRule14.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/MatchRule14.java       
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/creole/orthomatcher/MatchRule14.java       
2014-03-04 18:11:10 UTC (rev 17532)
@@ -1,6 +1,5 @@
 package gate.creole.orthomatcher;
 
-import gate.Annotation;
 
 /**
  * RULE #13: do multi-word names match except for

Modified: gate/trunk/src/main/gate/creole/orthomatcher/MatchRule15.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/MatchRule15.java       
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/creole/orthomatcher/MatchRule15.java       
2014-03-04 18:11:10 UTC (rev 17532)
@@ -1,6 +1,5 @@
 package gate.creole.orthomatcher;
 
-import gate.Annotation;
 
 /**
  * RULE #14: if the last token of one name

Modified: gate/trunk/src/main/gate/creole/orthomatcher/MatchRule3.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/MatchRule3.java        
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/creole/orthomatcher/MatchRule3.java        
2014-03-04 18:11:10 UTC (rev 17532)
@@ -1,6 +1,5 @@
 package gate.creole.orthomatcher;
 
-import gate.Annotation;
 
 /**
  * RULE #3: adding a possessive at the end

Modified: gate/trunk/src/main/gate/creole/orthomatcher/MatchRule6.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/MatchRule6.java        
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/creole/orthomatcher/MatchRule6.java        
2014-03-04 18:11:10 UTC (rev 17532)
@@ -1,6 +1,5 @@
 package gate.creole.orthomatcher;
 
-import gate.Annotation;
 
 
 /**

Modified: gate/trunk/src/main/gate/creole/orthomatcher/MatchRule7.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/MatchRule7.java        
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/creole/orthomatcher/MatchRule7.java        
2014-03-04 18:11:10 UTC (rev 17532)
@@ -1,6 +1,5 @@
 package gate.creole.orthomatcher;
 
-import gate.Annotation;
 
 /**
  * RULE #6: if one name is the acronym of the other

Modified: gate/trunk/src/main/gate/creole/orthomatcher/MatchRule8.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/MatchRule8.java        
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/creole/orthomatcher/MatchRule8.java        
2014-03-04 18:11:10 UTC (rev 17532)
@@ -1,6 +1,5 @@
 package gate.creole.orthomatcher;
 
-import gate.Annotation;
 
 /**
  * RULE #7: if one of the tokens in one of the

Modified: gate/trunk/src/main/gate/creole/orthomatcher/MatchRule9.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/MatchRule9.java        
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/creole/orthomatcher/MatchRule9.java        
2014-03-04 18:11:10 UTC (rev 17532)
@@ -1,6 +1,5 @@
 package gate.creole.orthomatcher;
 
-import gate.Annotation;
 
 /**
  * RULE #9: does one of the names match the token

Modified: gate/trunk/src/main/gate/gui/docview/CorefEditor.java
===================================================================
--- gate/trunk/src/main/gate/gui/docview/CorefEditor.java       2014-03-04 
17:49:38 UTC (rev 17531)
+++ gate/trunk/src/main/gate/gui/docview/CorefEditor.java       2014-03-04 
18:11:10 UTC (rev 17532)
@@ -416,6 +416,10 @@
     Integer id = delAnnot.getId();
     Map matchesMap = null;
     Object matchesMapObject = 
document.getFeatures().get(ANNIEConstants.DOCUMENT_COREF_FEATURE_NAME);
+    
+    if(matchesMapObject == null)
+      return;
+    
     if(!(matchesMapObject instanceof Map)) {
       // no need to do anything
       // and return
@@ -425,8 +429,7 @@
 
     matchesMap = (Map) matchesMapObject;
 
-    if(matchesMap == null)
-      return;
+    
 
     Set keySet = matchesMap.keySet();
     if(keySet == null)
@@ -485,7 +488,7 @@
     // there is some change in the featureMap
     Map matchesMap = null;
     Object matchesMapObject = 
document.getFeatures().get(ANNIEConstants.DOCUMENT_COREF_FEATURE_NAME);
-    if(!(matchesMapObject instanceof Map)) {
+    if(matchesMapObject == null || !(matchesMapObject instanceof Map)) {
       // no need to do anything
       // and return
       reinitAllVariables();
@@ -496,13 +499,6 @@
 
     matchesMap = (Map) matchesMapObject;
 
-    if (matchesMap == null) {
-      reinitAllVariables();
-      explicitCall = false;
-      annotSets.setSelectedIndex(0);
-      return;
-    }
-
     //AnnotationSetName --> List of ArrayLists
     //each ArrayList contains Ids of related annotations
     Iterator setIter = matchesMap.keySet().iterator();

Modified: gate/trunk/src/test/gate/creole/TestCreole.java
===================================================================
--- gate/trunk/src/test/gate/creole/TestCreole.java     2014-03-04 17:49:38 UTC 
(rev 17531)
+++ gate/trunk/src/test/gate/creole/TestCreole.java     2014-03-04 18:11:10 UTC 
(rev 17532)
@@ -290,7 +290,7 @@
     assertNotNull("PR1 features are null", pr1features);
     assertTrue(
       "PR2 got wrong features: " + pr2features,
-      pr2features != null || pr2features.size() != 1
+      pr2features != null && pr2features.size() != 1
     );
     pr1.execute();
     pr2.execute();

Modified: gate/trunk/src/test/gate/creole/annic/test/AnnicIndexing.java
===================================================================
--- gate/trunk/src/test/gate/creole/annic/test/AnnicIndexing.java       
2014-03-04 17:49:38 UTC (rev 17531)
+++ gate/trunk/src/test/gate/creole/annic/test/AnnicIndexing.java       
2014-03-04 18:11:10 UTC (rev 17532)
@@ -30,11 +30,6 @@
 public class AnnicIndexing {
 
   /**
-   * serial version id
-   */
-  private static final long serialVersionUID = 3688785860577212210L;
-
-  /**
    * Corpus to index.
    */
   private gate.Corpus corpus;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to