Input:
  public boolean execute(Map<ConanParameter, String> parameters)
      throws ProcessExecutionException, IllegalArgumentException,
      InterruptedException {
    int exitValue = 0;
    AccessionParameter accession = new AccessionParameter();
    accession.setAccession(parameters.get(accessionParameter));
    String reportsDir =
        accession.getFile().getParentFile().getAbsolutePath() + File.separator +
            "reports";
    File reportsDirFile = new File(reportsDir);
    if (!reportsDirFile.exists()) {
      reportsDirFile.mkdirs();
    }
    String fileName = reportsDir + File.separator + accession.getAccession() +
        "_AtlasEligibilityCheck" +
        "_" + new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss").format(new Date()) +
        ".report";
    try {
      log = new BufferedWriter(new FileWriter(fileName));
      log.write("Atlas Eligibility Check: START\n");
    }
    catch (IOException e) {
      exitValue = 1;
      e.printStackTrace();
      ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
      "Can't create report file '" + fileName + "'");
      String[] errors = new String[1];
      errors[0] =  "Can't create report file '" + fileName + "'";
      pex.setProcessOutput(errors);
      throw pex;
    }
    MAGETABParser parser = new MAGETABParser();
    try {
      MAGETABInvestigation investigation =
          parser.parse(accession.getFile().getAbsoluteFile());
      boolean isAtlasType = false;
      String restrictedExptType = "";
      if (investigation.IDF.getComments().containsKey("AEExperimentType")) {
        for (String exptType : investigation.IDF.getComments()
            .get("AEExperimentType")) {
          for (String AtlasType : controlledVocabularyDAO
              .getAtlasExperimentTypes()) {
            if (exptType.equals(AtlasType)) {
              isAtlasType = true;
            }
            else {
              restrictedExptType = exptType;
            }
          }
        }
      }
      else {
       for (String exptType : investigation.IDF.experimentalDesign) {
          for (String AtlasType : controlledVocabularyDAO
              .getAtlasExperimentTypes()) {
            if (exptType.equals(AtlasType)) {
              isAtlasType = true;
            }
          }
        }
       }
      if (!isAtlasType)
      {
        exitValue = 1;
        log.write(
            "'Experiment Type' " + restrictedExptType + " is not accepted by Atlas\n");
        System.out.println(
            "'Experiment Type' " + restrictedExptType + " is not accepted by Atlas");
        ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
        "'Experiment Type' " + restrictedExptType + " is not accepted by Atlas");
        String[] errors = new String[1];
        errors[0] = "'Experiment Type' " + restrictedExptType + " is not accepted by Atlas";
        pex.setExceptionCausesAbort();
        pex.setProcessOutput(errors);
        throw pex;
      }
      else {
        if (investigation.SDRF.getNumberOfChannels() > 1) {
          exitValue = 1;
          log.write(
              "Two-channel experiment is not accepted by Atlas\n");
          System.out.println(
              "Two-channel experiment is not accepted by Atlas");
          ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
          "Two-channel experiment is not accepted by Atlas");
          String[] errors = new String[1];
          errors[0] = "Two-channel experiment is not accepted by Atlas";
          pex.setExceptionCausesAbort();
          pex.setProcessOutput(errors);
          throw pex;
        }
        Collection<HybridizationNode> hybridizationNodes =
            investigation.SDRF.getNodes(HybridizationNode.class);
        Collection<ArrayDataNode> rawDataNodes =
            investigation.SDRF.getNodes(ArrayDataNode.class);
        Collection<DerivedArrayDataNode> processedDataNodes =
            investigation.SDRF.getNodes(DerivedArrayDataNode.class);
        Collection<DerivedArrayDataMatrixNode> processedDataMatrixNodes =
            investigation.SDRF.getNodes(DerivedArrayDataMatrixNode.class);
        int factorValues = 0;
        for (HybridizationNode hybNode : hybridizationNodes)
        {
          if (hybNode.factorValues.size() > 0) {
            factorValues++;
          }
          ArrayDesignAccessions.clear();
          for (ArrayDesignAttribute arrayDesign : hybNode.arrayDesigns) {
            if (!ArrayDesignAccessions
                .contains(arrayDesign.getAttributeValue())) {
              ArrayDesignAccessions.add(arrayDesign.getAttributeValue());
            }
          }
        }
        if (factorValues == 0) {
          exitValue = 1;
          log.write(
              "Experiment does not have Factor Values\n");
          System.out.println(
              "Experiment does not have Factor Values");
          ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
          "Experiment does not have Factor Values");
          String[] errors = new String[1];
          errors[0] = "Experiment does not have Factor Values";
          pex.setExceptionCausesAbort();
          pex.setProcessOutput(errors);
          throw pex;
        }
        boolean factorTypesFromCV = true;
        List<String> missedFactorType = new ArrayList<String>();
        for (String factorType : investigation.IDF.experimentalFactorType) {
          if (!controlledVocabularyDAO
              .getAtlasFactorTypes().contains(factorType)) {
            factorTypesFromCV = false;
            missedFactorType.add(factorType);
          }
        }
        if (!factorTypesFromCV) {
          exitValue = 1;
          log.write(
              "Experiment have Factor Types that are not in controlled vocabulary:" +
                  missedFactorType + "\n");
          System.out.println(
              "Experiment have Factor Types that are not in controlled vocabulary:" +
                  missedFactorType);
          ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
          "Experiment have Factor Types that are not in controlled vocabulary:" +
                  missedFactorType);
          String[] errors = new String[1];
          errors[0] = "Experiment have Factor Types that are not in controlled vocabulary:" +
                  missedFactorType;
          pex.setExceptionCausesAbort();
          pex.setProcessOutput(errors);
          throw pex;
        }
        for (String arrayDesign : ArrayDesignAccessions) {
          ArrayDesignExistenceChecking arrayDesignExistenceChecking =
              new ArrayDesignExistenceChecking();
          String arrayCheckResult =
              arrayDesignExistenceChecking.execute(arrayDesign);
          if (arrayCheckResult.equals("empty") ||
              arrayCheckResult.equals("no")) {
            exitValue = 1;
            log.write("Array design '" +
                          arrayDesign +
                          "' used in experiment is not in Atlas\n");
            System.out.println("Array design '" +
                                   arrayDesign +
                                   "' used in experiment is not in Atlas");
            ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
            "Array design '" +
                                   arrayDesign +
                                   "' used in experiment is not in Atlas");
            String[] errors = new String[1];
            errors[0] = "Array design '" +
                                   arrayDesign +
                                   "' used in experiment is not in Atlas";
            pex.setExceptionCausesAbort();
            pex.setProcessOutput(errors);
            throw pex;
          }
          else {
            Collection<HybridizationNode> hybridizationSubNodes =
                new ArrayList<HybridizationNode>();
            Collection<Node> rawDataSubNodes = new ArrayList<Node>();
            Collection<Node> processedDataSubNodes = new ArrayList<Node>();
            Collection<Node> processedDataMatrixSubNodes =
                new ArrayList<Node>();
            if (ArrayDesignAccessions.size() > 1) {
              for (HybridizationNode hybNode : hybridizationNodes) {
                ArrayDesignAttribute attribute = new ArrayDesignAttribute();
                attribute.setAttributeValue(arrayDesign);
                if (hybNode.arrayDesigns.contains(attribute)) {
                  hybridizationSubNodes.add(hybNode);
                  getNodes(hybNode, ArrayDataNode.class, rawDataSubNodes);
                  getNodes(hybNode, DerivedArrayDataNode.class,
                           processedDataSubNodes);
                  getNodes(hybNode, DerivedArrayDataMatrixNode.class,
                           processedDataMatrixSubNodes);
                }
              }
            }
            else {
              hybridizationSubNodes = hybridizationNodes;
              for (ArrayDataNode node : rawDataNodes) {
                rawDataSubNodes.add(node);
              }
              for (DerivedArrayDataNode node : processedDataNodes) {
                processedDataSubNodes.add(node);
              }
              for (DerivedArrayDataMatrixNode node : processedDataMatrixNodes) {
                processedDataMatrixSubNodes.add(node);
              }
            }
            if (arrayCheckResult.equals("affy") &&
                hybridizationSubNodes.size() != rawDataSubNodes.size())
            {
              exitValue = 1;
              log.write(
                  "Affymetrix experiment without raw data files\n");
              System.out.println(
                  "Affymetrix experiment without raw data files");
              ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
              "Affymetrix experiment without raw data files");
              String[] errors = new String[1];
              errors[0] = "Affymetrix experiment without raw data files";
              pex.setExceptionCausesAbort();
              pex.setProcessOutput(errors);
              throw pex;
            }
            else
              if (processedDataSubNodes.size() == 0 &&
                  processedDataMatrixSubNodes.size() == 0) {
                exitValue = 1;
                log.write(
                    "Non-Affymetrix experiment without processed data files\n");
                System.out.println(
                    "Non-Affymetrix experiment without processed data files");
                ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
                "Non-Affymetrix experiment without processed data files");
                String[] errors = new String[1];
                errors[0] = "Non-Affymetrix experiment without processed data files";
                pex.setExceptionCausesAbort();
                pex.setProcessOutput(errors);
                throw pex;
              }
          }
        }
      }
    }
    catch (ParseException e) {
      exitValue = 1;
      e.printStackTrace();
      ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
                e.getMessage());
      String[] errors = new String[1];
      errors[0] = e.getMessage();
      pex.setProcessOutput(errors);
      throw pex;
    }
    catch (IOException e) {
      exitValue = 1;
      e.printStackTrace();
      ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
                e.getMessage());
      String[] errors = new String[1];
      errors[0] = e.getMessage();
      pex.setProcessOutput(errors);
      throw pex;
    }
    catch (RuntimeException e) {
      exitValue = 1;
      e.printStackTrace();
      ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
                e.getMessage());
      String[] errors = new String[1];
      errors[0] = e.getMessage();
      pex.setProcessOutput(errors);
      throw pex;
    }
    finally {
      try {
        if (exitValue == 0) {
          log.write("Experiment \"" +
                        accession.getAccession() +
                        "\" is eligible for Atlas\n");
        }
        else {
          log.write("Experiment \"" +
                        accession.getAccession() +
                        "\" is NOT eligible for Atlas\n");
        }
        log.write("Atlas Eligibility Check: FINISHED");
        log.write(
              "Eligibility checks for Gene Expression Atlas version 2.0.9.3: \n" +
              "1. Experiment has raw data for Affymetrix platforms or normalized data for all other platforms;\n" +
              "2. Array design(s) used in experiment are loaded into Atlas;\n" +
              "3. Type of experiment is from the list: \n" +
                  "transcription profiling by array,\n" +
                  "methylation profiling by array,\n" +
                  "tiling path by array,\n" +
                  "comparative genomic hybridization by array,\n" +
                  "microRNA profiling by array,\n" +
                  "RNAi profiling by array,\n" +
                  "ChIP-chip by array;\n" +
              "4. Experiments is not two-channel;\n" +
              "5. Experiment has factor values;\n" +
              "6. Factor types are from controlled vocabulary.");
        log.close();
      }
      catch (IOException e) {
        e.printStackTrace();
        ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
                e.getMessage());
        String[] errors = new String[1];
        errors[0] = e.getMessage();
        pex.setProcessOutput(errors);
        throw pex;
      }
    }
    ProcessExecutionException pex =  new ProcessExecutionException(exitValue,"Something wrong in the code ");
    if (exitValue == 0) {
      return true;
    }
    else {
      String[] errors = new String[1];
      errors[0] = "Something wrong in the code ";
      pex.setProcessOutput(errors);
      throw pex;
    }
  }

Output:
  public boolean execute(Map<ConanParameter, String> parameters)
      throws ProcessExecutionException, IllegalArgumentException,
      InterruptedException {
    int exitValue = 0;
    AccessionParameter accession = new AccessionParameter();
    accession.setAccession(parameters.get(accessionParameter));
    String reportsDir =
        accession.getFile().getParentFile().getAbsolutePath() + File.separator +
            "reports";
    File reportsDirFile = new File(reportsDir);
    if (!reportsDirFile.exists()) {
      reportsDirFile.mkdirs();
    }
    String fileName = reportsDir + File.separator + accession.getAccession() +
        "_AtlasEligibilityCheck" +
        "_" + new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss").format(new Date()) +
        ".report";
    try {
      log = new BufferedWriter(new FileWriter(fileName));
      log.write("Atlas Eligibility Check: START\n");
    }
    catch (IOException e) {
      exitValue = 1;
      e.printStackTrace();
      ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
      "Can't create report file '" + fileName + "'");
      String[] errors = new String[1];
      errors[0] =  "Can't create report file '" + fileName + "'";
      pex.setProcessOutput(errors);
      throw pex;
    }
    MAGETABParser parser = new MAGETABParser();
    try {
      MAGETABInvestigation investigation =
          parser.parse(accession.getFile().getAbsoluteFile());
      boolean isAtlasType = false;
      String restrictedExptType = "";
      if (investigation.IDF.getComments().containsKey("AEExperimentType")) {
        for (String exptType : investigation.IDF.getComments()
            .get("AEExperimentType")) {
          for (String AtlasType : controlledVocabularyDAO
              .getAtlasExperimentTypes()) {
            if (exptType.equals(AtlasType)) {
              isAtlasType = true;
            }
            else {
              restrictedExptType = exptType;
            }
          }
        }
      }
      else {
       for (String exptType : investigation.IDF.experimentalDesign) {
          for (String AtlasType : controlledVocabularyDAO
              .getAtlasExperimentTypes()) {
            if (exptType.equals(AtlasType)) {
              isAtlasType = true;
            }
          }
        }
       }
      if (!isAtlasType)
      {
        exitValue = 1;
        log.write(
            "'Experiment Type' " + restrictedExptType + " is not accepted by Atlas\n");
        System.out.println(
            "'Experiment Type' " + restrictedExptType + " is not accepted by Atlas");
        ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
        "'Experiment Type' " + restrictedExptType + " is not accepted by Atlas");
        String[] errors = new String[1];
        errors[0] = "'Experiment Type' " + restrictedExptType + " is not accepted by Atlas";
        pex.setExceptionCausesAbort();
        pex.setProcessOutput(errors);
        throw pex;
      }
      else {
        if (investigation.SDRF.getNumberOfChannels() > 1) {
          exitValue = 1;
          log.write(
              "Two-channel experiment is not accepted by Atlas\n");
          System.out.println(
              "Two-channel experiment is not accepted by Atlas");
          ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
          "Two-channel experiment is not accepted by Atlas");
          String[] errors = new String[1];
          errors[0] = "Two-channel experiment is not accepted by Atlas";
          pex.setExceptionCausesAbort();
          pex.setProcessOutput(errors);
          throw pex;
        }
        Collection<HybridizationNode> hybridizationNodes =
            investigation.SDRF.getNodes(HybridizationNode.class);
        Collection<ArrayDataNode> rawDataNodes =
            investigation.SDRF.getNodes(ArrayDataNode.class);
        Collection<DerivedArrayDataNode> processedDataNodes =
            investigation.SDRF.getNodes(DerivedArrayDataNode.class);
        Collection<DerivedArrayDataMatrixNode> processedDataMatrixNodes =
            investigation.SDRF.getNodes(DerivedArrayDataMatrixNode.class);
        int factorValues = 0;
        for (HybridizationNode hybNode : hybridizationNodes)
        {
          if (hybNode.factorValues.size() > 0) {
            factorValues++;
          }
          ArrayDesignAccessions.clear();
          for (ArrayDesignAttribute arrayDesign : hybNode.arrayDesigns) {
            if (!ArrayDesignAccessions
                .contains(arrayDesign.getAttributeValue())) {
              ArrayDesignAccessions.add(arrayDesign.getAttributeValue());
            }
          }
        }
        if (factorValues == 0) {
          exitValue = 1;
          log.write(
              "Experiment does not have Factor Values\n");
          System.out.println(
              "Experiment does not have Factor Values");
          ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
          "Experiment does not have Factor Values");
          String[] errors = new String[1];
          errors[0] = "Experiment does not have Factor Values";
          pex.setExceptionCausesAbort();
          pex.setProcessOutput(errors);
          throw pex;
        }
        boolean factorTypesFromCV = true;
        List<String> missedFactorType = new ArrayList<String>();
        for (String factorType : investigation.IDF.experimentalFactorType) {
          if (!controlledVocabularyDAO
              .getAtlasFactorTypes().contains(factorType)) {
            factorTypesFromCV = false;
            missedFactorType.add(factorType);
          }
        }
        if (!factorTypesFromCV) {
          exitValue = 1;
          log.write(
              "Experiment have Factor Types that are not in controlled vocabulary:" +
                  missedFactorType + "\n");
          System.out.println(
              "Experiment have Factor Types that are not in controlled vocabulary:" +
                  missedFactorType);
          ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
          "Experiment have Factor Types that are not in controlled vocabulary:" +
                  missedFactorType);
          String[] errors = new String[1];
          errors[0] = "Experiment have Factor Types that are not in controlled vocabulary:" +
                  missedFactorType;
          pex.setExceptionCausesAbort();
          pex.setProcessOutput(errors);
          throw pex;
        }
        for (String arrayDesign : ArrayDesignAccessions) {
          ArrayDesignExistenceChecking arrayDesignExistenceChecking =
              new ArrayDesignExistenceChecking();
          String arrayCheckResult =
              arrayDesignExistenceChecking.execute(arrayDesign);
          if (arrayCheckResult.equals("empty") ||
              arrayCheckResult.equals("no")) {
            exitValue = 1;
            log.write("Array design '" +
                          arrayDesign +
                          "' used in experiment is not in Atlas\n");
            System.out.println("Array design '" +
                                   arrayDesign +
                                   "' used in experiment is not in Atlas");
            ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
            "Array design '" +
                                   arrayDesign +
                                   "' used in experiment is not in Atlas");
            String[] errors = new String[1];
            errors[0] = "Array design '" +
                                   arrayDesign +
                                   "' used in experiment is not in Atlas";
            pex.setExceptionCausesAbort();
            pex.setProcessOutput(errors);
            throw pex;
          }
          else {
            Collection<HybridizationNode> hybridizationSubNodes =
                new ArrayList<HybridizationNode>();
            Collection<Node> rawDataSubNodes = new ArrayList<Node>();
            Collection<Node> processedDataSubNodes = new ArrayList<Node>();
            Collection<Node> processedDataMatrixSubNodes =
                new ArrayList<Node>();
            if (ArrayDesignAccessions.size() > 1) {
              for (HybridizationNode hybNode : hybridizationNodes) {
                ArrayDesignAttribute attribute = new ArrayDesignAttribute();
                attribute.setAttributeValue(arrayDesign);
                if (hybNode.arrayDesigns.contains(attribute)) {
                  hybridizationSubNodes.add(hybNode);
                  getNodes(hybNode, ArrayDataNode.class, rawDataSubNodes);
                  getNodes(hybNode, DerivedArrayDataNode.class,
                           processedDataSubNodes);
                  getNodes(hybNode, DerivedArrayDataMatrixNode.class,
                           processedDataMatrixSubNodes);
                }
              }
            }
            else {
              hybridizationSubNodes = hybridizationNodes;
              for (ArrayDataNode node : rawDataNodes) {
                rawDataSubNodes.add(node);
              }
              for (DerivedArrayDataNode node : processedDataNodes) {
                processedDataSubNodes.add(node);
              }
              for (DerivedArrayDataMatrixNode node : processedDataMatrixNodes) {
                processedDataMatrixSubNodes.add(node);
              }
            }
            if (arrayCheckResult.equals("affy") &&
                hybridizationSubNodes.size() != rawDataSubNodes.size())
            {
              exitValue = 1;
              log.write(
                  "Affymetrix experiment without raw data files\n");
              System.out.println(
                  "Affymetrix experiment without raw data files");
              ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
              "Affymetrix experiment without raw data files");
              String[] errors = new String[1];
              errors[0] = "Affymetrix experiment without raw data files";
              pex.setExceptionCausesAbort();
              pex.setProcessOutput(errors);
              throw pex;
            }
            else
              if (!arrayCheckResult.equals("affy") && processedDataSubNodes.size() == 0 &&
                  processedDataMatrixSubNodes.size() == 0) {
                exitValue = 1;
                log.write(
                    "Non-Affymetrix experiment without processed data files\n");
                System.out.println(
                    "Non-Affymetrix experiment without processed data files");
                ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
                "Non-Affymetrix experiment without processed data files");
                String[] errors = new String[1];
                errors[0] = "Non-Affymetrix experiment without processed data files";
                pex.setExceptionCausesAbort();
                pex.setProcessOutput(errors);
                throw pex;
              }
          }
        }
      }
    }
    catch (ParseException e) {
      exitValue = 1;
      e.printStackTrace();
      ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
                e.getMessage());
      String[] errors = new String[1];
      errors[0] = e.getMessage();
      pex.setProcessOutput(errors);
      throw pex;
    }
    catch (IOException e) {
      exitValue = 1;
      e.printStackTrace();
      ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
                e.getMessage());
      String[] errors = new String[1];
      errors[0] = e.getMessage();
      pex.setProcessOutput(errors);
      throw pex;
    }
    catch (RuntimeException e) {
      exitValue = 1;
      e.printStackTrace();
      ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
                e.getMessage());
      String[] errors = new String[1];
      errors[0] = e.getMessage();
      pex.setProcessOutput(errors);
      throw pex;
    }
    finally {
      try {
        if (exitValue == 0) {
          log.write("Experiment \"" +
                        accession.getAccession() +
                        "\" is eligible for Atlas\n");
        }
        else {
          log.write("Experiment \"" +
                        accession.getAccession() +
                        "\" is NOT eligible for Atlas\n");
        }
        log.write("Atlas Eligibility Check: FINISHED\n");
        log.write(
              "Eligibility checks for Gene Expression Atlas version 2.0.9.3: \n" +
              "1. Experiment has raw data for Affymetrix platforms or normalized data for all other platforms;\n" +
              "2. Array design(s) used in experiment are loaded into Atlas;\n" +
              "3. Type of experiment is from the list: \n" +
                  "transcription profiling by array,\n" +
                  "methylation profiling by array,\n" +
                  "tiling path by array,\n" +
                  "comparative genomic hybridization by array,\n" +
                  "microRNA profiling by array,\n" +
                  "RNAi profiling by array,\n" +
                  "ChIP-chip by array;\n" +
              "4. Experiments is not two-channel;\n" +
              "5. Experiment has factor values;\n" +
              "6. Factor types are from controlled vocabulary.");
        log.close();
      }
      catch (IOException e) {
        e.printStackTrace();
        ProcessExecutionException pex =  new ProcessExecutionException(exitValue,
                e.getMessage());
        String[] errors = new String[1];
        errors[0] = e.getMessage();
        pex.setProcessOutput(errors);
        throw pex;
      }
    }
    ProcessExecutionException pex =  new ProcessExecutionException(exitValue,"Something wrong in the code ");
    if (exitValue == 0) {
      return true;
    }
    else {
      String[] errors = new String[1];
      errors[0] = "Something wrong in the code ";
      pex.setProcessOutput(errors);
      throw pex;
    }
  }


Input:
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_activity_details);
		Intent intent = getIntent();
		String from = intent.getStringExtra(C.DETAILS_FROM);
		Button continueButton = (Button) findViewById(R.id.details_continue_button);
		if (null == from){
			continueButton.setVisibility(View.GONE);
		}
		else{
			continueButton.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					manageProject();
				}
			});
		}
		long activityId = intent.getLongExtra("activityId", -1);
		UserActivitiesTableHelper helper = new UserActivitiesTableHelper(this);
		Cursor activity = helper.getUserActivity(activityId);
		if (activity.moveToFirst()){
			TextView type = (TextView) findViewById(R.id.details_type);
			type.setText(activity.getString(activity.getColumnIndex(ActivitiesTableHelper.COLUMN_ACTIVITY)));
			TextView durationTextView = (TextView) findViewById(R.id.details__duration);
			long duration = activity.getLong(activity.getColumnIndex(UserActivitiesTableHelper.COLUMN_DURATION));
			String durationStr = String.format(" %02d:%02d'%d\"",
					TimeUnit.MILLISECONDS.toHours(duration),
				    TimeUnit.MILLISECONDS.toMinutes(duration) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(duration)),
				    TimeUnit.MILLISECONDS.toSeconds(duration) - TimeUnit.HOURS.toSeconds(TimeUnit.MILLISECONDS.toHours(duration)) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration))
			);
			durationTextView.setText(durationStr);
			TextView dateTextView = (TextView) findViewById(R.id.details_date);
			long datetime = activity.getLong(activity.getColumnIndex(UserActivitiesTableHelper.COLUMN_DATETIME));
			Date date = new Date(datetime);
			DateFormat formatter = new SimpleDateFormat(" MM/dd/yyyy 'at' HH:mm");
			String dateFormatted = formatter.format(date);
			dateTextView.setText(dateFormatted);
			int[] base = {
					activity.getInt(activity.getColumnIndex(ActivitiesTableHelper.COLUMN_W1)),
					activity.getInt(activity.getColumnIndex(ActivitiesTableHelper.COLUMN_W2)),
					activity.getInt(activity.getColumnIndex(ActivitiesTableHelper.COLUMN_W3)),
					activity.getInt(activity.getColumnIndex(ActivitiesTableHelper.COLUMN_W4))
			};
			SharedPreferences prefs = getSharedPreferences(C.PREF, MODE_PRIVATE);
			int weight = prefs.getInt(C.P_WEIGHT, 0);
			int calories = CaloriesHelper.getCalories(weight, base, duration);
			TextView caloriesTextView = (TextView) findViewById(R.id.details_calories);
			caloriesTextView.setText(String.valueOf(calories));
		}
	}

Output:
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_activity_details);
		Intent intent = getIntent();
		String from = intent.getStringExtra(C.DETAILS_FROM);
		Button continueButton = (Button) findViewById(R.id.details_continue_button);
		if (null == from){
			continueButton.setVisibility(View.GONE);
		}
		else{
			continueButton.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					manageProject();
				}
			});
		}
		long activityId = intent.getLongExtra("activityId", -1);
		UserActivitiesTableHelper helper = new UserActivitiesTableHelper(this);
		Cursor activity = helper.getUserActivity(activityId);
		if (activity.moveToFirst()){
			TextView type = (TextView) findViewById(R.id.details_type);
			type.setText(activity.getString(activity.getColumnIndex(ActivitiesTableHelper.COLUMN_ACTIVITY)));
			TextView durationTextView = (TextView) findViewById(R.id.details__duration);
			long duration = activity.getLong(activity.getColumnIndex(UserActivitiesTableHelper.COLUMN_DURATION));
			String durationStr = String.format(" %02d:%02d'%d\"",
					TimeUnit.MILLISECONDS.toHours(duration),
				    TimeUnit.MILLISECONDS.toMinutes(duration) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(duration)),
				    TimeUnit.MILLISECONDS.toSeconds(duration) - TimeUnit.HOURS.toSeconds(TimeUnit.MILLISECONDS.toHours(duration)) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration))
			);
			durationTextView.setText(durationStr);
			TextView dateTextView = (TextView) findViewById(R.id.details_date);
			long datetime = activity.getLong(activity.getColumnIndex(UserActivitiesTableHelper.COLUMN_DATETIME));
			Date date = new Date(datetime);
			DateFormat formatter = new SimpleDateFormat(" MM/dd/yyyy 'at' HH:mm");
			String dateFormatted = formatter.format(date);
			dateTextView.setText(dateFormatted);
			int[] base = {
					activity.getInt(activity.getColumnIndex(ActivitiesTableHelper.COLUMN_W1)),
					activity.getInt(activity.getColumnIndex(ActivitiesTableHelper.COLUMN_W2)),
					activity.getInt(activity.getColumnIndex(ActivitiesTableHelper.COLUMN_W3)),
					activity.getInt(activity.getColumnIndex(ActivitiesTableHelper.COLUMN_W4))
			};
			SharedPreferences prefs = getSharedPreferences(C.PREF, MODE_PRIVATE);
			int weight = prefs.getInt(C.P_WEIGHT, 50);
			int calories = CaloriesHelper.getCalories(weight, base, duration);
			TextView caloriesTextView = (TextView) findViewById(R.id.details_calories);
			caloriesTextView.setText(String.valueOf(calories));
		}
	}


Input:
	private String convert_hyp_2_string(int sent_id, DerivationState cur, ArrayList<FeatureFunction> l_models, String str_hyp_numeric,
			boolean extract_nbest_tree, boolean add_combined_score, double[] model_cost){
		String[] tem = str_hyp_numeric.split("\\s+");
		StringBuffer str_hyp =new StringBuffer();
		if(sent_id>=0){
			str_hyp.append(sent_id);
			str_hyp.append(" ||| ");
		}
		for(int t=0; t<tem.length; t++){
			tem[t] = tem[t].trim();
			if(extract_nbest_tree==true && ( tem[t].startsWith("(") || tem[t].endsWith(")"))){
				if(tem[t].startsWith("(")==true){
					String tag = this.p_symbolTable.getWord(new Integer(tem[t].substring(1)));
					str_hyp.append("(");
					str_hyp.append(tag);
				}else{
					int first_bracket_pos = tem[t].indexOf(")");
					String tag = this.p_symbolTable.getWord(new Integer(tem[t].substring(0,first_bracket_pos)));
					str_hyp.append(tag);
					str_hyp.append(tem[t].substring(first_bracket_pos));
				}
			}else{
				str_hyp.append(this.p_symbolTable.getWord(new Integer(tem[t])));
			}
			if(t<tem.length-1)
				str_hyp.append(" ");
		}
		if(model_cost!=null){
			str_hyp.append(" |||");
			double tem_sum=0.0;
			for(int k=0; k<model_cost.length; k++){
				str_hyp.append(String.format(" %.3f", -model_cost[k]));
				tem_sum += model_cost[k]*l_models.get(k).getWeight();
			}
			if (performSanityCheck) {
				if (Math.abs(cur.cost - tem_sum) > 1e-2) {
					System.out.println("In nbest extraction, Cost does not match; cur.cost: " + cur.cost + "; temsum: " +tem_sum);
					for (int k = 0; k < model_cost.length; k++) {
						System.out.println("model weight: " + l_models.get(k).getWeight() + "; cost: " +model_cost[k]);
					}
					System.exit(1);
				}
			}
		}
		if(add_combined_score==true)
			str_hyp.append(String.format(" ||| %.3f",-cur.cost));
		System.err.println(str_hyp.toString());
		return str_hyp.toString();
	}

Output:
	private String convert_hyp_2_string(int sent_id, DerivationState cur, ArrayList<FeatureFunction> l_models, String str_hyp_numeric,
			boolean extract_nbest_tree, boolean add_combined_score, double[] model_cost){
		String[] tem = str_hyp_numeric.split("\\s+");
		StringBuffer str_hyp =new StringBuffer();
		if(sent_id>=0){
			str_hyp.append(sent_id);
			str_hyp.append(" ||| ");
		}
		for(int t=0; t<tem.length; t++){
			tem[t] = tem[t].trim();
			if(extract_nbest_tree==true && ( tem[t].startsWith("(") || tem[t].endsWith(")"))){
				if(tem[t].startsWith("(")==true){
					String tag = this.p_symbolTable.getWord(new Integer(tem[t].substring(1)));
					str_hyp.append("(");
					str_hyp.append(tag);
				}else{
					int first_bracket_pos = tem[t].indexOf(")");
					String tag = this.p_symbolTable.getWord(new Integer(tem[t].substring(0,first_bracket_pos)));
					str_hyp.append(tag);
					str_hyp.append(tem[t].substring(first_bracket_pos));
				}
			}else{
				str_hyp.append(this.p_symbolTable.getWord(new Integer(tem[t])));
			}
			if(t<tem.length-1)
				str_hyp.append(" ");
		}
		if(model_cost!=null){
			str_hyp.append(" |||");
			double tem_sum=0.0;
			for(int k=0; k<model_cost.length; k++){
				str_hyp.append(String.format(" %.3f", -model_cost[k]));
				tem_sum += model_cost[k]*l_models.get(k).getWeight();
			}
			if (performSanityCheck) {
				if (Math.abs(cur.cost - tem_sum) > 1e-2) {
					System.out.println("In nbest extraction, Cost does not match; cur.cost: " + cur.cost + "; temsum: " +tem_sum);
					for (int k = 0; k < model_cost.length; k++) {
						System.out.println("model weight: " + l_models.get(k).getWeight() + "; cost: " +model_cost[k]);
					}
					System.exit(1);
				}
			}
		}
		if(add_combined_score==true)
			str_hyp.append(String.format(" ||| %.3f",-cur.cost));
		return str_hyp.toString();
	}


Input:
    public static void sendSelfDisguise(final Player player) {
        try {
            if (!player.isValid()) {
                return;
            }
            Object world = ReflectionManager.getWorld(player.getWorld());
            Object tracker = world.getClass().getField("tracker").get(world);
            Object trackedEntities = tracker.getClass().getField("trackedEntities").get(tracker);
            Object entityTrackerEntry = trackedEntities.getClass().getMethod("get", int.class)
                    .invoke(trackedEntities, player.getEntityId());
            if (entityTrackerEntry == null) {
                Bukkit.getScheduler().scheduleSyncDelayedTask(libsDisguises, new Runnable() {
                    public void run() {
                        sendSelfDisguise(player);
                    }
                });
                return;
            }
            ((HashSet) entityTrackerEntry.getClass().getField("trackedPlayers").get(entityTrackerEntry)).add(ReflectionManager
                    .getNmsEntity(player));
            ProtocolManager manager = ProtocolLibrary.getProtocolManager();
            manager.sendServerPacket(player, manager.createPacketConstructor(PacketType.Play.Server.NAMED_ENTITY_SPAWN, player)
                    .createPacket(player));
            manager.sendServerPacket(
                    player,
                    manager.createPacketConstructor(PacketType.Play.Server.ENTITY_METADATA, player.getEntityId(),
                            WrappedDataWatcher.getEntityWatcher(player), true).createPacket(player.getEntityId(),
                            WrappedDataWatcher.getEntityWatcher(player), true));
            boolean isMoving = false;
            try {
                Field field = ReflectionManager.getNmsClass("EntityTrackerEntry").getDeclaredField("isMoving");
                field.setAccessible(true);
                isMoving = field.getBoolean(entityTrackerEntry);
            } catch (Exception ex) {
                ex.printStackTrace();
            }
            if (isMoving) {
                Vector velocity = player.getVelocity();
                manager.sendServerPacket(
                        player,
                        manager.createPacketConstructor(PacketType.Play.Server.ENTITY_VELOCITY, player.getEntityId(),
                                velocity.getX(), velocity.getY(), velocity.getZ()).createPacket(player.getEntityId(),
                                velocity.getX(), velocity.getY(), velocity.getZ()));
            }
            if (player.getVehicle() != null && player.getEntityId() > player.getVehicle().getEntityId()) {
                manager.sendServerPacket(player,
                        manager.createPacketConstructor(PacketType.Play.Server.ATTACH_ENTITY, 0, player, player.getVehicle())
                                .createPacket(0, player, player.getVehicle()));
            } else if (player.getPassenger() != null && player.getEntityId() > player.getPassenger().getEntityId()) {
                manager.sendServerPacket(player,
                        manager.createPacketConstructor(PacketType.Play.Server.ATTACH_ENTITY, 0, player.getPassenger(), player)
                                .createPacket(0, player.getPassenger(), player));
            }
            for (int i = 0; i < 5; i++) {
                ItemStack item;
                if (i == 0) {
                    item = player.getItemInHand();
                } else {
                    item = player.getInventory().getArmorContents()[i - 1];
                }
                if (item != null && item.getType() != Material.AIR) {
                    manager.sendServerPacket(
                            player,
                            manager.createPacketConstructor(PacketType.Play.Server.ENTITY_EQUIPMENT, player.getEntityId(), i,
                                    item).createPacket(player.getEntityId(), i, item));
                }
            }
            Location loc = player.getLocation();
            if (player.isSleeping()) {
                manager.sendServerPacket(
                        player,
                        manager.createPacketConstructor(PacketType.Play.Server.BED, player, loc.getBlockX(), loc.getBlockY(),
                                loc.getBlockZ()).createPacket(player, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
            }
            Iterator iterator = player.getActivePotionEffects().iterator();
            while (iterator.hasNext()) {
                PotionEffect potionEffect = (PotionEffect) iterator.next();
                manager.sendServerPacket(player,
                        manager.createPacketConstructor(PacketType.Play.Server.ENTITY_EFFECT, player.getEntityId(), potionEffect)
                                .createPacket(player.getEntityId(), potionEffect));
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

Output:
    public static void sendSelfDisguise(final Player player) {
        try {
            if (!player.isValid()) {
                return;
            }
            Object world = ReflectionManager.getWorld(player.getWorld());
            Object tracker = world.getClass().getField("tracker").get(world);
            Object trackedEntities = tracker.getClass().getField("trackedEntities").get(tracker);
            Object entityTrackerEntry = trackedEntities.getClass().getMethod("get", int.class)
                    .invoke(trackedEntities, player.getEntityId());
            if (entityTrackerEntry == null) {
                Bukkit.getScheduler().scheduleSyncDelayedTask(libsDisguises, new Runnable() {
                    public void run() {
                        sendSelfDisguise(player);
                    }
                });
                return;
            }
            int fakeId = selfDisguisesIds.get(player.getEntityId());
            ((HashSet) entityTrackerEntry.getClass().getField("trackedPlayers").get(entityTrackerEntry)).add(ReflectionManager
                    .getNmsEntity(player));
            ProtocolManager manager = ProtocolLibrary.getProtocolManager();
            manager.sendServerPacket(player, manager.createPacketConstructor(PacketType.Play.Server.NAMED_ENTITY_SPAWN, player)
                    .createPacket(player));
            manager.sendServerPacket(
                    player,
                    manager.createPacketConstructor(PacketType.Play.Server.ENTITY_METADATA, fakeId,
                            WrappedDataWatcher.getEntityWatcher(player), true).createPacket(fakeId,
                            WrappedDataWatcher.getEntityWatcher(player), true));
            boolean isMoving = false;
            try {
                Field field = ReflectionManager.getNmsClass("EntityTrackerEntry").getDeclaredField("isMoving");
                field.setAccessible(true);
                isMoving = field.getBoolean(entityTrackerEntry);
            } catch (Exception ex) {
                ex.printStackTrace();
            }
            if (isMoving) {
                Vector velocity = player.getVelocity();
                manager.sendServerPacket(
                        player,
                        manager.createPacketConstructor(PacketType.Play.Server.ENTITY_VELOCITY, fakeId, velocity.getX(),
                                velocity.getY(), velocity.getZ()).createPacket(fakeId, velocity.getX(), velocity.getY(),
                                velocity.getZ()));
            }
            if (player.getVehicle() != null && player.getEntityId() > player.getVehicle().getEntityId()) {
                manager.sendServerPacket(player,
                        manager.createPacketConstructor(PacketType.Play.Server.ATTACH_ENTITY, 0, player, player.getVehicle())
                                .createPacket(0, player, player.getVehicle()));
            } else if (player.getPassenger() != null && player.getEntityId() > player.getPassenger().getEntityId()) {
                manager.sendServerPacket(player,
                        manager.createPacketConstructor(PacketType.Play.Server.ATTACH_ENTITY, 0, player.getPassenger(), player)
                                .createPacket(0, player.getPassenger(), player));
            }
            for (int i = 0; i < 5; i++) {
                ItemStack item;
                if (i == 0) {
                    item = player.getItemInHand();
                } else {
                    item = player.getInventory().getArmorContents()[i - 1];
                }
                if (item != null && item.getType() != Material.AIR) {
                    manager.sendServerPacket(player,
                            manager.createPacketConstructor(PacketType.Play.Server.ENTITY_EQUIPMENT, fakeId, i, item)
                                    .createPacket(fakeId, i, item));
                }
            }
            Location loc = player.getLocation();
            if (player.isSleeping()) {
                manager.sendServerPacket(
                        player,
                        manager.createPacketConstructor(PacketType.Play.Server.BED, player, loc.getBlockX(), loc.getBlockY(),
                                loc.getBlockZ()).createPacket(player, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
            }
            Iterator iterator = player.getActivePotionEffects().iterator();
            while (iterator.hasNext()) {
                PotionEffect potionEffect = (PotionEffect) iterator.next();
                manager.sendServerPacket(
                        player,
                        manager.createPacketConstructor(PacketType.Play.Server.ENTITY_EFFECT, fakeId, potionEffect).createPacket(
                                fakeId, potionEffect));
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }


Input:
    public KDTreeCell(Integer dimensions, Integer depth,
            ArrayList<ArrayList<Float[]>> points) throws KDTreeCellException {
        if (dimensions <= 0)
            throw new KDTreeCellWrongCreationArgumentException();
        if (depth < 0)
            throw new KDTreeCellWrongCreationArgumentException();
        if (points.size() != dimensions)
            throw new KDTreeCellWrongCreationArgumentException();
        this.dimensions = dimensions;
        this.splitDimension = depth % dimensions;
        this.depth = depth;
        if (points != null) {
            if (points.get(0).size() > 2) {
                ArrayList<ArrayList<Float[]>> leftPoints = new ArrayList<ArrayList<Float[]>>();
                ArrayList<ArrayList<Float[]>> rightPoints = new ArrayList<ArrayList<Float[]>>();
                ArrayList<Float[]> master = points.get(this.splitDimension);
                Integer medianID = master.size()/2;
                while (medianID >= 0 &&
                        master.get(medianID)[this.splitDimension] == master.get(medianID-1)[this.splitDimension] )
                    medianID--;
                Float[] median = master.get(medianID);
                this.point = new Float[this.dimensions];
                this.point = Arrays.copyOf(median, median.length);
                master.remove(median);
                for (int i = 0; i < this.dimensions; i++) {
                    ArrayList<Float[]> left = new ArrayList<Float[]>();
                    ArrayList<Float[]> right = new ArrayList<Float[]>();
                    if (i == this.splitDimension) {
                        left.addAll(master.subList(0, medianID));
                        right.addAll(master.subList(medianID, master.size()));
                    } else {
                        ArrayList<Float[]> slave = points.get(i);
                        for (Iterator<Float[]> it = slave.iterator(); it.hasNext();) {
                            Float[] v = it.next();
                            Integer j = -1;
                            Float[] foundMedian = null;
                            while (++j < this.dimensions) {
                                if (v[j] != median[j]) continue;
                                else if (j == this.dimensions-1)
                                    foundMedian = v;
                            }
                            if (foundMedian != null) {
                                it.remove();
                                continue;
                            } else if (v[this.splitDimension] < median[this.splitDimension])
                                left.add(v);
                            else right.add(v);
                        }
                    }
                    leftPoints.add(left);
                    rightPoints.add(right);
                }
                this.children = new KDTreeCell[2];
                this.children[0] = new KDTreeCell(dimensions, depth+1, leftPoints);
                this.children[1] = new KDTreeCell(dimensions, depth+1, rightPoints);
            } else switch (points.get(0).size()) {
                case 2:
                    ArrayList<ArrayList<Float[]>> leftPoints = new ArrayList<ArrayList<Float[]>>();
                    ArrayList<ArrayList<Float[]>> rightPoints = new ArrayList<ArrayList<Float[]>>();
                    for (int i = 0; i < this.dimensions; i++) {
                        ArrayList<Float[]> temp = new ArrayList<Float[]>();
                        temp.add(points.get(0).get(0));
                        leftPoints.add(temp);
                        rightPoints.add(temp);
                    }
                    this.children = new KDTreeCell[2];
                    this.children[0] = new KDTreeCell(dimensions, depth+1, leftPoints);
                    this.children[1] = new KDTreeCell(dimensions, depth+1, rightPoints);
                    break;
                case 1:
                    this.point = new Float[this.dimensions];
                    Float[] leafPoint = points.get(0).get(0);
                    this.point = Arrays.copyOf(leafPoint, leafPoint.length);
                    this.children = null;
                    break;
                case 0:
                    this.children = null;
                    this.point = null;
                    break;
            }
        } else {
            this.children = null;
            this.point = null;
        }
    }

Output:
    public KDTreeCell(Integer dimensions, Integer depth,
            ArrayList<ArrayList<Float[]>> points) throws KDTreeCellException {
        if (dimensions <= 0)
            throw new KDTreeCellWrongCreationArgumentException();
        if (depth < 0)
            throw new KDTreeCellWrongCreationArgumentException();
        if (points.size() != dimensions)
            throw new KDTreeCellWrongCreationArgumentException();
        this.dimensions = dimensions;
        this.splitDimension = depth % dimensions;
        this.depth = depth;
        if (points != null) {
            if (points.get(0).size() > 2) {
                ArrayList<ArrayList<Float[]>> leftPoints = new ArrayList<ArrayList<Float[]>>();
                ArrayList<ArrayList<Float[]>> rightPoints = new ArrayList<ArrayList<Float[]>>();
                ArrayList<Float[]> master = points.get(this.splitDimension);
                Integer medianID = master.size()/2;
                while (medianID > 0) {
                    if (master.get(medianID-1)[this.splitDimension] >= master.get(medianID)[this.splitDimension]) medianID--;
                    else break;
                }
                Float[] median = master.get(medianID);
                this.point = new Float[this.dimensions];
                this.point = Arrays.copyOf(median, median.length);
                master.remove(median);
                for (int i = 0; i < this.dimensions; i++) {
                    ArrayList<Float[]> left = new ArrayList<Float[]>();
                    ArrayList<Float[]> right = new ArrayList<Float[]>();
                    if (i == this.splitDimension) {
                        left.addAll(master.subList(0, medianID));
                        right.addAll(master.subList(medianID, master.size()));
                    } else {
                        ArrayList<Float[]> slave = points.get(i);
                        for (Iterator<Float[]> it = slave.iterator(); it.hasNext();) {
                            Float[] v = it.next();
                            Integer j = -1;
                            Float[] foundMedian = null;
                            while (++j < this.dimensions) {
                                if (v[j] != median[j]) continue;
                                if (j == this.dimensions-1)
                                    foundMedian = v;
                            }
                            if (foundMedian != null) {
                                it.remove();
                                continue;
                            } else if (v[this.splitDimension] < median[this.splitDimension])
                                left.add(v);
                            else right.add(v);
                        }
                    }
                    leftPoints.add(left);
                    rightPoints.add(right);
                }
                this.children = new KDTreeCell[2];
                this.children[0] = new KDTreeCell(dimensions, depth+1, leftPoints);
                this.children[1] = new KDTreeCell(dimensions, depth+1, rightPoints);
            } else switch (points.get(0).size()) {
                case 2:
                    ArrayList<ArrayList<Float[]>> leftPoints = new ArrayList<ArrayList<Float[]>>();
                    ArrayList<ArrayList<Float[]>> rightPoints = new ArrayList<ArrayList<Float[]>>();
                    for (int i = 0; i < this.dimensions; i++) {
                        ArrayList<Float[]> temp = new ArrayList<Float[]>();
                        temp.add(points.get(0).get(0));
                        leftPoints.add(temp);
                        rightPoints.add(temp);
                    }
                    this.children = new KDTreeCell[2];
                    this.children[0] = new KDTreeCell(dimensions, depth+1, leftPoints);
                    this.children[1] = new KDTreeCell(dimensions, depth+1, rightPoints);
                    break;
                case 1:
                    Float[] leafPoint = points.get(0).get(0);
                    this.point = Arrays.copyOf(leafPoint, leafPoint.length);
                    this.children = null;
                    break;
                case 0:
                    this.children = null;
                    this.point = null;
                    break;
            }
        } else {
            this.children = null;
            this.point = null;
        }
    }


Input:
		void amqp() throws Throwable {
			final PushQueue dev_queue = Push.queue("push.p12", "pusubi", false,
					1);
			dev_queue.start();
			final PushQueue prod_queue = Push.queue("pushprod.p12", "pusubi",
					true, 1);
			prod_queue.start();
			for (;;) {
				ConnectionFactory connectionFactory = new ConnectionFactory();
				connectionFactory.setHost("bumblebee.musubi.us");
				connectionFactory.setConnectionTimeout(30 * 1000);
				connectionFactory.setRequestedHeartbeat(30);
				Connection connection = connectionFactory.newConnection();
				mIncomingChannel = connection.createChannel();
				mConsumer = new DefaultConsumer(mIncomingChannel) {
					@Override
					public void handleDelivery(final String consumerTag,
							final Envelope envelope,
							final BasicProperties properties, final byte[] body)
							throws IOException {
						HashSet<String> threadDevices = new HashSet<String>();
						synchronized (mNotifiers) {
							String identity = mConsumers.get(consumerTag);
							if (identity == null)
								return;
							HashSet<String> devices = mNotifiers.get(identity);
							if (devices == null)
								return;
							threadDevices.addAll(devices);
						}
						Message m = null;
						try {
							m = mMapper.readValue(body, Message.class);
						} catch (IOException e) {
							new RuntimeException(
									"Failed to parse BSON of outer message", e)
									.printStackTrace();
							return;
						}
						if (m.l)
							return;
						String sender_exchange;
						try {
							sender_exchange = encodeAMQPname("ibeidentity-",
									new IBHashedIdentity(m.s.i).at(0).identity_);
						} catch (CorruptIdentity e) {
							e.printStackTrace();
							return;
						}
						Date now = new Date();
						for (String device : threadDevices) {
							Listener l;
							synchronized (mNotifiers) {
								l = mListeners.get(device);
							}
							if (l.identityExchanges.contains(sender_exchange))
								continue;
							int new_value = 0;
							int amqp = 0;
							int local = 0;
							Date last;
							synchronized (mCounts) {
								BadgeData bd = mCounts.get(device);
								if (bd == null) {
									bd = new BadgeData();
									mCounts.put(device, bd);
								}
								bd.amqp++;
								amqp = bd.amqp;
								local = bd.local;
								new_value = bd.amqp + bd.local;
								last = bd.last;
								if (bd.last == null) {
									bd.last = now;
								} else if (bd.last != null
										&& now.getTime() - bd.last.getTime() > 3 * 60 * 1000) {
									bd.last = now;
									last = null;
								}
							}
							if (l.platform.equals("android")) {
								com.google.android.gcm.server.Message message = new com.google.android.gcm.server.Message.Builder()
										.addData("amqp", Integer.toString(amqp))
										.build();
								mGooglePushes.add(Pair.of(message, device));
							} else {
								try {
									boolean production = l.production != null
											&& l.production != false;
									PushNotificationPayload payload = PushNotificationPayload
											.complex();
									try {
										if (last == null) {
											payload.addAlert("New message");
											payload.addSound("default");
										}
										payload.addBadge(new_value);
										payload.addCustomDictionary("local",
												local);
										payload.addCustomDictionary("amqp",
												amqp);
									} catch (JSONException e) {
										e.printStackTrace();
										System.exit(1);
									}
									if (!production)
										dev_queue.add(payload, device);
									else
										prod_queue.add(payload, device);
								} catch (InvalidDeviceTokenFormatException e) {
									e.printStackTrace();
								}
							}
						}
					}
				};
				System.out.println("doing registrations");
				Set<String> notifiers = new HashSet<String>();
				synchronized (mNotifiers) {
					notifiers.addAll(mNotifiers.keySet());
				}
				for (String identity : notifiers) {
					DeclareOk x = mIncomingChannel.queueDeclare();
					System.out.println("listening " + identity);
					mIncomingChannel.exchangeDeclare(identity, "fanout", true);
					mIncomingChannel.queueBind(x.getQueue(), identity, "");
					String consumerTag = mIncomingChannel.basicConsume(
							x.getQueue(), true, mConsumer);
					synchronized (mNotifiers) {
						mQueues.put(identity, x.getQueue());
						mConsumers.put(consumerTag, identity);
					}
				}
				System.out.println("done registrations");
				long last = new Date().getTime();
				for (;;) {
					Runnable job = mJobs.poll(60, TimeUnit.SECONDS);
					long current = new Date().getTime();
					if (current - last > 60 * 1000) {
						PushedNotifications ps = dev_queue
								.getPushedNotifications();
						for (PushedNotification p : ps) {
							if (p.isSuccessful())
								continue;
							String invalidToken = p.getDevice().getToken();
							System.err.println("unregistering invalid token "
									+ invalidToken);
							unregister(invalidToken);
							Exception theProblem = p.getException();
							theProblem.printStackTrace();
							ResponsePacket theErrorResponse = p.getResponse();
							if (theErrorResponse != null) {
								System.out.println(theErrorResponse
										.getMessage());
							}
						}
						last = new Date().getTime();
						List<Device> inactiveDevices = Push.feedback(
								"push.p12", "pusubi", false);
						for (Device d : inactiveDevices) {
							String invalidToken = d.getToken();
							System.err
									.println("unregistering feedback failed token token "
											+ invalidToken);
							unregister(invalidToken);
						}
					}
					if (job == null)
						continue;
					job.run();
				}
			}
		}

Output:
		void amqp() throws Throwable {
			final PushQueue dev_queue = Push.queue("push.p12", "pusubi", false,
					1);
			dev_queue.start();
			final PushQueue prod_queue = Push.queue("pushprod.p12", "pusubi",
					true, 1);
			prod_queue.start();
			for (;;) {
				ConnectionFactory connectionFactory = new ConnectionFactory();
				connectionFactory.setHost("bumblebee.musubi.us");
				connectionFactory.setConnectionTimeout(30 * 1000);
				connectionFactory.setRequestedHeartbeat(30);
				Connection connection = connectionFactory.newConnection();
				mIncomingChannel = connection.createChannel();
				mConsumer = new DefaultConsumer(mIncomingChannel) {
					@Override
					public void handleDelivery(final String consumerTag,
							final Envelope envelope,
							final BasicProperties properties, final byte[] body)
							throws IOException {
						HashSet<String> threadDevices = new HashSet<String>();
						synchronized (mNotifiers) {
							String identity = mConsumers.get(consumerTag);
							if (identity == null)
								return;
							HashSet<String> devices = mNotifiers.get(identity);
							if (devices == null)
								return;
							threadDevices.addAll(devices);
						}
						Message m = null;
						try {
							m = mMapper.readValue(body, Message.class);
						} catch (IOException e) {
							new RuntimeException(
									"Failed to parse BSON of outer message", e)
									.printStackTrace();
							return;
						}
						if (m.l)
							return;
						String sender_exchange;
						try {
							sender_exchange = encodeAMQPname("ibeidentity-",
									new IBHashedIdentity(m.s.i).at(0).identity_);
						} catch (CorruptIdentity e) {
							e.printStackTrace();
							return;
						}
						Date now = new Date();
						for (String device : threadDevices) {
							Listener l;
							synchronized (mNotifiers) {
								l = mListeners.get(device);
							}
							if (l.identityExchanges.contains(sender_exchange))
								continue;
							int new_value = 0;
							int amqp = 0;
							int local = 0;
							Date last;
							synchronized (mCounts) {
								BadgeData bd = mCounts.get(device);
								if (bd == null) {
									bd = new BadgeData();
									mCounts.put(device, bd);
								}
								bd.amqp++;
								amqp = bd.amqp;
								local = bd.local;
								new_value = bd.amqp + bd.local;
								last = bd.last;
								if (bd.last == null) {
									bd.last = now;
								} else if (bd.last != null
										&& now.getTime() - bd.last.getTime() > 3 * 60 * 1000) {
									bd.last = now;
									last = null;
								}
							}
							if (l.platform != null && l.platform.equals("android")) {
								com.google.android.gcm.server.Message message = new com.google.android.gcm.server.Message.Builder()
										.addData("amqp", Integer.toString(amqp))
										.build();
								mGooglePushes.add(Pair.of(message, device));
							} else {
								try {
									boolean production = l.production != null
											&& l.production != false;
									PushNotificationPayload payload = PushNotificationPayload
											.complex();
									try {
										if (last == null) {
											payload.addAlert("New message");
											payload.addSound("default");
										}
										payload.addBadge(new_value);
										payload.addCustomDictionary("local",
												local);
										payload.addCustomDictionary("amqp",
												amqp);
									} catch (JSONException e) {
										e.printStackTrace();
										System.exit(1);
									}
									if (!production)
										dev_queue.add(payload, device);
									else
										prod_queue.add(payload, device);
								} catch (InvalidDeviceTokenFormatException e) {
									e.printStackTrace();
								}
							}
						}
					}
				};
				System.out.println("doing registrations");
				Set<String> notifiers = new HashSet<String>();
				synchronized (mNotifiers) {
					notifiers.addAll(mNotifiers.keySet());
				}
				for (String identity : notifiers) {
					DeclareOk x = mIncomingChannel.queueDeclare();
					System.out.println("listening " + identity);
					mIncomingChannel.exchangeDeclare(identity, "fanout", true);
					mIncomingChannel.queueBind(x.getQueue(), identity, "");
					String consumerTag = mIncomingChannel.basicConsume(
							x.getQueue(), true, mConsumer);
					synchronized (mNotifiers) {
						mQueues.put(identity, x.getQueue());
						mConsumers.put(consumerTag, identity);
					}
				}
				System.out.println("done registrations");
				long last = new Date().getTime();
				for (;;) {
					Runnable job = mJobs.poll(60, TimeUnit.SECONDS);
					long current = new Date().getTime();
					if (current - last > 60 * 1000) {
						PushedNotifications ps = dev_queue
								.getPushedNotifications();
						for (PushedNotification p : ps) {
							if (p.isSuccessful())
								continue;
							String invalidToken = p.getDevice().getToken();
							System.err.println("unregistering invalid token "
									+ invalidToken);
							unregister(invalidToken);
							Exception theProblem = p.getException();
							theProblem.printStackTrace();
							ResponsePacket theErrorResponse = p.getResponse();
							if (theErrorResponse != null) {
								System.out.println(theErrorResponse
										.getMessage());
							}
						}
						last = new Date().getTime();
						List<Device> inactiveDevices = Push.feedback(
								"push.p12", "pusubi", false);
						for (Device d : inactiveDevices) {
							String invalidToken = d.getToken();
							System.err
									.println("unregistering feedback failed token token "
											+ invalidToken);
							unregister(invalidToken);
						}
					}
					if (job == null)
						continue;
					job.run();
				}
			}
		}


Input:
	public Change createChange(IProgressMonitor pm) throws CoreException {
		if (fMethodName == null)
			return null;
		pm.beginTask("", 2);
		try {
			ChangeRecorder cr = new ChangeRecorder(fRoot);
			Node[] nodes = fAnalyzer.getSelectedNodes();
			boolean isExpr = fAnalyzer.isExpressionSelected();
			Map<String,String> renamings = new HashMap<String,String>();
			for (ParameterInfo parameter : fParameterInfos)
				if (parameter.isRenamed())
					renamings.put(parameter.getOldName(),parameter.getNewName());
			for (Node node : nodes) {
				List<Identifier> oldNames = VariableLookup.findReferences(node, renamings.keySet());
				for (Identifier ref : oldNames) {
					ref.setName(renamings.get(ref.getName()));
				}
			}
			CallExpression invocation= DomFactory.eINSTANCE.createCallExpression();
			{
				VariableReference ref = DomFactory.eINSTANCE.createVariableReference();
				Identifier id = DomFactory.eINSTANCE.createIdentifier();
				id.setName(fMethodName);
				ref.setVariable(id);
				invocation.setApplicant(ref);
			}
			for (ParameterInfo parameter : fParameterInfos) {
				Identifier name = DomFactory.eINSTANCE.createIdentifier();
				name.setName(parameter.getOldName());
				VariableReference local = DomFactory.eINSTANCE.createVariableReference();
				local.setVariable(name);
				invocation.getArguments().add(local);
			}
			if (isExpr) {
				EReference ref = nodes[0].eContainmentFeature();
				if (ref.isMany()) {
					EList<Expression> exprList = (EList<Expression>)nodes[0].eContainer().eGet(ref);
					exprList.set(exprList.lastIndexOf(nodes[0]), (Expression)invocation);
				} else {
					nodes[0].eContainer().eSet(ref, invocation);
				}
			} else {
				Node call;
				int returnKind= fAnalyzer.getReturnKind();
				switch (returnKind) {
				case ExtractMethodAnalyzer.ACCESS_TO_LOCAL:
					VariableBinding binding= fAnalyzer.getReturnLocal();
					if (binding != null) {
						call = createDeclaration(binding, invocation);
					} else {
						BinaryExpression assignment= DomFactory.eINSTANCE.createBinaryExpression();
						assignment.setOperation(BinaryOperator.ASSIGN);
						VariableReference retVar = DomFactory.eINSTANCE.createVariableReference();
						Identifier id = DomFactory.eINSTANCE.createIdentifier();
						id.setName(fAnalyzer.getReturnValue().getName());
						retVar.setVariable(id);
						assignment.setLeft(retVar);
						assignment.setRight(invocation);
						call = assignment;
					}
					break;
				case ExtractMethodAnalyzer.RETURN_STATEMENT_VALUE:
					ReturnStatement rs=DomFactory.eINSTANCE.createReturnStatement();
					rs.setExpression(invocation);
					call = rs;
					break;
				default:
					call = invocation;
				}
				if (call instanceof Expression) {
					ExpressionStatement stmt = DomFactory.eINSTANCE.createExpressionStatement();
					stmt.setExpression((Expression)call);
					call = stmt;
				}
				List<Statement> callNodes= new ArrayList<Statement>(2);
				callNodes.add((Statement)call);
				if (returnKind == ExtractMethodAnalyzer.RETURN_STATEMENT_VOID && !fAnalyzer.isLastStatementSelected()) {
					callNodes.add(DomFactory.eINSTANCE.createReturnStatement());
				}
				for (VariableBinding local : fAnalyzer.getCallerLocals())
					callNodes.add(createDeclaration(local, null));
				EReference ref = nodes[0].eContainmentFeature();
				if (ref.isMany()) {
					EList<Statement> list = (EList<Statement>)nodes[0].eContainer().eGet(ref);
					int index = list.lastIndexOf(nodes[0]);
					for(int i=nodes.length-1;i>=0;i--)
						list.remove(index+i);
					list.addAll(index, callNodes);
				} else if (callNodes.size() == 1) {
					nodes[0].eContainer().eSet(ref, callNodes.get(0));
				} else {
					BlockStatement block = DomFactory.eINSTANCE.createBlockStatement();
					block.getStatements().addAll(callNodes);
					nodes[0].eContainer().eSet(ref, block);
				}
			}
			FunctionExpression mm = createNewMethodDeclaration();
			List<Statement> statements = mm.getBody().getStatements();
			VariableBinding[] methodLocals= fAnalyzer.getMethodLocals();
			for (int i= 0; i < methodLocals.length; i++) {
				if (methodLocals[i] != null)
					statements.add(createDeclaration(methodLocals[i],null));
			}
			if (isExpr) {
				ReturnStatement rs = DomFactory.eINSTANCE.createReturnStatement();
				rs.setExpression((Expression)nodes[0]);
				statements.add(rs);
			} else {
				for(Node node : nodes)
					statements.add((Statement)node);
				VariableBinding returnValue= fAnalyzer.getReturnValue();
				if (returnValue != null) {
					ReturnStatement rs = DomFactory.eINSTANCE.createReturnStatement();
					VariableReference ret = DomFactory.eINSTANCE.createVariableReference();
					Identifier rid = DomFactory.eINSTANCE.createIdentifier();
					String name = returnValue.getName();
					if (renamings.containsKey(name))
						name = renamings.get(name);
					rid.setName(name);
					ret.setVariable(rid);
					rs.setExpression(ret);
					statements.add(rs);
				}
			}
			ExpressionStatement stmt = DomFactory.eINSTANCE.createExpressionStatement();
			stmt.setExpression(mm);
			Node enclosing = fDestination;
			EReference ref = enclosing.eContainmentFeature();
			assert ref.isMany();
			EList<Statement> list = (EList<Statement>)enclosing.eContainer().eGet(ref);
			list.add(list.lastIndexOf(enclosing),stmt);
			ChangeDescription cd = cr.endRecording();
			RewriteAnalyzer ra = new RewriteAnalyzer(cd, fSource);
			SourceModuleChange result= new SourceModuleChange(RefactoringCoreMessages.ExtractMethodRefactoring_change_name, fCUnit);
			ra.rewrite(fRoot);
			result.setSaveMode(TextFileChange.KEEP_SAVE_STATE);
			result.setDescriptor(new RefactoringChangeDescriptor(getRefactoringDescriptor()));
			result.setEdit(ra.getEdit());
			cd.apply();
			return result;
		} finally {
			pm.done();
		}
	}

Output:
	public Change createChange(IProgressMonitor pm) throws CoreException {
		if (fMethodName == null)
			return null;
		pm.beginTask("", 2);
		try {
			ChangeRecorder cr = new ChangeRecorder(fRoot);
			Node[] nodes = fAnalyzer.getSelectedNodes();
			boolean isExpr = fAnalyzer.isExpressionSelected();
			Map<String,String> renamings = new HashMap<String,String>();
			for (ParameterInfo parameter : fParameterInfos)
				if (parameter.isRenamed())
					renamings.put(parameter.getOldName(),parameter.getNewName());
			for (Node node : nodes) {
				List<Identifier> oldNames = VariableLookup.findReferences(node, renamings.keySet());
				for (Identifier ref : oldNames) {
					ref.setName(renamings.get(ref.getName()));
				}
			}
			CallExpression invocation= DomFactory.eINSTANCE.createCallExpression();
			{
				VariableReference ref = DomFactory.eINSTANCE.createVariableReference();
				Identifier id = DomFactory.eINSTANCE.createIdentifier();
				id.setName(fMethodName);
				ref.setVariable(id);
				invocation.setApplicant(ref);
			}
			for (ParameterInfo parameter : fParameterInfos) {
				Identifier name = DomFactory.eINSTANCE.createIdentifier();
				name.setName(parameter.getOldName());
				VariableReference local = DomFactory.eINSTANCE.createVariableReference();
				local.setVariable(name);
				invocation.getArguments().add(local);
			}
			if (isExpr) {
				EReference ref = nodes[0].eContainmentFeature();
				if (ref.isMany()) {
					EList<Expression> exprList = (EList<Expression>)nodes[0].eContainer().eGet(ref);
					exprList.set(exprList.lastIndexOf(nodes[0]), (Expression)invocation);
				} else {
					nodes[0].eContainer().eSet(ref, invocation);
				}
			} else {
				Node call;
				int returnKind= fAnalyzer.getReturnKind();
				switch (returnKind) {
				case ExtractMethodAnalyzer.ACCESS_TO_LOCAL:
					VariableBinding binding= fAnalyzer.getReturnLocal();
					if (binding != null) {
						call = createDeclaration(binding, invocation);
					} else {
						BinaryExpression assignment= DomFactory.eINSTANCE.createBinaryExpression();
						assignment.setOperation(BinaryOperator.ASSIGN);
						VariableReference retVar = DomFactory.eINSTANCE.createVariableReference();
						Identifier id = DomFactory.eINSTANCE.createIdentifier();
						id.setName(fAnalyzer.getReturnValue().getName());
						retVar.setVariable(id);
						assignment.setLeft(retVar);
						assignment.setRight(invocation);
						call = assignment;
					}
					break;
				case ExtractMethodAnalyzer.RETURN_STATEMENT_VALUE:
					ReturnStatement rs=DomFactory.eINSTANCE.createReturnStatement();
					rs.setExpression(invocation);
					call = rs;
					break;
				default:
					call = invocation;
				}
				if (call instanceof Expression) {
					ExpressionStatement stmt = DomFactory.eINSTANCE.createExpressionStatement();
					stmt.setExpression((Expression)call);
					call = stmt;
				}
				List<Statement> callNodes= new ArrayList<Statement>(2);
				callNodes.add((Statement)call);
				if (returnKind == ExtractMethodAnalyzer.RETURN_STATEMENT_VOID && !fAnalyzer.isLastStatementSelected()) {
					callNodes.add(DomFactory.eINSTANCE.createReturnStatement());
				}
				for (VariableBinding local : fAnalyzer.getCallerLocals())
					callNodes.add(createDeclaration(local, null));
				EReference ref = nodes[0].eContainmentFeature();
				if (ref.isMany()) {
					EList<Statement> list = (EList<Statement>)nodes[0].eContainer().eGet(ref);
					int index = list.lastIndexOf(nodes[0]);
					for(int i=nodes.length-1;i>=0;i--)
						list.remove(index+i);
					list.addAll(index, callNodes);
				} else if (callNodes.size() == 1) {
					nodes[0].eContainer().eSet(ref, callNodes.get(0));
				} else {
					BlockStatement block = DomFactory.eINSTANCE.createBlockStatement();
					block.getStatements().addAll(callNodes);
					nodes[0].eContainer().eSet(ref, block);
				}
			}
			FunctionExpression mm = createNewMethodDeclaration();
			List<Statement> statements = mm.getBody().getStatements();
			VariableBinding[] methodLocals= fAnalyzer.getMethodLocals();
			for (int i= 0; i < methodLocals.length; i++) {
				if (methodLocals[i] != null)
					statements.add(createDeclaration(methodLocals[i],null));
			}
			if (isExpr) {
				ReturnStatement rs = DomFactory.eINSTANCE.createReturnStatement();
				rs.setExpression((Expression)nodes[0]);
				statements.add(rs);
			} else {
				for(Node node : nodes)
					statements.add((Statement)node);
				VariableBinding returnValue= fAnalyzer.getReturnValue();
				if (returnValue != null) {
					ReturnStatement rs = DomFactory.eINSTANCE.createReturnStatement();
					VariableReference ret = DomFactory.eINSTANCE.createVariableReference();
					Identifier rid = DomFactory.eINSTANCE.createIdentifier();
					String name = returnValue.getName();
					if (renamings.containsKey(name))
						name = renamings.get(name);
					rid.setName(name);
					ret.setVariable(rid);
					rs.setExpression(ret);
					statements.add(rs);
				}
			}
			ExpressionStatement stmt = DomFactory.eINSTANCE.createExpressionStatement();
			stmt.setExpression(mm);
			Node enclosing = fDestination;
			EReference ref = enclosing.eContainmentFeature();
			assert ref.isMany();
			EList<Statement> list = (EList<Statement>)enclosing.eContainer().eGet(ref);
			list.add(list.lastIndexOf(enclosing)+1,stmt);
			ChangeDescription cd = cr.endRecording();
			RewriteAnalyzer ra = new RewriteAnalyzer(cd, fSource);
			SourceModuleChange result= new SourceModuleChange(RefactoringCoreMessages.ExtractMethodRefactoring_change_name, fCUnit);
			ra.rewrite(fRoot);
			result.setSaveMode(TextFileChange.KEEP_SAVE_STATE);
			result.setDescriptor(new RefactoringChangeDescriptor(getRefactoringDescriptor()));
			result.setEdit(ra.getEdit());
			cd.apply();
			return result;
		} finally {
			pm.done();
		}
	}


Input:
    public static void main(String args[]) throws InterruptedException {
        if (args.length != 1) {
            System.err.println("Usage: java TestPingers hostname");
            System.exit(2);
        }
        ClientInfo this_client = new ClientInfo(ClientInfo.m_cookie_name+"={user=bobafett;uuid=fatalapouet};path=/;expires=eventually");
        if (this_client.getNickname() == null)
            this_client.setNickname("bobafett");
        InetAddress my_local_addr = this_client.getAddress();
        InetAddress my_global_addr = null;
        try {
            my_global_addr = this_client.getExternalAddress();
        }
        catch (RuntimeException e) {
            System.err.println("Warning: could not get external address.");
        }
        InetAddress target = null;
        try {
            target = InetAddress.getByName(args[0]);
        }
        catch (UnknownHostException e) {
            System.err.println("Error: could not get address for host '" + args[0] + "'.");
            System.exit(1);
        }
        if (target != null) {
            System.out.println("\nStarting pings...");
            TcpPinger this_tcp_pinger = new TcpPinger(this_client);
            IcmpPinger this_pinger = new IcmpPinger(this_client);
            TraceRouter this_router = new TraceRouter(this_client);
            String text_local_addr = my_local_addr.toString().split("/")[1];
            String text_global_addr;
            if (my_global_addr != null)
                text_global_addr = my_global_addr.toString().split("/")[1];
            else
                text_global_addr = "<unknown>";
            this_pinger.ping(target);
            System.out.println(text_local_addr + " " +
                               text_global_addr + " " +
                               this_pinger.getLastPings());
            this_router.trace(target);
            System.out.println(text_local_addr + " " +
                               text_global_addr + " " +
                               this_router.getLastTrace());
            this_tcp_pinger.ping(target,50);
            System.out.println(text_local_addr + " " +
                               text_global_addr + " " +
                               this_tcp_pinger.getLastPings());
        }
        System.out.println(this_client.getPreferences());
    }

Output:
    public static void main(String args[]) throws InterruptedException {
        if (args.length != 1) {
            System.err.println("Usage: java TestPingers hostname");
            System.exit(2);
        }
        ClientInfo this_client = new ClientInfo(ClientInfo.m_cookie_name+"={user=bobafett;uuid=fatalapouet};path=/;expires=eventually");
        if (this_client.getNickname() == null)
            this_client.setNickname("bobafett");
        InetAddress my_local_addr = this_client.getAddress();
        InetAddress my_global_addr = null;
        try {
            my_global_addr = this_client.getExternalAddress();
        }
        catch (RuntimeException e) {
            System.err.println("Warning: could not get external address.");
        }
        InetAddress target = null;
        try {
            target = InetAddress.getByName(args[0]);
        }
        catch (UnknownHostException e) {
            System.err.println("Error: could not get address for host '" + args[0] + "'.");
            System.exit(1);
        }
        if (target != null) {
            System.out.println("\nStarting pings...");
            TcpPinger this_tcp_pinger = new TcpPinger(this_client);
            IcmpPinger this_pinger = new IcmpPinger(this_client);
            TraceRouter this_router = new TraceRouter(this_client);
            String text_local_addr = my_local_addr.toString().split("/")[1];
            String text_global_addr;
            if (my_global_addr != null)
                text_global_addr = my_global_addr.toString().split("/")[1];
            else
                text_global_addr = "<unknown>";
            this_pinger.probe(target);
            System.out.println(text_local_addr + " " +
                               text_global_addr + " " +
                               this_pinger.getLastProbe());
            this_router.probe(target);
            System.out.println(text_local_addr + " " +
                               text_global_addr + " " +
                               this_router.getLastProbe());
            this_tcp_pinger.probe(target,50);
            System.out.println(text_local_addr + " " +
                               text_global_addr + " " +
                               this_tcp_pinger.getLastProbe());
        }
        System.out.println(this_client.getPreferences());
    }


Input:
	public IProofObligationList caseAExplicitFunctionDefinition(
			AExplicitFunctionDefinition node, IPOContextStack question)
			throws AnalysisException
	{
		try
		{
			if (node.getBody() instanceof ANotYetSpecifiedExp)
			{
				return new ProofObligationList();
			}
			IProofObligationList obligations = new ProofObligationList();
			LexNameList pids = new LexNameList();
			AFunctionType ftype = (AFunctionType) node.getType();
			boolean alwaysMatches = true;
			for (List<PPattern> params : node.getParamPatternList())
			{
				alwaysMatches = params.isEmpty() && alwaysMatches;
			}
			if (alwaysMatches)
			{
			} else
			{
				alwaysMatches = false;
				PatternAlwaysMatchesVisitor amVisitor = new PatternAlwaysMatchesVisitor();
				for (List<PPattern> patterns : node.getParamPatternList())
					for (PPattern p : patterns)
					{
						for (PDefinition def : p.getDefinitions())
							pids.add(def.getName());
						alwaysMatches = alwaysMatches && p.apply(amVisitor);
					}
			}
			if (pids.hasDuplicates() || !alwaysMatches)
			{
				obligations.add(new ParameterPatternObligation(node, question));
			}
			PExp precondition = node.getPrecondition();
			if (precondition != null)
			{
				question.push(new POFunctionDefinitionContext(node, false));
				obligations.addAll(precondition.apply(rootVisitor, question));
				question.pop();
			}
			PExp postcondition = node.getPostcondition();
			if (postcondition != null)
			{
				question.push(new POFunctionDefinitionContext(node, false));
				obligations.add(new FuncPostConditionObligation(node, question));
				question.push(new POFunctionResultContext(node));
				obligations.addAll(postcondition.apply(rootVisitor, question));
				question.pop();
				question.pop();
			}
			question.push(new POFunctionDefinitionContext(node, true));
			PExp body = node.getBody();
			int sizeBefore = question.size();
			obligations.addAll(body.apply(rootVisitor, question));
			assert sizeBefore <= question.size();
			if (node.getIsUndefined()
					|| !TypeComparator.isSubType(node.getActualResult(), node.getExpectedResult()))
			{
				SubTypeObligation sto = SubTypeObligation.newInstance(node, node.getExpectedResult(), node.getActualResult(), question);
				if (sto != null)
				{
					obligations.add(sto);
				}
			}
			question.pop();
			return obligations;
		} catch (Exception e)
		{
			throw new POException(node, e.getMessage());
		}
	}

Output:
	public IProofObligationList caseAExplicitFunctionDefinition(
			AExplicitFunctionDefinition node, IPOContextStack question)
			throws AnalysisException
	{
		try
		{
			if (node.getBody() instanceof ANotYetSpecifiedExp)
			{
				return new ProofObligationList();
			}
			IProofObligationList obligations = new ProofObligationList();
			LexNameList pids = new LexNameList();
			AFunctionType ftype = (AFunctionType) node.getType();
			boolean alwaysMatches = true;
			for (List<PPattern> params : node.getParamPatternList())
			{
				alwaysMatches = params.isEmpty() && alwaysMatches;
			}
			if (alwaysMatches)
			{
			} else
			{
				alwaysMatches = true;
				PatternAlwaysMatchesVisitor amVisitor = new PatternAlwaysMatchesVisitor();
				for (List<PPattern> patterns : node.getParamPatternList())
					for (PPattern p : patterns)
					{
						for (PDefinition def : p.getDefinitions())
							pids.add(def.getName());
						alwaysMatches = alwaysMatches && p.apply(amVisitor);
					}
			}
			if (pids.hasDuplicates() || !alwaysMatches)
			{
				obligations.add(new ParameterPatternObligation(node, question));
			}
			PExp precondition = node.getPrecondition();
			if (precondition != null)
			{
				question.push(new POFunctionDefinitionContext(node, false));
				obligations.addAll(precondition.apply(rootVisitor, question));
				question.pop();
			}
			PExp postcondition = node.getPostcondition();
			if (postcondition != null)
			{
				question.push(new POFunctionDefinitionContext(node, false));
				obligations.add(new FuncPostConditionObligation(node, question));
				question.push(new POFunctionResultContext(node));
				obligations.addAll(postcondition.apply(rootVisitor, question));
				question.pop();
				question.pop();
			}
			question.push(new POFunctionDefinitionContext(node, true));
			PExp body = node.getBody();
			int sizeBefore = question.size();
			obligations.addAll(body.apply(rootVisitor, question));
			assert sizeBefore <= question.size();
			if (node.getIsUndefined()
					|| !TypeComparator.isSubType(node.getActualResult(), node.getExpectedResult()))
			{
				SubTypeObligation sto = SubTypeObligation.newInstance(node, node.getExpectedResult(), node.getActualResult(), question);
				if (sto != null)
				{
					obligations.add(sto);
				}
			}
			question.pop();
			return obligations;
		} catch (Exception e)
		{
			throw new POException(node, e.getMessage());
		}
	}


Input:
	public static boolean parse(byte[] buffer, HarleyData hd) {
		byte[] in;
		int x;
		int y;
		in = bytes_to_hex(buffer);
		if (crc(in) != (byte)0xc4) {
			hd.setBadCRC(buffer);
			return false;
		}
		x = y = 0;
		if (in.length >= 4)
			x = ((in[0] << 24) & 0xff000000) |
			    ((in[1] << 16) & 0x00ff0000) |
			    ((in[2] <<  8) & 0x0000ff00) |
			     (in[3]        & 0x000000ff);
		if (in.length >= 6)
			y = ((in[4] << 8) & 0x0000ff00) |
			     (in[5]       & 0x000000ff);
		if (x == 0x281b1002)
			hd.setRPM(y);
		else if (x == 0x48291002)
			hd.setSpeed(y);
		else if (x == 0xa8491010)
			hd.setEngineTemp((int)in[4] & 0xff);
		else if (x == 0xa83b1003) {
			if (in[4] != 0) {
				int gear = 0;
				while ((in[4] >>= 1) != 0)
					gear++;
				hd.setGear(gear);
			} else
				hd.setGear(-1);
		} else if ((x == 0x48da4039) && ((in[4] & 0xfc) == 0))
			hd.setTurnSignals(in[4] & 0x03);
		else if ((x & 0xffffff7f) == 0xa8691006) {
			odolast = y - odolast;
			if (odolast < 0)
				odolast += 65536;
			odoaccum += odolast;
			odolast = y;
			hd.setOdometer(odoaccum);
		} else if ((x & 0xffffff7f) == 0xa883100a) {
			fuellast = y - fuellast;
			if (fuellast < 0)
				fuellast += 65536;
			fuelaccum += fuellast;
			fuellast = y;
			hd.setFuel(fuelaccum);
		} else if ((x == 0xa8836112) && ((in[4] & 0xd0) == 0xd0))
			hd.setFuelGauge(in[4] & 0x0f);
		else if ((x & 0xffffff5d) == 0x483b4000) {
			if ((in[3] & 0x20) == 0x20)
				hd.setNeutral(false);
			else if ((in[3] & 0xa0) == 0xa0)
				hd.setNeutral(true);
			hd.setClutch((in[3] & 0x80) != 0);
		} else if ((x & 0xffffff7f) == 0x68881003) {
			if ((in[3] & 0x80) != 0)
				hd.setCheckEngine(true);
			else
				hd.setCheckEngine(false);
		} else if (x == 0x0c10f13c) {
		} else if (x == 0x0cf1107c) {
			switch (in[4]) {
			case 0x01:
				System.arraycopy(in, 5, ecmPN, 0, 6);
				break;
			case 0x02:
				System.arraycopy(in, 5, ecmPN, 6, 6);
				hd.setECMPN(new String(ecmPN).trim());
				break;
			case 0x03:
				System.arraycopy(in, 5, ecmCalID, 0, 6);
				break;
			case 0x04:
				System.arraycopy(in, 5, ecmCalID, 6, 6);
				hd.setECMCalID(new String(ecmCalID).trim());
				break;
			case 0x0b:
				hd.setECMSWLevel((int)in[5] & 0xff);
				break;
			case 0x0f:
				System.arraycopy(in, 5, vin, 0, 6);
				break;
			case 0x10:
				System.arraycopy(in, 5, vin, 6, 6);
				break;
			case 0x11:
				System.arraycopy(in, 5, vin, 12, 5);
				hd.setVIN(new String(vin).trim());
				break;
			default:
				hd.setUnknown(buffer);
			}
		} else if (x == 0x6cfef119)
			if (D) Log.d(TAG, "DTC start");
		else if ((x & 0xffff0fff) == 0x6cf10059) {
			int dtc = (((int)in[4] & 0xff) << 8) | ((int)in[5] & 0xff);
			if (in[2] == 0x10) {
				if (D) Log.d(TAG, "historic DTC: 0x" + Integer.toString(dtc, 16));
				hd.addHistoricDTC(dtc);
			} else if (in[2] == 0x40) {
				if (D) Log.d(TAG, "current DTC: 0x" + Integer.toString(dtc, 16));
				hd.addCurrentDTC(dtc);
			} else
				hd.setUnknown(buffer);
		} else if (x == 0x6c10f114)
			if (D) Log.d(TAG, "DTC clear");
		else
			hd.setUnknown(buffer);
		return true;
	}

Output:
	public static boolean parse(byte[] buffer, HarleyData hd) {
		byte[] in;
		int x;
		int y;
		in = bytes_to_hex(buffer);
		hd.setRaw(buffer);
		if (crc(in) != (byte)0xc4) {
			hd.setBadCRC(buffer);
			return false;
		}
		x = y = 0;
		if (in.length >= 4)
			x = ((in[0] << 24) & 0xff000000) |
			    ((in[1] << 16) & 0x00ff0000) |
			    ((in[2] <<  8) & 0x0000ff00) |
			     (in[3]        & 0x000000ff);
		if (in.length >= 6)
			y = ((in[4] << 8) & 0x0000ff00) |
			     (in[5]       & 0x000000ff);
		if (x == 0x281b1002)
			hd.setRPM(y);
		else if (x == 0x48291002)
			hd.setSpeed(y);
		else if (x == 0xa8491010)
			hd.setEngineTemp((int)in[4] & 0xff);
		else if (x == 0xa83b1003) {
			if (in[4] != 0) {
				int gear = 0;
				while ((in[4] >>= 1) != 0)
					gear++;
				hd.setGear(gear);
			} else
				hd.setGear(-1);
		} else if ((x == 0x48da4039) && ((in[4] & 0xfc) == 0))
			hd.setTurnSignals(in[4] & 0x03);
		else if ((x & 0xffffff7f) == 0xa8691006) {
			odolast = y - odolast;
			if (odolast < 0)
				odolast += 65536;
			odoaccum += odolast;
			odolast = y;
			hd.setOdometer(odoaccum);
		} else if ((x & 0xffffff7f) == 0xa883100a) {
			fuellast = y - fuellast;
			if (fuellast < 0)
				fuellast += 65536;
			fuelaccum += fuellast;
			fuellast = y;
			hd.setFuel(fuelaccum);
		} else if ((x == 0xa8836112) && ((in[4] & 0xd0) == 0xd0))
			hd.setFuelGauge(in[4] & 0x0f);
		else if ((x & 0xffffff5d) == 0x483b4000) {
			if ((in[3] & 0x20) == 0x20)
				hd.setNeutral(false);
			else if ((in[3] & 0xa0) == 0xa0)
				hd.setNeutral(true);
			hd.setClutch((in[3] & 0x80) != 0);
		} else if ((x & 0xffffff7f) == 0x68881003) {
			if ((in[3] & 0x80) != 0)
				hd.setCheckEngine(true);
			else
				hd.setCheckEngine(false);
		} else if (x == 0x0c10f13c) {
		} else if (x == 0x0cf1107c) {
			switch (in[4]) {
			case 0x01:
				System.arraycopy(in, 5, ecmPN, 0, 6);
				break;
			case 0x02:
				System.arraycopy(in, 5, ecmPN, 6, 6);
				hd.setECMPN(new String(ecmPN).trim());
				break;
			case 0x03:
				System.arraycopy(in, 5, ecmCalID, 0, 6);
				break;
			case 0x04:
				System.arraycopy(in, 5, ecmCalID, 6, 6);
				hd.setECMCalID(new String(ecmCalID).trim());
				break;
			case 0x0b:
				hd.setECMSWLevel((int)in[5] & 0xff);
				break;
			case 0x0f:
				System.arraycopy(in, 5, vin, 0, 6);
				break;
			case 0x10:
				System.arraycopy(in, 5, vin, 6, 6);
				break;
			case 0x11:
				System.arraycopy(in, 5, vin, 12, 5);
				hd.setVIN(new String(vin).trim());
				break;
			default:
				hd.setUnknown(buffer);
			}
		} else if (x == 0x6cfef119) {
			if (D) Log.d(TAG, "DTC start");
		} else if ((x & 0xffff0fff) == 0x6cf10059) {
			int dtc = (((int)in[4] & 0xff) << 8) | ((int)in[5] & 0xff);
			if (in[2] == 0x10) {
				if (D) Log.d(TAG, "historic DTC: 0x" + Integer.toString(dtc, 16));
				hd.addHistoricDTC(dtc);
			} else if (in[2] == 0x40) {
				if (D) Log.d(TAG, "current DTC: 0x" + Integer.toString(dtc, 16));
				hd.addCurrentDTC(dtc);
			} else
				hd.setUnknown(buffer);
		} else if (x == 0x6c10f114)
			if (D) Log.d(TAG, "DTC clear");
		else
			hd.setUnknown(buffer);
		return true;
	}


Input:
    private Resource findMatchingConfiguredResource(List<? extends Resource> resources,
            FolderConfiguration referenceConfig) {
        ArrayList<Resource> matchingResources = new ArrayList<Resource>();
        for (int i = 0 ; i < resources.size(); i++) {
            Resource res = resources.get(i);
            if (res.getConfiguration().isMatchFor(referenceConfig)) {
                matchingResources.add(res);
            }
        }
        if (matchingResources.size() == 1) {
            return matchingResources.get(0);
        } else if (matchingResources.size() == 0) {
            return null;
        }
        final int count = FolderConfiguration.getQualifierCount();
        for (int q = 0 ; q < count ; q++) {
            ResourceQualifier referenceQualifier = referenceConfig.getQualifier(q);
            boolean found = false;
            ResourceQualifier bestMatch = null;
            for (Resource res : matchingResources) {
                ResourceQualifier qualifier = res.getConfiguration().getQualifier(q);
                if (qualifier != null) {
                    found = true;
                    if (referenceQualifier != null) {
                        if (qualifier.isBetterMatchThan(bestMatch, referenceQualifier)) {
                            bestMatch = qualifier;
                        }
                    }
                }
            }
            if (found) {
                for (int i = 0 ; i < matchingResources.size(); ) {
                    Resource res = matchingResources.get(i);
                    ResourceQualifier qualifier = res.getConfiguration().getQualifier(q);
                    if (qualifier == null) {
                        matchingResources.remove(res);
                    } else if (referenceQualifier != null && bestMatch != null &&
                            bestMatch.equals(qualifier) == false) {
                        matchingResources.remove(res);
                    } else {
                        i++;
                    }
                }
                if (matchingResources.size() < 2) {
                    break;
                }
            }
        }
        if (matchingResources.size() == 0) {
            return null;
        }
        return matchingResources.get(1);
    }

Output:
    private Resource findMatchingConfiguredResource(List<? extends Resource> resources,
            FolderConfiguration referenceConfig) {
        ArrayList<Resource> matchingResources = new ArrayList<Resource>();
        for (int i = 0 ; i < resources.size(); i++) {
            Resource res = resources.get(i);
            if (res.getConfiguration().isMatchFor(referenceConfig)) {
                matchingResources.add(res);
            }
        }
        if (matchingResources.size() == 1) {
            return matchingResources.get(0);
        } else if (matchingResources.size() == 0) {
            return null;
        }
        final int count = FolderConfiguration.getQualifierCount();
        for (int q = 0 ; q < count ; q++) {
            ResourceQualifier referenceQualifier = referenceConfig.getQualifier(q);
            boolean found = false;
            ResourceQualifier bestMatch = null;
            for (Resource res : matchingResources) {
                ResourceQualifier qualifier = res.getConfiguration().getQualifier(q);
                if (qualifier != null) {
                    found = true;
                    if (referenceQualifier != null) {
                        if (qualifier.isBetterMatchThan(bestMatch, referenceQualifier)) {
                            bestMatch = qualifier;
                        }
                    }
                }
            }
            if (found) {
                for (int i = 0 ; i < matchingResources.size(); ) {
                    Resource res = matchingResources.get(i);
                    ResourceQualifier qualifier = res.getConfiguration().getQualifier(q);
                    if (qualifier == null) {
                        matchingResources.remove(res);
                    } else if (referenceQualifier != null && bestMatch != null &&
                            bestMatch.equals(qualifier) == false) {
                        matchingResources.remove(res);
                    } else {
                        i++;
                    }
                }
                if (matchingResources.size() < 2) {
                    break;
                }
            }
        }
        if (matchingResources.size() == 0) {
            return null;
        }
        return matchingResources.get(0);
    }