Program: 125305
Project: 125305
Buggy source:
/** 
 * DOC wchen Comment method "initURI".
 * @return
 */
private String initURI(){
  if (mavenUri == null) {
    if (StringUtils.isEmpty(mavenUriFromConfiguration)) {
      String mvnUrisFromIndex=libManagerService.getMavenUriFromIndex(getModuleName());
      if (mvnUrisFromIndex != null) {
        final String[] split=mvnUrisFromIndex.split(MavenUrlHelper.MVN_INDEX_SPLITER);
        String maxVerstion=null;
        for (        String mvnUri : split) {
          if (maxVerstion == null) {
            maxVerstion=mvnUri;
          }
 else {
            MavenArtifact lastArtifact=MavenUrlHelper.parseMvnUrl(maxVerstion);
            MavenArtifact currentArtifact=MavenUrlHelper.parseMvnUrl(mvnUri);
            if (lastArtifact != null && currentArtifact != null) {
              String lastV=lastArtifact.getVersion();
              lastV=lastV.replace(MavenConstants.SNAPSHOT,"String_Node_Str");
              String currentV=currentArtifact.getVersion();
              currentV=currentV.replace(MavenConstants.SNAPSHOT,"String_Node_Str");
              if (!lastV.equals(currentV)) {
                Version lastVersion=new Version(lastV);
                Version currentVersion=new Version(currentV);
                if (currentVersion.compareTo(lastVersion) > 0) {
                  maxVerstion=mvnUri;
                }
              }
            }
          }
        }
        mavenUri=MavenUrlHelper.addTypeForMavenUri(maxVerstion,getModuleName());
      }
 else {
        mavenUri=MavenUrlHelper.generateMvnUrlForJarName(getModuleName(),true,true);
      }
    }
 else {
      mavenUri=mavenUriFromConfiguration;
    }
  }
  return mavenUri;
}

Fixed version (ground truth):
/** 
 * DOC wchen Comment method "initURI".
 * @return
 */
private String initURI(){
  if (mavenUri == null) {
    if (StringUtils.isEmpty(mavenUriFromConfiguration)) {
      String mvnUrisFromIndex=libManagerService.getMavenUriFromIndex(getModuleName());
      if (mvnUrisFromIndex != null) {
        final String[] split=mvnUrisFromIndex.split(MavenUrlHelper.MVN_INDEX_SPLITER);
        String maxVerstion=null;
        for (        String mvnUri : split) {
          if (maxVerstion == null) {
            maxVerstion=mvnUri;
          }
 else {
            MavenArtifact lastArtifact=MavenUrlHelper.parseMvnUrl(maxVerstion);
            MavenArtifact currentArtifact=MavenUrlHelper.parseMvnUrl(mvnUri);
            if (lastArtifact != null && currentArtifact != null) {
              String lastV=lastArtifact.getVersion();
              String currentV=currentArtifact.getVersion();
              if (!lastV.equals(currentV)) {
                Version lastVersion=getVerstion(lastArtifact);
                Version currentVersion=getVerstion(currentArtifact);
                if (currentVersion.compareTo(lastVersion) > 0) {
                  maxVerstion=mvnUri;
                }
              }
            }
          }
        }
        mavenUri=MavenUrlHelper.addTypeForMavenUri(maxVerstion,getModuleName());
      }
 else {
        mavenUri=MavenUrlHelper.generateMvnUrlForJarName(getModuleName(),true,true);
      }
    }
 else {
      mavenUri=mavenUriFromConfiguration;
    }
  }
  return mavenUri;
}