示例#1
0
 public SDGFieldOfParameter(SDGProgramPart parent, String declaringClass, String fieldName) {
   // TODO: refactor SDGProgramPart code such that SDGFormalParameter, SDGActualParameter and
   // SDGFieldOfParameter
   // have a common super-class / interface
   if (parent == null || declaringClass == null || fieldName == null) {
     throw new IllegalArgumentException(
         String.format("%s %s %s", parent, declaringClass, fieldName));
   }
   boolean invalid = true;
   if (parent instanceof SDGFormalParameter) {
     invalid = false;
   } else if (parent instanceof SDGMethodExitNode) {
     invalid = false;
   } else if (parent instanceof SDGMethodExceptionNode) {
     invalid = false;
   } else if (parent instanceof SDGActualParameter) {
     invalid = false;
   } else if (parent instanceof SDGCallReturnNode) {
     invalid = false;
   } else if (parent instanceof SDGCallExceptionNode) {
     invalid = false;
   } else if (parent instanceof SDGFieldOfParameter) {
     invalid = false;
   }
   if (invalid) {
     throw new IllegalArgumentException(
         "invalid type of parent for a field of parameter: " + parent.getClass());
   }
   this.parent = parent;
   this.declaringClass = declaringClass;
   this.fieldName = fieldName;
 }
示例#2
0
 /* (non-Javadoc)
  * @see edu.kit.joana.api.sdg.SDGProgramPart#getOwningMethod()
  */
 @Override
 public SDGMethod getOwningMethod() {
   return parent.getOwningMethod();
 }