Revision: 17640
http://sourceforge.net/p/gate/code/17640
Author: markagreenwood
Date: 2014-03-12 14:13:54 +0000 (Wed, 12 Mar 2014)
Log Message:
-----------
a few more bits of cleanup
Modified Paths:
--------------
gate/trunk/src/main/gate/creole/morph/Interpret.java
gate/trunk/src/main/gate/creole/morph/ParsingFunctions.java
gate/trunk/src/main/gate/creole/morph/PatternParser.java
gate/trunk/src/main/gate/creole/morph/StringSet.java
gate/trunk/src/main/gate/gui/ontology/OntologyEditor.java
gate/trunk/src/main/gate/gui/ontology/PropertyDetailsTableModel.java
gate/trunk/src/main/gate/gui/ontology/RestrictionAction.java
gate/trunk/src/main/gate/gui/ontology/SearchAction.java
gate/trunk/src/main/gate/gui/ontology/Utils.java
gate/trunk/src/main/gate/util/HtmlLinksExtractor.java
Modified: gate/trunk/src/main/gate/creole/morph/Interpret.java
===================================================================
--- gate/trunk/src/main/gate/creole/morph/Interpret.java 2014-03-12
10:48:13 UTC (rev 17639)
+++ gate/trunk/src/main/gate/creole/morph/Interpret.java 2014-03-12
14:13:54 UTC (rev 17640)
@@ -60,7 +60,7 @@
*/
protected FSMState initialState;
- protected Set lastStates;
+ //protected Set lastStates;
/**
* It starts the actual program
@@ -77,12 +77,12 @@
readProgram();
initialState = new FSMState(-1);
- lastStates = new HashSet();
+ //lastStates = new HashSet();
interpretProgram();
variables = null;
file = null;
- lastStates = null;
+ //lastStates = null;
}
/**
@@ -548,11 +548,12 @@
//drawFSM();
}
- private Set<FSMState> intersect(Set a, Set b) {
+ @SuppressWarnings("unused")
+ private Set<FSMState> intersect(Set<FSMState> a, Set<FSMState> b) {
Set<FSMState> result = new HashSet<FSMState>();
- Iterator iter = a.iterator();
+ Iterator<FSMState> iter = a.iterator();
while (iter.hasNext()) {
- FSMState st = (FSMState) iter.next();
+ FSMState st = iter.next();
if (b.contains(st)) {
result.add(st);
}
@@ -560,7 +561,8 @@
return result;
}
- private void drawFSM() {
+ @SuppressWarnings("unused")
+ private void drawFSM() {
// we start with initialState
System.out.println("Initial:");
String space = "";
@@ -644,11 +646,11 @@
// now parameters have been found, so check them with the
available
// methods
// in the morph function
- Outer: for (int i = 0; i < methods.length; i++) {
+ for (int i = 0; i < methods.length; i++) {
if (methods[i].getName().equals(methodName)) {
// yes method has found now check for the
parameters
// compatibility
- Class[] methodParams =
methods[i].getParameterTypes();
+ Class<?>[] methodParams =
methods[i].getParameterTypes();
// first check for the number of parameters
if (methods[i].getName().equals("null_stem")) {
return true;
Modified: gate/trunk/src/main/gate/creole/morph/ParsingFunctions.java
===================================================================
--- gate/trunk/src/main/gate/creole/morph/ParsingFunctions.java 2014-03-12
10:48:13 UTC (rev 17639)
+++ gate/trunk/src/main/gate/creole/morph/ParsingFunctions.java 2014-03-12
14:13:54 UTC (rev 17640)
@@ -413,7 +413,8 @@
}
- private static FSMState next(char ch, Set<FSMState> states) {
+ @SuppressWarnings("unused")
+ private static FSMState next(char ch, Set<FSMState> states) {
Iterator<FSMState> iter = states.iterator();
while(iter.hasNext()) {
FSMState state = iter.next();
Modified: gate/trunk/src/main/gate/creole/morph/PatternParser.java
===================================================================
--- gate/trunk/src/main/gate/creole/morph/PatternParser.java 2014-03-12
10:48:13 UTC (rev 17639)
+++ gate/trunk/src/main/gate/creole/morph/PatternParser.java 2014-03-12
14:13:54 UTC (rev 17640)
@@ -45,7 +45,7 @@
String[] ruleParts = line.split("==>");
// now check if the method which has been called in this rule
actually
// available in the MorphFunction Class
- String methodCalled = ruleParts[1].trim();
+ //String methodCalled = ruleParts[1].trim();
// so RHS part is Ok
// now we need to check if LHS is written properly
@@ -138,7 +138,7 @@
// here we need (A) to be duplicated two times
boolean duplicated = false;
int dupliSize = 0;
- int lastBrClose = 0;
+
String data = "";
// we need to look into one query at a time and parse it
Modified: gate/trunk/src/main/gate/creole/morph/StringSet.java
===================================================================
--- gate/trunk/src/main/gate/creole/morph/StringSet.java 2014-03-12
10:48:13 UTC (rev 17639)
+++ gate/trunk/src/main/gate/creole/morph/StringSet.java 2014-03-12
14:13:54 UTC (rev 17640)
@@ -98,4 +98,8 @@
public boolean contains(String value) {
return variables.contains(value);
}
+
+ public String getVariableName() {
+ return varName;
+ }
}
\ No newline at end of file
Modified: gate/trunk/src/main/gate/gui/ontology/OntologyEditor.java
===================================================================
--- gate/trunk/src/main/gate/gui/ontology/OntologyEditor.java 2014-03-12
10:48:13 UTC (rev 17639)
+++ gate/trunk/src/main/gate/gui/ontology/OntologyEditor.java 2014-03-12
14:13:54 UTC (rev 17640)
@@ -1135,6 +1135,7 @@
private DatatypeProperty property;
}
+ @SuppressWarnings("serial")
protected class ObjectPropertyValueAction extends AbstractAction {
public ObjectPropertyValueAction(String name, OResource oResource,
ObjectProperty property,
@@ -1540,8 +1541,8 @@
private void removeFromMap(DefaultTreeModel model, DefaultMutableTreeNode
node) {
if(!node.isLeaf()) {
- Enumeration enumeration = node.children();
- List children = new ArrayList();
+ Enumeration<?> enumeration = node.children();
+ List<Object> children = new ArrayList<Object>();
while(enumeration.hasMoreElements()) {
children.add(enumeration.nextElement());
}
@@ -1704,7 +1705,7 @@
Utils.getOResourceFromMap(this.ontology,reverseMap.get(node).toString());
firstTime = false;
// find out which class is deleted
- Enumeration e = node.children();
+ Enumeration<?> e = node.children();
if(e != null) {
while(e.hasMoreElements()) {
DefaultMutableTreeNode aNode = (DefaultMutableTreeNode)e
@@ -1774,10 +1775,14 @@
// gui. Deleting a resource results in deleting other resources as
// well. The last resource in the resources is the one which was
// asked from a user to delete.
- String deletedResourceURI = resources[resources.length - 1];
+ // MAG 12/3/2014: this code does nothing as there are no side
+ // effects to the calls and the variables filled by the calls are
+ // never used
+ /*String deletedResourceURI = resources[resources.length - 1];
DefaultMutableTreeNode aNode = uri2TreeNodesListMap.get(deletedResourceURI)
.get(0);
+
DefaultMutableTreeNode probableParentNode = null;
if(aNode.getParent() == null) {
OResource res = ((OResourceNode)aNode.getUserObject()).getResource();
@@ -1790,7 +1795,7 @@
}
else {
probableParentNode = (DefaultMutableTreeNode)aNode.getParent();
- }
+ }*/
SwingUtilities.invokeLater(new Runnable() {
@Override
@@ -1854,7 +1859,7 @@
List<RDFProperty> children = new ArrayList<RDFProperty>(
((RDFProperty)parentResource)
.getSubProperties(OConstants.Closure.DIRECT_CLOSURE));
- Enumeration en = parentNode.children();
+ Enumeration<?> en = parentNode.children();
while(en.hasMoreElements()) {
DefaultMutableTreeNode dmtn =
(DefaultMutableTreeNode)en
.nextElement();
@@ -1882,7 +1887,7 @@
children.addAll(ontology
.getOInstances((OClass)parentResource,
OConstants.Closure.DIRECT_CLOSURE));
- Enumeration en = parentNode.children();
+ Enumeration<?> en = parentNode.children();
while(en.hasMoreElements()) {
DefaultMutableTreeNode dmtn =
(DefaultMutableTreeNode)en
.nextElement();
@@ -1906,7 +1911,7 @@
List<OResource> children = new ArrayList<OResource>(
ontology.getOClasses(true));
- Enumeration en = parentNode.children();
+ Enumeration<?> en = parentNode.children();
while(en.hasMoreElements()) {
DefaultMutableTreeNode dmtn =
(DefaultMutableTreeNode)en
.nextElement();
@@ -1947,7 +1952,7 @@
}
}
Collections.sort(subList, itemComparator);
- Enumeration en = parentNode.children();
+ Enumeration<?> en = parentNode.children();
while(en.hasMoreElements()) {
DefaultMutableTreeNode dmtn =
(DefaultMutableTreeNode)en
.nextElement();
Modified: gate/trunk/src/main/gate/gui/ontology/PropertyDetailsTableModel.java
===================================================================
--- gate/trunk/src/main/gate/gui/ontology/PropertyDetailsTableModel.java
2014-03-12 10:48:13 UTC (rev 17639)
+++ gate/trunk/src/main/gate/gui/ontology/PropertyDetailsTableModel.java
2014-03-12 14:13:54 UTC (rev 17640)
@@ -23,6 +23,7 @@
* @author niraj
*
*/
+@SuppressWarnings("serial")
public class PropertyDetailsTableModel extends AbstractTableModel {
public PropertyDetailsTableModel() {
resourceInfo = new DetailsGroup("Resource Information", true, null);
@@ -68,7 +69,7 @@
}
@Override
- public Class getColumnClass(int i) {
+ public Class<?> getColumnClass(int i) {
switch(i) {
case 0:
return Boolean.class;
@@ -215,7 +216,7 @@
}
@SuppressWarnings("deprecation")
- Set set1 = property.getDomain();
+ Set<OResource> set1 = property.getDomain();
if(set1 != null) {
domain.getValues().addAll(set1);
Collections.sort(domain.getValues(), itemComparator);
@@ -237,7 +238,7 @@
}
@SuppressWarnings("deprecation")
- Set set2 = property.getRange();
+ Set<OResource> set2 = property.getRange();
if(set2 != null) {
range.getValues().addAll(set2);
Collections.sort(range.getValues(), itemComparator);
Modified: gate/trunk/src/main/gate/gui/ontology/RestrictionAction.java
===================================================================
--- gate/trunk/src/main/gate/gui/ontology/RestrictionAction.java
2014-03-12 10:48:13 UTC (rev 17639)
+++ gate/trunk/src/main/gate/gui/ontology/RestrictionAction.java
2014-03-12 14:13:54 UTC (rev 17640)
@@ -25,6 +25,7 @@
* @author niraj
*
*/
+@SuppressWarnings("serial")
public class RestrictionAction extends AbstractAction {
public RestrictionAction(String s, Icon icon) {
Modified: gate/trunk/src/main/gate/gui/ontology/SearchAction.java
===================================================================
--- gate/trunk/src/main/gate/gui/ontology/SearchAction.java 2014-03-12
10:48:13 UTC (rev 17639)
+++ gate/trunk/src/main/gate/gui/ontology/SearchAction.java 2014-03-12
14:13:54 UTC (rev 17640)
@@ -41,6 +41,7 @@
* @author niraj
*
*/
+@SuppressWarnings("serial")
public class SearchAction extends AbstractAction {
/**
Modified: gate/trunk/src/main/gate/gui/ontology/Utils.java
===================================================================
--- gate/trunk/src/main/gate/gui/ontology/Utils.java 2014-03-12 10:48:13 UTC
(rev 17639)
+++ gate/trunk/src/main/gate/gui/ontology/Utils.java 2014-03-12 14:13:54 UTC
(rev 17640)
@@ -68,8 +68,8 @@
* This method returns the details to be added.
*/
@SuppressWarnings("deprecation")
- public static List getDetailsToAdd(Object object) {
- ArrayList<Object> toAdd = new ArrayList<Object>();
+ public static List<Object> getDetailsToAdd(Object object) {
+ List<Object> toAdd = new ArrayList<Object>();
toAdd.add(object);
if(object instanceof Restriction) {
Restriction res = (Restriction)object;
Modified: gate/trunk/src/main/gate/util/HtmlLinksExtractor.java
===================================================================
--- gate/trunk/src/main/gate/util/HtmlLinksExtractor.java 2014-03-12
10:48:13 UTC (rev 17639)
+++ gate/trunk/src/main/gate/util/HtmlLinksExtractor.java 2014-03-12
14:13:54 UTC (rev 17640)
@@ -66,8 +66,7 @@
currentTag = t;
if (HTML.Tag.A == t){
Out.pr("<LI><" + t);
- String href = "";
- Enumeration e = a.getAttributeNames();
+ Enumeration<?> e = a.getAttributeNames();
while(e.hasMoreElements()) {
HTML.Attribute name = (HTML.Attribute) e.nextElement();
String value = (String) a.getAttribute(name);
@@ -100,7 +99,7 @@
if (a == null) return;
// Take all the attributes an put them into the feature map
if (0 != a.getAttributeCount()){
- Enumeration enumeration = a.getAttributeNames();
+ Enumeration<?> enumeration = a.getAttributeNames();
while (enumeration.hasMoreElements()){
Object attribute = enumeration.nextElement();
Out.pr(" "+ attribute.toString() + "=\"" +
@@ -189,9 +188,9 @@
* in that folder. It returns a list of strings representing the file
* names
*/
- private static List listAllFiles(File aFile, Set foldersToIgnore){
- java.util.List sgmlFileNames = new ArrayList();
- java.util.List foldersToExplore = new ArrayList();
+ private static List<String> listAllFiles(File aFile, Set<String>
foldersToIgnore){
+ List<String> sgmlFileNames = new ArrayList<String>();
+ List<File> foldersToExplore = new ArrayList<File>();
if (!aFile.isDirectory()){
// add the file to the file list
sgmlFileNames.add(aFile.getPath());
@@ -203,9 +202,9 @@
/** Helper method for listAllFiles */
private static void listFilesRec(File aFile,
- java.util.List fileNames,
- java.util.List foldersToExplore,
- Set foldersToIgnore){
+ List<String> fileNames,
+ List<File> foldersToExplore,
+ Set<String> foldersToIgnore){
String[] fileList = aFile.list();
for (int i=0; i< fileList.length; i++){
@@ -229,7 +228,7 @@
}// End for
while(!foldersToExplore.isEmpty()){
- File folder = (File)foldersToExplore.get(0);
+ File folder = foldersToExplore.get(0);
foldersToExplore.remove(0);
listFilesRec(folder,fileNames,foldersToExplore,foldersToIgnore);
}//End while
@@ -250,15 +249,15 @@
}
// Create a folder file File
File htmlFolder = new File(args[0]);
- Set foldersToIgnore = new HashSet();
+ Set<String> foldersToIgnore = new HashSet<String>();
for(int i = 1; i<args.length; i++)
foldersToIgnore.add(args[i]);
- List htmlFileNames = listAllFiles(htmlFolder,foldersToIgnore);
+ List<String> htmlFileNames = listAllFiles(htmlFolder,foldersToIgnore);
//Collections.sort(htmlFileNames);
while (!htmlFileNames.isEmpty()){
try{
- String htmlFileName = (String) htmlFileNames.get(0);
+ String htmlFileName = htmlFileNames.get(0);
currFile = htmlFileName;
currPath = new File(currFile).getParent().toString();
htmlFileNames.remove(0);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs