Program: 74339
Project: 74339
Buggy source:
/** 
 * Resolve the property values for the given top-level entity.
 * @param toplevel The given top level entity.
 */
protected void _resolveProperties(ModelAnalyzer analyzer) throws KernelException {
  super._resolveProperties(analyzer);
  PropertyConstraintCompositeHelper toplevelHelper=(PropertyConstraintCompositeHelper)getHelper(toplevel());
  toplevelHelper.reinitialize();
  toplevelHelper._addDefaultConstraints(_getConstraintType(actorConstraintType.stringValue()));
  toplevelHelper._setConnectionConstraintType(_getConstraintType(connectionConstraintType.stringValue()),_getConstraintType(compositeConnectionConstraintType.stringValue()),_getConstraintType(fsmConstraintType.stringValue()),_getConstraintType(expressionASTNodeConstraintType.stringValue()));
  try {
    List<Inequality> conflicts=new LinkedList<Inequality>();
    List<Inequality> unacceptable=new LinkedList<Inequality>();
    List<Inequality> constraintList=toplevelHelper.constraintList();
    if (constraintList.size() > 0) {
      CPO cpo=getLattice().lattice();
      InequalitySolver solver=new InequalitySolver(cpo,this);
      Iterator constraints=constraintList.iterator();
      solver.addInequalities(constraints);
      _constraintManager.setConstraints(constraintList);
      _stats.put("String_Node_Str",constraintList.size());
      _stats.put("String_Node_Str",_propertyTermManager.terms().size());
      File file=null;
      Writer writer=null;
      Date date=new Date();
      String timestamp=date.toString().replace("String_Node_Str","String_Node_Str");
      String logFilename=getContainer().getName() + "String_Node_Str" + getUseCaseName()+ "String_Node_Str"+ timestamp.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str";
      if (super.isResolve() && isLogMode()) {
        String directoryPath=logDirectory.getExpression();
        directoryPath+=directoryPath.endsWith("String_Node_Str") || directoryPath.endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
        if (directoryPath.startsWith(("String_Node_Str"))) {
          URI directory=new File(URIAttribute.getModelURI(this)).getParentFile().toURI();
          file=FileUtilities.nameToFile(directoryPath.substring(11) + logFilename,directory);
        }
 else {
          if (!logDirectory.asFile().exists()) {
            logDirectory.asFile().mkdirs();
          }
          file=FileUtilities.nameToFile(logFilename,logDirectory.asFile().toURI());
        }
        try {
          if (!file.exists()) {
            if (!file.getParentFile().exists()) {
              file.getParentFile().mkdirs();
            }
            file.createNewFile();
          }
          writer=new FileWriter(file);
          writer.write(_getStatsAsString("String_Node_Str"));
          writer.write(_getConstraintsAsLogFileString(constraintList,"String_Node_Str"));
        }
 catch (        IOException ex) {
          throw new PropertyResolutionException(this,ex,"String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
        }
      }
      if (super.isResolve() && isLogMode()) {
        String constraintFilename=_getTrainedConstraintFilename() + "String_Node_Str";
        _logHelperConstraints(toplevelHelper);
        _updateConstraintFile(constraintFilename);
      }
      if (!isCollectConstraints()) {
        if (solvingFixedPoint.stringValue().equals("String_Node_Str")) {
          solver.solveGreatest(isInitializeSolver());
        }
 else {
          solver.solveLeast(isInitializeSolver());
        }
      }
      if (super.isResolve() && isLogMode()) {
        try {
          writer.write(_getConstraintsAsLogFileString(constraintList,"String_Node_Str"));
          writer.close();
        }
 catch (        IOException ex) {
          throw new PropertyResolutionException(this,ex,"String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
        }
      }
      for (      Inequality inequality : constraintList) {
        if (!inequality.isSatisfied(_lattice.lattice())) {
          conflicts.add(inequality);
        }
 else {
          boolean isAcceptable=true;
          InequalityTerm[] lesserVariables=inequality.getLesserTerm().getVariables();
          InequalityTerm[] greaterVariables=inequality.getGreaterTerm().getVariables();
          for (          InequalityTerm variable : lesserVariables) {
            if (!variable.isValueAcceptable() && ((PropertyTerm)variable).isEffective()) {
              unacceptable.add(inequality);
              isAcceptable=false;
              break;
            }
          }
          if (isAcceptable) {
            for (            InequalityTerm variable : greaterVariables) {
              if (!variable.isValueAcceptable() && ((PropertyTerm)variable).isEffective()) {
                unacceptable.add(inequality);
                break;
              }
            }
          }
        }
      }
    }
    if (!isInitializeSolver() && !isCollectConstraints()) {
      if (conflicts.size() > 0) {
        throw new TypeConflictException(conflicts,"String_Node_Str" + toplevel().getFullName() + "String_Node_Str");
      }
      if (unacceptable.size() > 0) {
        throw new TypeConflictException(unacceptable,"String_Node_Str" + toplevel().getFullName() + "String_Node_Str");
      }
    }
  }
 catch (  IllegalActionException ex) {
    throw new PropertyResolutionException(this,toplevel(),ex,"String_Node_Str" + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Resolve the property values for the given top-level entity.
 * @param toplevel The given top level entity.
 */
protected void _resolveProperties(ModelAnalyzer analyzer) throws KernelException {
  super._resolveProperties(analyzer);
  PropertyConstraintHelper toplevelHelper=(PropertyConstraintHelper)getHelper(toplevel());
  toplevelHelper.reinitialize();
  toplevelHelper._addDefaultConstraints(_getConstraintType(actorConstraintType.stringValue()));
  toplevelHelper._setConnectionConstraintType(_getConstraintType(connectionConstraintType.stringValue()),_getConstraintType(compositeConnectionConstraintType.stringValue()),_getConstraintType(fsmConstraintType.stringValue()),_getConstraintType(expressionASTNodeConstraintType.stringValue()));
  try {
    List<Inequality> conflicts=new LinkedList<Inequality>();
    List<Inequality> unacceptable=new LinkedList<Inequality>();
    List<Inequality> constraintList=toplevelHelper.constraintList();
    if (constraintList.size() > 0) {
      CPO cpo=getLattice().lattice();
      InequalitySolver solver=new InequalitySolver(cpo,this);
      Iterator constraints=constraintList.iterator();
      solver.addInequalities(constraints);
      _constraintManager.setConstraints(constraintList);
      _stats.put("String_Node_Str",constraintList.size());
      _stats.put("String_Node_Str",_propertyTermManager.terms().size());
      File file=null;
      Writer writer=null;
      Date date=new Date();
      String timestamp=date.toString().replace("String_Node_Str","String_Node_Str");
      String logFilename=getContainer().getName() + "String_Node_Str" + getUseCaseName()+ "String_Node_Str"+ timestamp.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str";
      if (super.isResolve() && isLogMode()) {
        String directoryPath=logDirectory.getExpression();
        directoryPath+=directoryPath.endsWith("String_Node_Str") || directoryPath.endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
        if (directoryPath.startsWith(("String_Node_Str"))) {
          URI directory=new File(URIAttribute.getModelURI(this)).getParentFile().toURI();
          file=FileUtilities.nameToFile(directoryPath.substring(11) + logFilename,directory);
        }
 else {
          if (!logDirectory.asFile().exists()) {
            logDirectory.asFile().mkdirs();
          }
          file=FileUtilities.nameToFile(logFilename,logDirectory.asFile().toURI());
        }
        try {
          if (!file.exists()) {
            if (!file.getParentFile().exists()) {
              file.getParentFile().mkdirs();
            }
            file.createNewFile();
          }
          writer=new FileWriter(file);
          writer.write(_getStatsAsString("String_Node_Str"));
          writer.write(_getConstraintsAsLogFileString(constraintList,"String_Node_Str"));
        }
 catch (        IOException ex) {
          throw new PropertyResolutionException(this,ex,"String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
        }
      }
      if (super.isResolve() && isLogMode()) {
        String constraintFilename=_getTrainedConstraintFilename() + "String_Node_Str";
        _logHelperConstraints(toplevelHelper);
        _updateConstraintFile(constraintFilename);
      }
      if (!isCollectConstraints()) {
        if (solvingFixedPoint.stringValue().equals("String_Node_Str")) {
          solver.solveGreatest(isInitializeSolver());
        }
 else {
          solver.solveLeast(isInitializeSolver());
        }
      }
      if (super.isResolve() && isLogMode()) {
        try {
          writer.write(_getConstraintsAsLogFileString(constraintList,"String_Node_Str"));
          writer.close();
        }
 catch (        IOException ex) {
          throw new PropertyResolutionException(this,ex,"String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
        }
      }
      for (      Inequality inequality : constraintList) {
        if (!inequality.isSatisfied(_lattice.lattice())) {
          conflicts.add(inequality);
        }
 else {
          boolean isAcceptable=true;
          InequalityTerm[] lesserVariables=inequality.getLesserTerm().getVariables();
          InequalityTerm[] greaterVariables=inequality.getGreaterTerm().getVariables();
          for (          InequalityTerm variable : lesserVariables) {
            if (!variable.isValueAcceptable() && ((PropertyTerm)variable).isEffective()) {
              unacceptable.add(inequality);
              isAcceptable=false;
              break;
            }
          }
          if (isAcceptable) {
            for (            InequalityTerm variable : greaterVariables) {
              if (!variable.isValueAcceptable() && ((PropertyTerm)variable).isEffective()) {
                unacceptable.add(inequality);
                break;
              }
            }
          }
        }
      }
    }
    if (!isInitializeSolver() && !isCollectConstraints()) {
      if (conflicts.size() > 0) {
        throw new TypeConflictException(conflicts,"String_Node_Str" + toplevel().getFullName() + "String_Node_Str");
      }
      if (unacceptable.size() > 0) {
        throw new TypeConflictException(unacceptable,"String_Node_Str" + toplevel().getFullName() + "String_Node_Str");
      }
    }
  }
 catch (  IllegalActionException ex) {
    throw new PropertyResolutionException(this,toplevel(),ex,"String_Node_Str" + "String_Node_Str");
  }
}