package soot.JastAddJ; import java.util.HashSet;import java.util.LinkedHashSet;import java.io.File;import java.util.*;import beaver.*;import java.util.ArrayList;import java.util.zip.*;import java.io.*;import java.io.FileNotFoundException;import java.util.Collection;import soot.*;import soot.util.*;import soot.jimple.*;import soot.coffi.ClassFile;import soot.coffi.method_info;import soot.coffi.CONSTANT_Utf8_info;import soot.tagkit.SourceFileTag;import soot.coffi.CoffiMethodSource; public class InstanceInitializer extends BodyDecl implements Cloneable { public void flushCache() { super.flushCache(); exceptions_computed = false; exceptions_value = null; isDAafter_Variable_values = null; isDUafter_Variable_values = null; handlesException_TypeDecl_values = null; } public void flushCollectionCache() { super.flushCollectionCache(); } @SuppressWarnings({"unchecked", "cast"}) public InstanceInitializer clone() throws CloneNotSupportedException { InstanceInitializer node = (InstanceInitializer)super.clone(); node.exceptions_computed = false; node.exceptions_value = null; node.isDAafter_Variable_values = null; node.isDUafter_Variable_values = null; node.handlesException_TypeDecl_values = null; node.in$Circle(false); node.is$Final(false); return node; } @SuppressWarnings({"unchecked", "cast"}) public InstanceInitializer copy() { try { InstanceInitializer node = (InstanceInitializer)clone(); if(children != null) node.children = (ASTNode[])children.clone(); return node; } catch (CloneNotSupportedException e) { } System.err.println("Error: Could not clone node of type " + getClass().getName() + "!"); return null; } @SuppressWarnings({"unchecked", "cast"}) public InstanceInitializer fullCopy() { InstanceInitializer res = (InstanceInitializer)copy(); for(int i = 0; i < getNumChildNoTransform(); i++) { ASTNode node = getChildNoTransform(i); if(node != null) node = node.fullCopy(); res.setChild(node, i); } return res; } // Declared in PrettyPrint.jadd at line 106 // Type body decl public void toString(StringBuffer s) { if(getBlock().getNumStmt() > 0) { s.append(indent()); getBlock().toString(s); } } // Declared in UnreachableStatements.jrag at line 22 void checkUnreachableStmt() { if(!getBlock().canCompleteNormally()) error("instance initializer in " + hostType().fullName() + " can not complete normally"); } // Declared in java.ast at line 3 // Declared in java.ast line 70 public InstanceInitializer() { super(); } // Declared in java.ast at line 10 // Declared in java.ast line 70 public InstanceInitializer(Block p0) { setChild(p0, 0); } // Declared in java.ast at line 14 protected int numChildren() { return 1; } // Declared in java.ast at line 17 public boolean mayHaveRewrite() { return false; } // Declared in java.ast at line 2 // Declared in java.ast line 70 public void setBlock(Block node) { setChild(node, 0); } // Declared in java.ast at line 5 public Block getBlock() { return (Block)getChild(0); } // Declared in java.ast at line 9 public Block getBlockNoTransform() { return (Block)getChildNoTransform(0); } protected boolean exceptions_computed = false; protected Collection exceptions_value; // Declared in AnonymousClasses.jrag at line 179 @SuppressWarnings({"unchecked", "cast"}) public Collection exceptions() { if(exceptions_computed) { return exceptions_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); exceptions_value = exceptions_compute(); if(isFinal && num == state().boundariesCrossed) exceptions_computed = true; return exceptions_value; } private Collection exceptions_compute() { HashSet set = new HashSet(); collectExceptions(set, this); for(Iterator iter = set.iterator(); iter.hasNext(); ) { TypeDecl typeDecl = (TypeDecl)iter.next(); if(!getBlock().reachedException(typeDecl)) iter.remove(); } return set; } // Declared in DefiniteAssignment.jrag at line 294 @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafter(Variable v) { Object _parameters = v; if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4); if(isDAafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafter_Variable_value = isDAafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value)); return isDAafter_Variable_value; } private boolean isDAafter_compute(Variable v) { return getBlock().isDAafter(v); } // Declared in DefiniteAssignment.jrag at line 750 @SuppressWarnings({"unchecked", "cast"}) public boolean isDUafter(Variable v) { Object _parameters = v; if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4); if(isDUafter_Variable_values.containsKey(_parameters)) { return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUafter_Variable_value = isDUafter_compute(v); if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value)); return isDUafter_Variable_value; } private boolean isDUafter_compute(Variable v) { return getBlock().isDUafter(v); } protected java.util.Map handlesException_TypeDecl_values; // Declared in ExceptionHandling.jrag at line 32 @SuppressWarnings({"unchecked", "cast"}) public boolean handlesException(TypeDecl exceptionType) { Object _parameters = exceptionType; if(handlesException_TypeDecl_values == null) handlesException_TypeDecl_values = new java.util.HashMap(4); if(handlesException_TypeDecl_values.containsKey(_parameters)) { return ((Boolean)handlesException_TypeDecl_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean handlesException_TypeDecl_value = getParent().Define_boolean_handlesException(this, null, exceptionType); if(isFinal && num == state().boundariesCrossed) handlesException_TypeDecl_values.put(_parameters, Boolean.valueOf(handlesException_TypeDecl_value)); return handlesException_TypeDecl_value; } // Declared in DefiniteAssignment.jrag at line 439 public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getBlockNoTransform()) { return isDAbefore(v); } return getParent().Define_boolean_isDAbefore(this, caller, v); } // Declared in ExceptionHandling.jrag at line 157 public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) { if(caller == getBlockNoTransform()){ if(hostType().isAnonymous()) return true; if(!exceptionType.isUncheckedException()) return true; for(Iterator iter = hostType().constructors().iterator(); iter.hasNext(); ) { ConstructorDecl decl = (ConstructorDecl)iter.next(); if(!decl.throwsException(exceptionType)) return false; } return true; } return getParent().Define_boolean_handlesException(this, caller, exceptionType); } // Declared in NameCheck.jrag at line 243 public ASTNode Define_ASTNode_enclosingBlock(ASTNode caller, ASTNode child) { if(caller == getBlockNoTransform()) { return this; } return getParent().Define_ASTNode_enclosingBlock(this, caller); } // Declared in TypeHierarchyCheck.jrag at line 140 public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) { if(caller == getBlockNoTransform()) { return false; } return getParent().Define_boolean_inStaticContext(this, caller); } // Declared in UnreachableStatements.jrag at line 35 public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) { if(caller == getBlockNoTransform()) { return true; } return getParent().Define_boolean_reachable(this, caller); } public ASTNode rewriteTo() { return super.rewriteTo(); } }