[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bcel-dev
Subject:    cvs commit: jakarta-bcel/src/java/org/apache/bcel/verifier/statics Pass2Verifier.java
From:       enver () apache ! org
Date:       2004-10-08 9:30:13
Message-ID: 20041008093013.54545.qmail () minotaur ! apache ! org
[Download RAW message or body]

enver       2004/10/08 02:30:13

  Modified:    src/java/org/apache/bcel/verifier/statics Pass2Verifier.java
  Log:
  Submitted by:	Rob Gonzales
  Reviewed by:	Enver Haase
  
  Don't reject a class "overriding" a "private final" method.
  
  Revision  Changes    Path
  1.8       +8 -3      \
jakarta-bcel/src/java/org/apache/bcel/verifier/statics/Pass2Verifier.java  
  Index: Pass2Verifier.java
  ===================================================================
  RCS file: /home/cvs/jakarta-bcel/src/java/org/apache/bcel/verifier/statics/Pass2Verifier.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Pass2Verifier.java	30 Apr 2004 06:51:33 -0000	1.7
  +++ Pass2Verifier.java	8 Oct 2004 09:30:13 -0000	1.8
  @@ -246,8 +246,13 @@
   				String name_and_sig = (methods[i].getName()+methods[i].getSignature());
   
   				if (hashmap.containsKey(name_and_sig)){
  -					if (methods[i].isFinal()){
  -						throw new ClassConstraintException("Method '"+name_and_sig+"' in class \
'"+hashmap.get(name_and_sig)+"' overrides the final (not-overridable) definition in \
class '"+jc.getClassName()+"'.");  +					if ( methods[i].isFinal() ){
  +					  if (!(methods[i].isPrivate())) {
  +						  throw new ClassConstraintException("Method '"+name_and_sig+"' in class \
'"+hashmap.get(name_and_sig)+"' overrides the final (not-overridable) definition in \
class '"+jc.getClassName()+"'.");  +					  }
  +					  else{
  +						  addMessage("Method '"+name_and_sig+"' in class \
'"+hashmap.get(name_and_sig)+"' overrides the final (not-overridable) definition in \
class '"+jc.getClassName()+"'. This is okay, as the original definition was private; \
however this constraint leverage was introduced by JLS 8.4.6 (not vmspec2) and the \
behaviour of the Sun verifiers.");  +					  }
   					}
   					else{
   						if (!methods[i].isStatic()){ // static methods don't inherit
  
  
  

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic