james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefano Bagnara" <apa...@bago.org>
Subject Re: svn commit: r265559 (ATTN: Vincenzo)
Date Sat, 03 Sep 2005 16:35:35 GMT
> In the BayesianAnalysis mailet the instantiation of 
> JDBCBayesianAnalyzer is as follows:
> 
>     private JDBCBayesianAnalyzer analyzer = new 
> JDBCBayesianAnalyzer() {
>         protected void delegatedLog(String logString) {
>             log("BayesianAnalysis: " + logString);
>         }
>     };
> 
> May it be that a jdk change has changed the behaviour of 
> this.getClass() in this case? If true, it frightens me a 
> little bit. What is your jdk? 
> Mine is 1.4.2_07.
> 
> Anyway, your fix makes it safer, so let's keep it.
> 
> Vincenzo

I don't know how/when it happened: now the this.getClass call the getClass
of the innerclass and it find BayesianAnalysis$2 instead of
JDBCBayesianAnalyzer.

I'm using 1.4.2_07 too. I've tested with 1.5 and I keep getting the same
result.

Can you try running this code?

public class Test {

	public Class test() {
		return(this.getClass());
	}
	
	public static void main(String[] args) {
		Test t = new Test() {
			
		};
		
		System.out.println(t.test().equals(Test.class));
		
	}
}

It returns false in all my tests.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message