[MOBY-guts] biomoby commit
Paul Gordon
gordonp at dev.open-bio.org
Thu Oct 30 02:33:24 UTC 2008
gordonp
Wed Oct 29 22:33:24 EDT 2008
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/minnow
In directory dev.open-bio.org:/tmp/cvs-serv10500/src/main/ca/ucalgary/minnow
Modified Files:
MinJarMaker.java
Log Message:
Updates related to SAWSDL wrapping Web Service implementation
moby-live/Java/src/main/ca/ucalgary/minnow MinJarMaker.java,1.4,1.5
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/minnow/MinJarMaker.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/minnow/MinJarMaker.java 2008/02/15 07:27:47 1.4
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/minnow/MinJarMaker.java 2008/10/30 02:33:24 1.5
@@ -214,8 +214,15 @@
if(classBytes != null){
clas = defineClass( name, classBytes, 0, classBytes.length );
}
- } catch( IOException ie ) {}
-
+ } catch( IOException ie ) {
+ } catch(ClassFormatError cfe){
+ // If the data did not contain a valid class
+ cfe.printStackTrace(System.err);
+ } catch(NoClassDefFoundError ncdfe){
+ // If name is not equal to the binary name of the class specified by classBytes
+ ncdfe.printStackTrace(System.err);
+ }
+
// We weren't able to get the class, so
// use the default Classloader.
if (clas == null) {
@@ -327,17 +334,19 @@
InputStream classStream = jarFile.getInputStream(je);
byte[] classBytes = null;
- if(classSize != -1){ // We know the size of the class already
-
- classBytes = new byte[(int) classSize]; //classes better not be bigger than 2 GB!
- // Slurp it up in one shot
- classStream.read(classBytes, 0, (int) classSize);
- if(Boolean.getBoolean(VERBOSE)){
- System.err.println("[Loaded " + name + " from " + f.getCanonicalPath() + "]");
- }
- return classBytes;
- }
- else{
+ // NOTE: This if case is commented out because false file sizes are sometimes
+ // reported, which leads to invalid class definitions
+// if(classSize != -1){ // We know the size of the class already
+
+// classBytes = new byte[(int) classSize]; //classes better not be bigger than 2 GB!
+// // Slurp it up in one shot
+// classStream.read(classBytes, 0, (int) classSize);
+// if(Boolean.getBoolean(VERBOSE)){
+// System.err.println("[Loaded " + name + " from " + f.getCanonicalPath() + "]");
+// }
+// return classBytes;
+// }
+// else{
byte[] byteBufferChunk = new byte[1024];
ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();
@@ -350,7 +359,7 @@
System.err.println("[Loaded " + name + " from " + f.getCanonicalPath() + "]");
}
return byteBuffer.toByteArray();
- }
+// }
}
}
More information about the MOBY-guts
mailing list