Program: 11592
Project: 11592
Buggy source:
@Test public void testSpecialCasesAsString(){
  final boolean bBrowserCompliantMode=isBrowserCompliantMode();
  final CSSReaderSettings aSettings=new CSSReaderSettings().setCSSVersion(ECSSVersion.CSS30).setCustomErrorHandler(new LoggingCSSParseErrorHandler()).setBrowserCompliantMode(bBrowserCompliantMode);
  String sCSS="String_Node_Str";
  CascadingStyleSheet aCSS, aCSS2;
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals(bBrowserCompliantMode ? "String_Node_Str" : "String_Node_Str",new CSSWriter(ECSSVersion.CSS30,true).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(ECSSVersion.CSS30,true).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  aCSS2=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS2);
  assertEquals("String_Node_Str",new CSSWriter(ECSSVersion.CSS30,true).getCSSAsString(aCSS2));
  assertEquals(aCSS,aCSS2);
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNull(aCSS);
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNull(aCSS);
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNull(aCSS);
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNull(aCSS);
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNull(aCSS);
}

Fixed version (ground truth):
@Test public void testSpecialCasesAsString(){
  final boolean bBrowserCompliantMode=isBrowserCompliantMode();
  final CSSReaderSettings aSettings=new CSSReaderSettings().setCSSVersion(ECSSVersion.CSS30).setCustomErrorHandler(new LoggingCSSParseErrorHandler()).setBrowserCompliantMode(bBrowserCompliantMode);
  String sCSS="String_Node_Str";
  CascadingStyleSheet aCSS;
  CascadingStyleSheet aCSS2;
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals(bBrowserCompliantMode ? "String_Node_Str" : "String_Node_Str",new CSSWriter(ECSSVersion.CSS30,true).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(ECSSVersion.CSS30,true).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  aCSS2=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS2);
  assertEquals("String_Node_Str",new CSSWriter(ECSSVersion.CSS30,true).getCSSAsString(aCSS2));
  assertEquals(aCSS,aCSS2);
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNull(aCSS);
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNull(aCSS);
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNull(aCSS);
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNotNull(aCSS);
  assertEquals("String_Node_Str",new CSSWriter(new CSSWriterSettings(ECSSVersion.CSS30).setOptimizedOutput(true)).getCSSAsString(aCSS));
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNull(aCSS);
  sCSS="String_Node_Str";
  aCSS=CSSReader.readFromStringReader(sCSS,aSettings);
  assertNull(aCSS);
}