I will keep that in mind, that a decompiler might struggle with a manipulated
bytecode. Thanks for the advice.
For your interest Dennis Sosnoski, who as written about Javassist - I think you
reference his articles, is talking about writting a library that can manipulate
bytecodes and generate s
@genman,
Thanks for the tip - I will give jode a try
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3885692#3885692
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3885692
---
Hi,
Have you ever thought of adding the ability for Javassist to spit out source as
well as class files? In particular to have in CtClass methods in addition to
toClass and writeFile that output source. EG toSource and writeSource.
I am looking at using the annotation processing tool (apt) and
My Sun 1.4.2 javac initializes the pointer first. Also see the end of the first
sub-section in the how it works section of the 1997 specification:
http://www.flex-compiler.csail.mit.edu/jdk/guide/innerclasses/spec/innerclasses.doc2.html
This implies that it is erronous not to initialize this$0 b
You can by the way use Javassist to do what I want, but it is a bit of a pain!
You can write a program that modifies Derived above so that it calls super
after initializing the field:
| package examples.vmts.initializationorder.chibaexample;
|
|
| import javassist.*;
| import javassi
I am pretty certain I am right, inner classes initialize their pointer to the
outer field before calling their own super. EG:
| abstract class Base {
| Base() {
| System.out.println( getField() );
| }
|
| abstract int getField();
| }
|
The constructor calls t
I want to set a field in a constructor before super is called so that the super
constructor can use the field, e.g.:
| abstract class Base {
| Base() { System.out.println( getField() ); }
| abstract int getField();
| }
|
| class Derived extends Base {
| int field;
|
If a class is compiled that does not have a package statement but is mistakenly
loaded in Javassist as though it did have a package statement then Javassist
will not detect this error and find the class and some methods will give
incorrect results but not thow an exception whilst others will thr
First two appologies: I don't seem to be able to watch this thread so I missed
your post and secondly my test class is a little long :( . Take a look at lines
75 to 90 which demonstrate the problem I am having with array class literals
and also with testing for null on primitive arrays (see sepe
3 couldn't when I tried the above example.
Howard.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3869965#3869965
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3869965
-
Ignore - I forgot to watch the topic :)
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3868136#3868136
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3868136
---
SF em
Ignore - I forgot to watch the topic :)
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3868135#3868135
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3868135
---
SF em
Hi,
The following code fails in the Javassist compiler when $2 is a primitive array:
if ( $2 != null )
| return $2.length;
Instead I have to use:
if ( System.identityHashCode( $2 ) != 0 )
| return $2.length;
Are there plans to add support for comparing primitive arrays to n
Hi,
The following code fails in the Javassist compiler:
if ( $3 instanceof Object[].class )
| return $3.length;
Instead I have to use:
Class array = java.lang.reflect.Array.newInstance( Object.class, 0 ).getClass();
| if ( array.isInstance( $3 ) )
| return $3.length;
Are
"chiba" wrote : I have implemented getEnclosingClass().
| The source is in CVS HEAD.
Thanks - I look forward to the next release
Keep up the good work
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3863341#3863341
Reply to the post :
http://www.jboss.org/i
I think I can answer my own question :)
In java.lang.Class the method getDeclaringClass returns null for an anonymous
class because the Java Language Specification doesn't list anonymous classes as
members of a class (but strangely does list named classes as members). I
suspect therefore that C
There is a bug in the getDeclaringClass method of CtClass when you try and get
the declaring class of an anonymous inner class it throws
FileNotFoundException. EG:
package examples.javassisttests.declaringclasses;
import javassist.*;
public class Test {
public static void main( final String[
17 matches
Mail list logo