You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by le...@apache.org on 2004/01/22 12:00:13 UTC

cvs commit: jakarta-commons-sandbox/attributes/compiler/src/java/org/apache/commons/attributes/compiler AttributeCompiler.java

leosutic    2004/01/22 03:00:13

  Modified:    attributes/compiler/src/java/org/apache/commons/attributes/compiler
                        AttributeCompiler.java
  Log:
  Need to erase type information to keep the compiler from signalling an error
  if the instanceof test can not possibly be true (for example, if _attr is a
  java.lang.String).
  
  Revision  Changes    Path
  1.9       +3 -2      jakarta-commons-sandbox/attributes/compiler/src/java/org/apache/commons/attributes/compiler/AttributeCompiler.java
  
  Index: AttributeCompiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/attributes/compiler/src/java/org/apache/commons/attributes/compiler/AttributeCompiler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AttributeCompiler.java	15 Jan 2004 21:04:13 -0000	1.8
  +++ AttributeCompiler.java	22 Jan 2004 11:00:13 -0000	1.9
  @@ -192,8 +192,9 @@
                   
                   pw.println ("        {");
                   outputAttributeExpression (pw, expression, fileName, tag.getLineNumber (), "_attr");
  -                pw.println ("        if (_attr instanceof org.apache.commons.attributes.Sealable) {");
  -                pw.println ("            ((org.apache.commons.attributes.Sealable) _attr).seal ();");
  +                pw.println ("        Object _oattr = _attr; // Need to erase type information");
  +                pw.println ("        if (_oattr instanceof org.apache.commons.attributes.Sealable) {");
  +                pw.println ("            ((org.apache.commons.attributes.Sealable) _oattr).seal ();");
                   pw.println ("        }");
                   pw.println ("        " + collectionName + ".add ( _attr );");
                   pw.println ("        }");
  
  
  

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