[jboss-cvs] javassist/src/main/javassist ...
Shigeru Chiba
chiba at is.titech.ac.jp
Fri Dec 5 11:08:01 EST 2008
User: chiba
Date: 08/12/05 11:08:01
Modified: src/main/javassist SerialVersionUID.java
Log:
for fixing JASSIST-69
Revision Changes Path
1.8 +19 -6 javassist/src/main/javassist/SerialVersionUID.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SerialVersionUID.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/SerialVersionUID.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- SerialVersionUID.java 4 Jun 2007 03:11:11 -0000 1.7
+++ SerialVersionUID.java 5 Dec 2008 16:08:01 -0000 1.8
@@ -16,6 +16,8 @@
package javassist;
import java.io.*;
+import java.lang.reflect.Modifier;
+
import javassist.bytecode.*;
import java.util.*;
import java.security.*;
@@ -80,9 +82,17 @@
String javaName = javaName(clazz);
out.writeUTF(javaName);
+ CtMethod[] methods = clazz.getDeclaredMethods();
+
// class modifiers.
- out.writeInt(clazz.getModifiers() & (Modifier.PUBLIC |
- Modifier.FINAL | Modifier.INTERFACE | Modifier.ABSTRACT));
+ int classMods = clazz.getModifiers();
+ if ((classMods & Modifier.INTERFACE) != 0)
+ if (methods.length > 0)
+ classMods = classMods | Modifier.ABSTRACT;
+ else
+ classMods = classMods & ~Modifier.ABSTRACT;
+
+ out.writeInt(classMods);
// interfaces.
String[] interfaces = classFile.getInterfaces();
@@ -144,7 +154,6 @@
}
// methods.
- CtMethod[] methods = clazz.getDeclaredMethods();
Arrays.sort(methods, new Comparator() {
public int compare(Object o1, Object o2) {
CtMethod m1 = (CtMethod)o1;
@@ -160,7 +169,11 @@
for (int i = 0; i < methods.length; i++) {
CtMethod method = methods[i];
- int mods = method.getModifiers();
+ int mods = method.getModifiers()
+ & (Modifier.PUBLIC | Modifier.PRIVATE
+ | Modifier.PROTECTED | Modifier.STATIC
+ | Modifier.FINAL | Modifier.SYNCHRONIZED
+ | Modifier.NATIVE | Modifier.ABSTRACT | Modifier.STRICT);
if ((mods & Modifier.PRIVATE) == 0) {
out.writeUTF(method.getName());
out.writeInt(mods);
More information about the jboss-cvs-commits
mailing list