private String adjustOutputToHandleOpenJDKJavacOutputDifference(String antOutput){
  if (!antOutput.contains("java.util.ArrayList") && antOutput.contains("ArrayList")) {
    antOutput=antOutput.replace("ArrayList","java.util.ArrayList");
  }
  if (!antOutput.contains("java.lang.String") && antOutput.contains("String")) {
    antOutput=antOutput.replace("String","java.lang.String");
  }
  return antOutput;
}

private String adjustOutputToHandleOpenJDKJavacOutputDifference ( String antOutput ) { if ( ! antOutput . contains ( "java.util.ArrayList" ) && antOutput . contains ( "ArrayList" ) ) { antOutput = antOutput . replace ( "ArrayList" , "java.util.ArrayList" ) ; } if ( ! antOutput . contains ( "java.lang.String" ) && antOutput . contains ( "String" ) ) { antOutput = antOutput . replace ( "String" , "java.lang.String" ) ; } return antOutput ; }
for the code : private arraylist < string > x = new arraylist < string > ( ) ; x = ( arraylist ) z ; upto jdk6 , ' javac - xlint ' produces the following output : found : java . util . arraylist required : java . util . arraylist < java . lang . string > but , openjdk seems to be producing the following output : required : arraylist < string > found : arraylist so , we first adjust the output a bit , so that difference in the output brought in by openjdk javac does not impact the test adversely
