[jboss-cvs] javassist/src/main/javassist ...
Shigeru Chiba
chiba at is.titech.ac.jp
Sat Jul 14 04:53:57 EDT 2007
User: chiba
Date: 07/07/14 04:53:57
Modified: src/main/javassist ClassMap.java CtBehavior.java
CtMethod.java CtConstructor.java
Log:
changed CtMethod#copy() and updated related javadoc comments
Revision Changes Path
1.10 +20 -1 javassist/src/main/javassist/ClassMap.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ClassMap.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/ClassMap.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- ClassMap.java 4 Jun 2007 03:11:11 -0000 1.9
+++ ClassMap.java 14 Jul 2007 08:53:57 -0000 1.10
@@ -82,7 +82,7 @@
* <code>oldname</code> to <code>newname</code>. See
* <code>fix</code> method.
*
- * @param oldname the original class name
+ * @param oldname the original class name.
* @param newname the substituted class name.
* @see #fix(String)
*/
@@ -96,6 +96,25 @@
super.put(oldname2, toJvmName(newname));
}
+ /**
+ * Is equivalent to <code>put()</code> except that
+ * the given mapping is not recorded into the hashtable
+ * if another mapping from <code>oldname</code> is
+ * already included.
+ *
+ * @param oldname the original class name.
+ * @param newname the substituted class name.
+ */
+ public void putIfNone(String oldname, String newname) {
+ if (oldname == newname)
+ return;
+
+ String oldname2 = toJvmName(oldname);
+ String s = (String)get(oldname2);
+ if (s == null)
+ super.put(oldname2, toJvmName(newname));
+ }
+
protected final void put0(Object oldname, Object newname) {
super.put(oldname, newname);
}
1.38 +1 -1 javassist/src/main/javassist/CtBehavior.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CtBehavior.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/CtBehavior.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- CtBehavior.java 4 Jun 2007 03:11:11 -0000 1.37
+++ CtBehavior.java 14 Jul 2007 08:53:57 -0000 1.38
@@ -59,7 +59,7 @@
if (srcSuperName.equals(CtClass.javaLangObject))
patch = true;
else
- map.put(srcSuperName, destSuperName);
+ map.putIfNone(srcSuperName, destSuperName);
}
// a stack map table is copied from srcInfo.
1.20 +2 -1 javassist/src/main/javassist/CtMethod.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CtMethod.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/CtMethod.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- CtMethod.java 18 Jun 2007 23:51:07 -0000 1.19
+++ CtMethod.java 14 Jul 2007 08:53:57 -0000 1.20
@@ -83,7 +83,8 @@
* with the name of the class and the superclass that the
* created method is added to.
* This is done whichever <code>map</code> is null or not.
- * To prevent this replacement, call <code>ClassMap.fix()</code>.
+ * To prevent this replacement, call <code>ClassMap.fix()</code>
+ * or <code>put()</code> to explicitly specify replacement.
*
* <p><b>Note:</b> if the <code>.class</code> notation (for example,
* <code>String.class</code>) is included in an expression, the
1.22 +2 -1 javassist/src/main/javassist/CtConstructor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CtConstructor.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/CtConstructor.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- CtConstructor.java 8 Jun 2007 13:32:10 -0000 1.21
+++ CtConstructor.java 14 Jul 2007 08:53:57 -0000 1.22
@@ -74,7 +74,8 @@
* with the name of the class and the superclass that
* the created constructor is added to.
* This is done whichever <code>map</code> is null or not.
- * To prevent this replacement, call <code>ClassMap.fix()</code>.
+ * To prevent this replacement, call <code>ClassMap.fix()</code>
+ * or <code>put()</code> to explicitly specify replacement.
*
* <p><b>Note:</b> if the <code>.class</code> notation (for example,
* <code>String.class</code>) is included in an expression, the
More information about the jboss-cvs-commits
mailing list