Revision: 14866
          http://gate.svn.sourceforge.net/gate/?rev=14866&view=rev
Author:   markagreenwood
Date:     2011-12-28 11:35:10 +0000 (Wed, 28 Dec 2011)
Log Message:
-----------
coffee break length cleanup

Modified Paths:
--------------
    gate/trunk/src/gate/creole/coref/NominalCoref.java
    gate/trunk/src/gate/creole/morph/PatternParser.java
    gate/trunk/src/gate/gui/SyntaxTreeViewer.java
    gate/trunk/src/gate/gui/ontology/Utils.java
    gate/trunk/src/gate/util/persistence/MapPersistence.java
    gate/trunk/src/gate/util/profile/Profiler.java

Modified: gate/trunk/src/gate/creole/coref/NominalCoref.java
===================================================================
--- gate/trunk/src/gate/creole/coref/NominalCoref.java  2011-12-28 02:27:06 UTC 
(rev 14865)
+++ gate/trunk/src/gate/creole/coref/NominalCoref.java  2011-12-28 11:35:10 UTC 
(rev 14866)
@@ -110,7 +110,6 @@
    */
   public void execute() throws ExecutionException{
 
-    HashMap anaphorToAntecedent = new HashMap();
     Annotation[] nominalArray;
 
     //0. preconditions

Modified: gate/trunk/src/gate/creole/morph/PatternParser.java
===================================================================
--- gate/trunk/src/gate/creole/morph/PatternParser.java 2011-12-28 02:27:06 UTC 
(rev 14865)
+++ gate/trunk/src/gate/creole/morph/PatternParser.java 2011-12-28 11:35:10 UTC 
(rev 14866)
@@ -29,7 +29,7 @@
                        while (true) {
                                System.out.print("Query: ");
                                String line = in.readLine();
-                               if (line.length() == -1)
+                               if (line == null || line.length() < 1)
                                        break;
 
                                getPattern(line);
@@ -59,7 +59,6 @@
                        category = category + ruleParts[0].charAt(i);
                }
 
-               RHS rhs = new RHS(ruleParts[1], category, (short)0);
                ruleParts[0] = ruleParts[0].substring(i + 1, 
ruleParts[0].length()).trim();
                String regExp = ParsingFunctions.convertToRegExp(ruleParts[0], 
variables);
                String[] rules = ParsingFunctions.normlizePattern(regExp);

Modified: gate/trunk/src/gate/gui/SyntaxTreeViewer.java
===================================================================
--- gate/trunk/src/gate/gui/SyntaxTreeViewer.java       2011-12-28 02:27:06 UTC 
(rev 14865)
+++ gate/trunk/src/gate/gui/SyntaxTreeViewer.java       2011-12-28 11:35:10 UTC 
(rev 14866)
@@ -546,7 +546,7 @@
   private void annotations2Trees() {
     if (document == null) return;
 
-    HashMap processed = new HashMap(); //for all processed annotations
+    Map<Integer, JButton> processed = new HashMap<Integer, JButton>(); //for 
all processed annotations
 
     //first get all tree nodes in this set, then restrict them by offset
     AnnotationSet tempSet = currentSet.get(treeNodeAnnotationType);
@@ -563,9 +563,6 @@
     java.util.List nodeAnnots = new ArrayList(treeAnnotations);
     Collections.sort(nodeAnnots, new gate.util.OffsetComparator());
 
-    Vector childrenButtons = new Vector();
-    String oldParent = "";
-
     //find all annotations with no children
     Iterator i = nodeAnnots.iterator();
     while (i.hasNext()) {
@@ -619,7 +616,7 @@
         (int) getVisibleRect().getWidth(), (int) 
getVisibleRect().getHeight()));
   } //annotations2Trees
 
-  private JButton processChildrenAnnots(Annotation annot, HashMap processed) {
+  private JButton processChildrenAnnots(Annotation annot, Map<Integer, 
JButton> processed) {
     selection.clear();
     Vector childrenButtons = new Vector();
     java.util.List children =

Modified: gate/trunk/src/gate/gui/ontology/Utils.java
===================================================================
--- gate/trunk/src/gate/gui/ontology/Utils.java 2011-12-28 02:27:06 UTC (rev 
14865)
+++ gate/trunk/src/gate/gui/ontology/Utils.java 2011-12-28 11:35:10 UTC (rev 
14866)
@@ -168,7 +168,7 @@
   static OResource getOResourceFromMap(Ontology o, String uri) {
     try {
       OURI ouri = o.createOURI(uri);
-      List<OResource> toReturn = new ArrayList<OResource>();
+
       OClass c = o.getOClass(ouri);
       if (c != null) {
         return c;

Modified: gate/trunk/src/gate/util/persistence/MapPersistence.java
===================================================================
--- gate/trunk/src/gate/util/persistence/MapPersistence.java    2011-12-28 
02:27:06 UTC (rev 14865)
+++ gate/trunk/src/gate/util/persistence/MapPersistence.java    2011-12-28 
11:35:10 UTC (rev 14866)
@@ -35,8 +35,7 @@
     mapType = source.getClass();
 
     Map map = (Map)source;
-    List keysList = new ArrayList();
-    List valuesList = new ArrayList();
+    
     localMap = new HashMap(map.size());
     //collect the keys in the order given by the entrySet().iterator();
     Iterator keyIter = map.keySet().iterator();

Modified: gate/trunk/src/gate/util/profile/Profiler.java
===================================================================
--- gate/trunk/src/gate/util/profile/Profiler.java      2011-12-28 02:27:06 UTC 
(rev 14865)
+++ gate/trunk/src/gate/util/profile/Profiler.java      2011-12-28 11:35:10 UTC 
(rev 14866)
@@ -210,7 +210,11 @@
         do {
           m_currMemory = m_rt.totalMemory() - m_rt.freeMemory();
           m_rt.gc();
-          try {wait(300);} catch (Exception e) {}
+          try {
+            wait(300);
+          } catch(Exception e) {
+            //ignore this as it should never really happen
+          }
           m_rt.gc();
         } while (m_currMemory > m_rt.totalMemory() - m_rt.freeMemory());
       }

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


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to