[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Fri Dec 14 23:38:06 UTC 2007


gordonp
Fri Dec 14 18:38:06 EST 2007
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util
In directory dev.open-bio.org:/tmp/cvs-serv25043/src/main/ca/ucalgary/seahawk/util

Modified Files:
	MinJarMaker.java 
Log Message:
Got rid of unchecked operations
moby-live/Java/src/main/ca/ucalgary/seahawk/util MinJarMaker.java,1.6,1.7
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MinJarMaker.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MinJarMaker.java	2007/12/06 18:48:54	1.6
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MinJarMaker.java	2007/12/14 23:38:06	1.7
@@ -32,9 +32,9 @@
     // The arguments to the program
     protected String programArgs[];
 
-    protected Hashtable savedClasses;
-    protected Hashtable corePackages;  //One from which we've loaded a class in running the code
-    protected Hashtable secondaryPackageWritten;  //Keep track of whole package import statements in JNLP
+    protected Map<String,String> savedClasses;  //<className,sentinalValue>
+    protected Map<String,String> corePackages;  //One from which we've loaded a class in running the code
+    protected Map<String,String> secondaryPackageWritten;  //Keep track of whole package import statements in JNLP
     private boolean createSecondaryJars;
     private String webStartIndexFileName = null;
     private FileWriter webStartIndexWriter = null;
@@ -45,8 +45,8 @@
     public final static String MANIFEST_MAIN_CLASS_PROPERTY = "minnow.manifest.main.class";
 
     // For the class loading interface, keep track of what we've loaded
-    private Set loadedClasses =
-      Collections.synchronizedSet( new LinkedHashSet() );
+    private Set<String> loadedClasses =
+      Collections.synchronizedSet( new LinkedHashSet<String>() );
 
     static public void main( String args[] ) throws Exception {
 	// Check arguments
@@ -193,9 +193,9 @@
 	return resourceURL;
     }
     
-    protected Enumeration findResources(String name)
+    protected Enumeration<URL> findResources(String name)
 	throws IOException{
-	Vector v = new Vector(1);
+	Vector<URL> v = new Vector<URL>(1);
 	v.add(findResource(name));
 	return v.elements();
     }
@@ -232,7 +232,7 @@
 	return clas;
     }
     
-    public Set getLoadedClasses() {
+    public Set<String> getLoadedClasses() {
 	return loadedClasses;
     }
     // End class loader overrides
@@ -440,7 +440,7 @@
 	jout.closeEntry();
     }
 
-    protected void addExtraClasses(Set classes){
+    protected void addExtraClasses(Set<String> classes){
 	StringTokenizer extraClassesTokens = new StringTokenizer(System.getProperty("jarmaker.class.extras"), 
 								 File.pathSeparator);
 	while(extraClassesTokens.hasMoreElements()){
@@ -467,7 +467,7 @@
 	    }
 	    // A class pattern that we must find all matches for
 	    else{
-		Set matchedClasses = getMatchingClasses(classPathElement);
+		Set<String> matchedClasses = getMatchingClasses(classPathElement);
 		if(matchedClasses == null || matchedClasses.size() == 0){
 		    System.err.println("Could not find any classes matching the pattern specified for extra class: " + 
 				       classPathElement);
@@ -478,8 +478,8 @@
 	}
     }
 
-    protected Set findDirMatches(String pathPrefix, File dir, Pattern p, boolean recursive){
-	Set matches = new HashSet();
+    protected Set<String> findDirMatches(String pathPrefix, File dir, Pattern p, boolean recursive){
+	Set<String> matches = new HashSet<String>();
 
 	String[] files = dir.list();
 	for(int i = 0; i < files.length; i++){
@@ -504,8 +504,8 @@
      * The pattern may have the form of an Ant path specification, i.e. "*" matches anything in a directory, 
      * and "**" matches anything in any subdirectory.
      */
-    protected Set getMatchingClasses(String pattern){
-	Set results = new HashSet();
+    protected Set<String> getMatchingClasses(String pattern){
+	Set<String> results = new HashSet<String>();
 
 	// This code largely copied from the getResourceURL method, with mods for asterisk handling
 	StringTokenizer classPathTokens = new StringTokenizer(System.getProperty("jarmaker.class.path"), 
@@ -587,9 +587,9 @@
     protected void dumpJar( String jarfile )
 	throws IOException {
 	// Get the list of classes
-	Set loadedClasses = getLoadedClasses();
-        savedClasses = new Hashtable();
-        corePackages = new Hashtable();
+	Set<String> loadedClasses = getLoadedClasses();
+        savedClasses = new Hashtable<String,String>();
+        corePackages = new Hashtable<String,String>();
 	int partId = 1;  //ID for part names in JNLP file (shorter than full package name to save space)
 	
 	addExtraClasses(loadedClasses);
@@ -682,7 +682,7 @@
 	if(createSecondaryJars){
 	    
 	    if(webStartIndexFileName != null){
-		secondaryPackageWritten = new Hashtable();
+		secondaryPackageWritten = new Hashtable<String,String>();
 		try{
 		    webStartIndexWriter = new FileWriter(webStartIndexFileName);
 		}




More information about the MOBY-guts mailing list