From: <ba...@us...> - 2007-09-19 21:19:21
|
Revision: 924 http://obo.svn.sourceforge.net/obo/?rev=924&view=rev Author: balhoff Date: 2007-09-19 14:19:22 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Just fixed some warnings. Modified Paths: -------------- phenote/trunk/src/java/phenote/config/Config.java phenote/trunk/src/java/phenote/dataadapter/OntologyDataAdapter.java phenote/trunk/src/java/phenote/datamodel/Ontology.java Modified: phenote/trunk/src/java/phenote/config/Config.java =================================================================== --- phenote/trunk/src/java/phenote/config/Config.java 2007-09-19 20:33:05 UTC (rev 923) +++ phenote/trunk/src/java/phenote/config/Config.java 2007-09-19 21:19:22 UTC (rev 924) @@ -559,7 +559,7 @@ /** Returns enabled data adapters - empty list if none enabled */ public List<DataAdapterI> getDataAdapters() { if (dataAdapConfList==null) return null; // ex? - ArrayList daList = new ArrayList(dataAdapConfList.size()); + ArrayList<DataAdapterI> daList = new ArrayList<DataAdapterI>(dataAdapConfList.size()); for (DataAdapterConfig d : dataAdapConfList) { if (d.isEnabled()) daList.add(d.getFileAdapter()); @@ -696,7 +696,7 @@ } private Object getInstanceForString(String classString) throws Exception { - Class c = Class.forName(classString); + Class<?> c = Class.forName(classString); return c.newInstance(); } @@ -1111,10 +1111,6 @@ name.replaceAll("-"," "); } - private String getConfigFile() { - return configFile; - } - public String getConfigDesc() { String desc = phenoConfigBean.getDescription(); return desc; @@ -1140,7 +1136,7 @@ public List<String> getFieldsInGroup(String groupName) { List<String> fields = new ArrayList<String>(); for (Field aField : this.phenoConfigBean.getFieldArray()) { - final List groups = aField.getGroups(); + final List<?> groups = aField.getGroups(); if (groups != null) { for (Object aGroup : groups) { if (((String)aGroup).equals(groupName)) { @@ -1212,8 +1208,8 @@ if (classString == null) return null; try { // should we cache in hash and insure 1 instance??? - Class c = Class.forName(classString); - Constructor cr = c.getConstructor(String.class); + Class<?> c = Class.forName(classString); + Constructor<?> cr = c.getConstructor(String.class); Object o = cr.newInstance(groupStr); if (!(o instanceof GroupAdapterI)) { log().error("group_adapter cfg is not a GroupAdapterI "+classString); Modified: phenote/trunk/src/java/phenote/dataadapter/OntologyDataAdapter.java =================================================================== --- phenote/trunk/src/java/phenote/dataadapter/OntologyDataAdapter.java 2007-09-19 20:33:05 UTC (rev 923) +++ phenote/trunk/src/java/phenote/dataadapter/OntologyDataAdapter.java 2007-09-19 21:19:22 UTC (rev 924) @@ -1,60 +1,45 @@ package phenote.dataadapter; -import java.io.*; - import java.io.BufferedReader; import java.io.File; -import java.io.FileOutputStream; import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.IOException; -import java.nio.channels.FileChannel; -import java.nio.channels.ReadableByteChannel; -import java.nio.channels.Channels; import java.net.MalformedURLException; import java.net.URL; +import java.nio.channels.Channels; +import java.nio.channels.FileChannel; +import java.nio.channels.ReadableByteChannel; +import java.text.ParsePosition; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Calendar; import java.util.Collection; import java.util.Date; -import java.text.SimpleDateFormat; -import java.text.ParsePosition; -import java.util.Calendar; import java.util.HashMap; -import java.util.Iterator; -import java.util.List; import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.swing.JOptionPane; -import javax.swing.JDialog; -import javax.swing.JComponent; -import java.awt.Component; import org.apache.log4j.Logger; - import org.geneontology.dataadapter.DataAdapterException; -import org.geneontology.dataadapter.FileAdapterConfiguration; import org.geneontology.dataadapter.IOOperation; - -import org.geneontology.oboedit.datamodel.Namespace; -import org.geneontology.oboedit.datamodel.OBOSession; -import org.geneontology.oboedit.datamodel.impl.OBOSessionImpl; import org.geneontology.oboedit.dataadapter.OBOFileAdapter; import org.geneontology.oboedit.dataadapter.OBOMetaData; +import org.geneontology.oboedit.datamodel.Namespace; +import org.geneontology.oboedit.datamodel.OBOSession; -import phenote.util.FileUtil; +import phenote.config.Config; +import phenote.config.FieldConfig; +import phenote.config.OntologyConfig; import phenote.datamodel.CharField; -import phenote.datamodel.CharFieldEnum; import phenote.datamodel.Ontology; import phenote.datamodel.OntologyException; import phenote.datamodel.OntologyManager; -import phenote.config.Config; -import phenote.config.FieldConfig; -import phenote.config.OntologyConfig; import phenote.error.ErrorEvent; import phenote.error.ErrorManager; import phenote.gui.SynchOntologyDialog; +import phenote.util.FileUtil; /** is this really a data adapter? - OntologyLoader? this isnt a data adapter it doesnt load & commit character data - just loads ontologies. rename OntologyLoader @@ -68,7 +53,6 @@ private boolean initializingOntologies = false; private Map<String,Ontology> fileToOntologyCache = new HashMap<String,Ontology>(); private OBOMetaData adapterMetaData; - private SynchOntologyDialog synchDialog; private static final Logger LOG = Logger.getLogger(OntologyDataAdapter.class); @@ -294,7 +278,7 @@ if ((autoUpdate && (timer==0)) && (reposDate > loc)) { useRepos = true; } else if (reposDate > loc || useRepos) { - useRepos = synchDialog.queryUserForOntologyUpdate(ontol); + useRepos = SynchOntologyDialog.queryUserForOntologyUpdate(ontol); } } if (useRepos) { @@ -407,7 +391,7 @@ if (oboUrl == null) throw new OntologyException("No url to retrieve"); - Collection fileList = new ArrayList(); + Collection<String> fileList = new ArrayList<String>(); fileList.add(oboUrl.toString()); return getOboSession(fileList); } Modified: phenote/trunk/src/java/phenote/datamodel/Ontology.java =================================================================== --- phenote/trunk/src/java/phenote/datamodel/Ontology.java 2007-09-19 20:33:05 UTC (rev 923) +++ phenote/trunk/src/java/phenote/datamodel/Ontology.java 2007-09-19 21:19:22 UTC (rev 924) @@ -181,7 +181,7 @@ public List<OBOProperty> getSortedRelations() { if (sortedRelations == null) { //sortedRelations=new ArrayList<OBOProperty>(); not Comparable! - List sorRel = new ArrayList(); + List<OBOProperty> sorRel = new ArrayList<OBOProperty>(); // if (oboSession == null) ? shouldnt happen sorRel.addAll(TermUtil.getRelationshipTypes(oboSession)); Collections.sort(sorRel,new RelComparator()); @@ -190,7 +190,7 @@ return sortedRelations; } - private class RelComparator<OBOProperty> implements Comparator<OBOProperty> { + private class RelComparator implements Comparator<OBOProperty> { public int compare(OBOProperty r1, OBOProperty r2) { return r1.toString().compareTo(r2.toString()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |