aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2004-05-18 08:43:47 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2004-05-18 08:43:47 +0000
commit37712645ade4a363aa5f02752c46a9f6fd3b9dc3 (patch)
tree7eee37b8227f7ba029bae0db0ffcc982192d0b8c
parente4990e08b3f35cf6e8b6f8ea1bb30bad2fcae6af (diff)
downloadjavassist-37712645ade4a363aa5f02752c46a9f6fd3b9dc3.tar.gz
javassist-37712645ade4a363aa5f02752c46a9f6fd3b9dc3.zip
minor and final changes for 3.0 beta
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@106 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
-rw-r--r--src/main/javassist/ClassPool.java6
-rw-r--r--src/main/javassist/CtNewMethod.java35
-rw-r--r--src/main/javassist/rmi/ObjectImporter.java4
3 files changed, 37 insertions, 8 deletions
diff --git a/src/main/javassist/ClassPool.java b/src/main/javassist/ClassPool.java
index 58a68f27..ce64c847 100644
--- a/src/main/javassist/ClassPool.java
+++ b/src/main/javassist/ClassPool.java
@@ -227,8 +227,8 @@ public class ClassPool {
*
* @see CtClass#forName(String)
* @see CtClass#toClass()
- * @see #toClass()
- * @see #forName(String)
+ * @see ClassPool#toClass(CtClass)
+ * @see ClassPool#forName(String)
*/
public static class SimpleLoader extends ClassLoader {
/**
@@ -438,7 +438,7 @@ public class ClassPool {
*
* @param classname a fully-qualified class name.
* @return null if the class file could not be found.
- * @see CtClassType#getURL()
+ * @see CtClass#getURL()
*/
public URL find(String classname) {
return source.find(classname);
diff --git a/src/main/javassist/CtNewMethod.java b/src/main/javassist/CtNewMethod.java
index 2f8624d4..eb65b73e 100644
--- a/src/main/javassist/CtNewMethod.java
+++ b/src/main/javassist/CtNewMethod.java
@@ -82,7 +82,8 @@ public class CtNewMethod {
}
/**
- * Creates a public method.
+ * Creates a public (non-static) method. The created method cannot
+ * be changed to a static method later.
*
* @param returnType the type of the returned value.
* @param mname the method name.
@@ -94,14 +95,42 @@ public class CtNewMethod {
* does nothing except returning zero or null.
* @param declaring the class to which the created method is added.
*/
- public static CtMethod make(CtClass returnType, String mname,
- CtClass[] parameters, CtClass[] exceptions,
+ public static CtMethod make(CtClass returnType,
+ String mname, CtClass[] parameters,
+ CtClass[] exceptions,
+ String body, CtClass declaring)
+ throws CannotCompileException
+ {
+ return make(Modifier.PUBLIC, returnType, mname, parameters, exceptions,
+ body, declaring);
+ }
+
+ /**
+ * Creates a method.
+ *
+ * @param modifiers access modifiers.
+ * @param returnType the type of the returned value.
+ * @param mname the method name.
+ * @param parameters a list of the parameter types.
+ * @param exceptions a list of the exception types.
+ * @param body the source text of the method body.
+ * It must be a block surrounded by <code>{}</code>.
+ * If it is <code>null</code>, the created method
+ * does nothing except returning zero or null.
+ * @param declaring the class to which the created method is added.
+ *
+ * @see Modifier
+ */
+ public static CtMethod make(int modifiers, CtClass returnType,
+ String mname, CtClass[] parameters,
+ CtClass[] exceptions,
String body, CtClass declaring)
throws CannotCompileException
{
try {
CtMethod cm
= new CtMethod(returnType, mname, parameters, declaring);
+ cm.setModifiers(modifiers);
cm.setExceptionTypes(exceptions);
cm.setBody(body);
return cm;
diff --git a/src/main/javassist/rmi/ObjectImporter.java b/src/main/javassist/rmi/ObjectImporter.java
index 61ecb170..96e1eb95 100644
--- a/src/main/javassist/rmi/ObjectImporter.java
+++ b/src/main/javassist/rmi/ObjectImporter.java
@@ -75,8 +75,8 @@ public class ObjectImporter implements java.io.Serializable {
private String servername, orgServername;
private int port, orgPort;
- private byte[] lookupCommand = "POST /lookup HTTP/1.0".getBytes();
- private byte[] rmiCommand = "POST /rmi HTTP/1.0".getBytes();
+ protected byte[] lookupCommand = "POST /lookup HTTP/1.0".getBytes();
+ protected byte[] rmiCommand = "POST /rmi HTTP/1.0".getBytes();
/**
* Constructs an object importer.