You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Ceki Gülcü <ce...@qos.ch> on 2004/11/22 17:00:49 UTC

World of trouble

Hi all,

If you try to compile log4j sources using ant (I'm using ant version
1.5.1) you will get a bunch of compiler errors about ambiguous method
signatures. For example,

     [javac] log4j-1.3\src\java\org\apache\log4j\net\XMLSocketNode.java:123:
     reference to error is ambiguous, both method 
error(java.lang.Object,java.lang.Throwable)
     in org.apache.log4j.Category and method 
error(java.lang.Object,java.lang.Object)
     in org.apache.log4j.Logger match

These errors occur even if you are using JDK 1.4 (have not tried with
1.5). However, if you are using Eclipse with the default Compiler
compliance level (which is 1.4), the code compiles fine.

To change the Compiler compliance level see
Preferences->Java->Compiler->Compliance & Class files.

Anyway, the error can be corrected by merging the methods
Logger.error(Object, Exception) and Logger.error(String, Object) into
Logger.error(Object, Object).

I wonder how Sun changed the method resolution algorithm between 1.3
and 1.4.


-- 
Ceki Gülcü

  The complete log4j manual:  http://qos.ch/eclm
  Professional log4j support: http://qos.ch/log4jSupport  



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