nus-yam/ex-repair huggingface dataset:
Program: 60122
Project: 60122
Buggy source:
/** 
 * Sends POST content, if any, and causes the request to proceed. <p> In the case of asynchronous requests, a new thread is created.
 * @param content POST content or <code>null</code> if there's no such content.
 * @throws IOException Signals that an I/O exception has occurred.
 */
public void send(final String content){
  try {
    final URL url=new URL(req.getUrl());
    if (this.isAsync) {
      new Thread("String_Node_Str" + url.getHost()){
        @Override public void run(){
          try {
            sendSync(content);
          }
 catch (          Throwable thrown) {
            logger.error("String_Node_Str" + url,thrown);
          }
        }
      }
.start();
    }
 else {
      sendSync(content);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Sends POST content, if any, and causes the request to proceed. <p> In the case of asynchronous requests, a new thread is created.
 * @param content POST content or <code>null</code> if there's no such content.
 */
public void send(final String content){
  try {
    final URL url=new URL(req.getUrl());
    if (this.isAsync) {
      new Thread("String_Node_Str" + url.getHost()){
        @Override public void run(){
          try {
            sendSync(content);
          }
 catch (          Throwable thrown) {
            logger.error("String_Node_Str" + url,thrown);
          }
        }
      }
.start();
    }
 else {
      sendSync(content);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 60123
Project: 60123
Buggy source:
/** 
 * Opens the request. Call   {@link #send(String)} to complete it.
 * @param method The request method.
 * @param url The request URL.
 * @param asyncFlag Whether the request should be asynchronous.
 * @param userName The user name of the request (not supported.)
 * @param password The password of the request (not supported.)
 * @throws IOException Signals that an I/O exception has occurred.
 */
public void open(final Method method,final URL url,boolean asyncFlag,final String userName,final String password){
  this.abort();
  Proxy proxy=this.proxy;
  SSLCertificate.setCertificate();
  URLConnection c;
  try {
    c=(proxy == null) || (proxy == Proxy.NO_PROXY) ? url.openConnection() : url.openConnection(proxy);
synchronized (this) {
      this.connection=c;
      this.isAsync=asyncFlag;
      req.setUsername(userName);
      req.setPassword(password);
      req.setUrl(url.toString());
      if (method.equals(Method.GET)) {
        req.setMethod(Method.GET);
      }
 else {
        req.setMethod(Method.POST);
      }
    }
    this.changeState(ReadyState.LOADING,0,null,null);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Opens the request. Call   {@link #send(String)} to complete it.
 * @param method The request method.
 * @param url The request URL.
 * @param asyncFlag Whether the request should be asynchronous.
 * @param userName The user name of the request (not supported.)
 * @param password The password of the request (not supported.)
 */
public void open(final Method method,final URL url,boolean asyncFlag,final String userName,final String password){
  this.abort();
  Proxy proxy=this.proxy;
  SSLCertificate.setCertificate();
  URLConnection c;
  try {
    c=(proxy == null) || (proxy == Proxy.NO_PROXY) ? url.openConnection() : url.openConnection(proxy);
synchronized (this) {
      this.connection=c;
      this.isAsync=asyncFlag;
      req.setUsername(userName);
      req.setPassword(password);
      req.setUrl(url.toString());
      if (method.equals(Method.GET)) {
        req.setMethod(Method.GET);
      }
 else {
        req.setMethod(Method.POST);
      }
    }
    this.changeState(ReadyState.LOADING,0,null,null);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 60124
Project: 60124
Buggy source:
/** 
 * Gets the value class.
 * @return the value class
 */
public Class<?> getValueClass(){
  return valueClass;
}

Fixed version (ground truth):
/** 
 * Gets the value class.
 * @return the value class
 */
public Class<?> getValueClass(){
  return this.valueClass;
}
Program: 60125
Project: 60125
Buggy source:
/** 
 * Gets the approximate size.
 * @return the approximate size
 */
public int getApproximateSize(){
  return approximateSize;
}

Fixed version (ground truth):
/** 
 * Gets the approximate size.
 * @return the approximate size
 */
public int getApproximateSize(){
  return this.approximateSize;
}
Program: 60126
Project: 60126
Buggy source:
/** 
 * Gets the instance.
 * @return the instance
 */
public static final ColorFactory getInstance(){
  if (instance == null) {
synchronized (ColorFactory.class) {
      instance=new ColorFactory();
    }
  }
  return instance;
}

Fixed version (ground truth):
/** 
 * Gets the instance.
 * @return the instance
 */
public synchronized static final ColorFactory getInstance(){
  if (instance == null) {
    instance=new ColorFactory();
  }
  return instance;
}
Program: 60127
Project: 60127
Buggy source:
@Override public boolean equals(final Object other){
  if (other == this) {
    return true;
  }
  FontKey ors;
  try {
    ors=(FontKey)other;
  }
 catch (  ClassCastException cce) {
    return false;
  }
  return (this.fontSize == ors.fontSize) && (this.fontFamily == ors.fontFamily) && (this.fontStyle == ors.fontStyle)&& (this.fontWeight == ors.fontWeight)&& (this.fontVariant == ors.fontVariant)&& (this.superscript == ors.superscript)&& Objects.equals(this.locales,ors.locales);
}

Fixed version (ground truth):
@Override public boolean equals(final Object other){
  if (other == this) {
    return true;
  }
  FontKey ors;
  try {
    ors=(FontKey)other;
  }
 catch (  ClassCastException cce) {
    return false;
  }
  return (this.fontSize == ors.fontSize) && (this.fontFamily.equals(ors.fontFamily)) && (this.fontStyle.equals(ors.fontStyle))&& (this.fontWeight.equals(ors.fontWeight))&& (this.fontVariant.equals(ors.fontVariant))&& (this.superscript.intValue() == ors.superscript.intValue())&& Objects.equals(this.locales,ors.locales);
}
Program: 60128
Project: 60128
Buggy source:
/** 
 * Ensure populated impl.
 */
private void ensurePopulatedImpl(){
  if (this.itemsByName == null) {
    ArrayList<DOMNodeImpl> descendents=this.rootNode.getDescendents(this.nodeFilter,this.nestIntoMatchingNodes);
    this.itemsByIndex=descendents == null ? Collections.emptyList() : descendents;
    int size=descendents == null ? 0 : descendents.size();
    Map<String,DOMElementImpl> itemsByName=new HashMap<String,DOMElementImpl>((size * 3) / 2);
    this.itemsByName=itemsByName;
    for (int i=0; i < size; i++) {
      Object descNode=descendents.get(i);
      if (descNode instanceof DOMElementImpl) {
        DOMElementImpl element=(DOMElementImpl)descNode;
        String id=element.getId();
        if ((id != null) && (id.length() != 0)) {
          itemsByName.put(id,element);
        }
        String name=element.getAttribute(HtmlAttributeProperties.NAME);
        if ((name != null) && (name.length() != 0) && !name.equals(id)) {
          itemsByName.put(name,element);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Ensure populated impl.
 */
private void ensurePopulatedImpl(){
  if (this.itemsByName == null) {
    ArrayList<DOMNodeImpl> descendents=this.rootNode.getDescendents(this.nodeFilter,this.nestIntoMatchingNodes);
    this.itemsByIndex=descendents;
    int size=descendents.size();
    Map<String,DOMElementImpl> itemsByName=new HashMap<String,DOMElementImpl>((size * 3) / 2);
    this.itemsByName=itemsByName;
    for (int i=0; i < size; i++) {
      Object descNode=descendents.get(i);
      if (descNode instanceof DOMElementImpl) {
        DOMElementImpl element=(DOMElementImpl)descNode;
        String id=element.getId();
        if ((id != null) && (id.length() != 0)) {
          itemsByName.put(id,element);
        }
        String name=element.getAttribute(HtmlAttributeProperties.NAME);
        if ((name != null) && (name.length() != 0) && !name.equals(id)) {
          itemsByName.put(name,element);
        }
      }
    }
  }
}
Program: 60129
Project: 60129
Buggy source:
@Override public String toString(){
  String someText=this.text;
  int length=someText.length();
  if ((someText != null) && (someText.length() > 32)) {
    someText=someText.substring(0,29) + "String_Node_Str";
  }
  return this.getNodeName() + "String_Node_Str" + length+ "String_Node_Str"+ someText+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  String someText=this.text;
  int length=someText.length();
  if (someText.length() > 32) {
    someText=someText.substring(0,29) + "String_Node_Str";
  }
  return this.getNodeName() + "String_Node_Str" + length+ "String_Node_Str"+ someText+ "String_Node_Str";
}
Program: 60130
Project: 60130
Buggy source:
@Override public final String getAttribute(String name){
  String normalName=this.normalizeAttributeName(name);
synchronized (this) {
    Map<String,String> attributes=this.attributes;
    return attributes == null ? null : (String)attributes.get(normalName);
  }
}

Fixed version (ground truth):
@Override public final String getAttribute(String name){
  String normalName=this.normalizeAttributeName(name);
  if (normalName != null && normalName.length() > 0) {
synchronized (this) {
      Map<String,String> attributes=this.attributes;
      return attributes == null ? null : (String)attributes.get(normalName);
    }
  }
  return null;
}
Program: 60131
Project: 60131
Buggy source:
/** 
 * Gets the text content of this node and its descendents.
 * @return the text content
 * @throws DOMException the DOM exception
 */
@Override public String getTextContent() throws DOMException {
  StringBuffer sb=new StringBuffer();
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    if (nl != null) {
      Iterator<Node> i=nl.iterator();
      while (i.hasNext()) {
        Node node=i.next();
        short type=node.getNodeType();
switch (type) {
case Node.CDATA_SECTION_NODE:
case Node.TEXT_NODE:
case Node.ELEMENT_NODE:
          String textContent=node.getTextContent();
        if (textContent != null) {
          sb.append(textContent);
        }
      break;
default :
    break;
}
}
}
}
return sb.toString();
}

Fixed version (ground truth):
/** 
 * Gets the text content of this node and its descendents.
 * @return the text content
 * @throws DOMException the DOM exception
 */
@Override public String getTextContent() throws DOMException {
  StringBuffer sb=new StringBuffer();
synchronized (this.getTreeLock()) {
    ArrayList<Node> nl=this.nodeList;
    if (nl != null) {
      Iterator<Node> i=nl.iterator();
      while (i.hasNext()) {
        Node node=i.next();
        short type=node.getNodeType();
switch (type) {
case Node.CDATA_SECTION_NODE:
case Node.TEXT_NODE:
case Node.ELEMENT_NODE:
          String textContent=node.getTextContent();
        if (textContent != null) {
          sb.append(textContent);
        }
      break;
default :
    break;
}
}
}
}
return sb.toString().trim();
}
Program: 60132
Project: 60132
Buggy source:
/** 
 * Removes the all children.
 */
protected void removeAllChildren(){
synchronized (this.getTreeLock()) {
    this.removeAllChildrenImpl();
  }
}

Fixed version (ground truth):
/** 
 * Removes the all children.
 */
public void removeAllChildren(){
synchronized (this.getTreeLock()) {
    this.removeAllChildrenImpl();
  }
}
Program: 60133
Project: 60133
Buggy source:
/** 
 * Removes the image listener.
 * @param listener the listener
 */
public void removeImageListener(ImageListener listener){
  ArrayList<ImageListener> l=this.imageListeners;
synchronized (l) {
    l.remove(l);
  }
}

Fixed version (ground truth):
/** 
 * Removes the image listener.
 * @param listener the listener
 */
public void removeImageListener(ImageListener listener){
  this.imageListeners=new ArrayList<ImageListener>();
}
Program: 60134
Project: 60134
Buggy source:
/** 
 * Removes the image listener.
 * @param listener the listener
 */
public void removeImageListener(ImageListener listener){
  ArrayList<ImageListener> l=this.listeners;
synchronized (l) {
    l.remove(l);
  }
}

Fixed version (ground truth):
/** 
 * Removes the image listener.
 * @param listener the listener
 */
public void removeImageListener(ImageListener listener){
  this.listeners=new ArrayList<ImageListener>();
}
Program: 60135
Project: 60135
Buggy source:
/** 
 * Gets the pseudo names.
 * @return the pseudo names
 */
public Set<String> getPseudoNames(){
  Set<String> pnset=new HashSet<String>();
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  pnset.add("String_Node_Str");
  return pnset;
}

Fixed version (ground truth):
/** 
 * Gets the pseudo names.
 * @return the pseudo names
 */
public Set<String> getPseudoNames(){
  Set<String> pnset=new HashSet<String>();
  pnset.add(SelectorMatcher.LAST_CHILD);
  pnset.add(SelectorMatcher.LAST_OF_TYPE);
  pnset.add(SelectorMatcher.FIRST_CHILD);
  pnset.add(SelectorMatcher.FIRST_OF_TYPE);
  pnset.add(SelectorMatcher.ONLY_CHILD);
  pnset.add(SelectorMatcher.ONLY_OF_TYPE);
  pnset.add(SelectorMatcher.NTH_CHILD);
  pnset.add(SelectorMatcher.NTH_LAST_CHILD);
  pnset.add(SelectorMatcher.NTH_OF_TYPE);
  pnset.add(SelectorMatcher.NTH_LAST_OF_TYPE);
  pnset.add(SelectorMatcher.HOVER);
  pnset.add(SelectorMatcher.ROOT);
  pnset.add(SelectorMatcher.EMPTY);
  return pnset;
}
Program: 60139
Project: 60139
Buggy source:
/** 
 * Matches the given pseudo class selector against the given node.
 * @param selector The pseudo class selector.
 * @param node The root node.
 * @return {@code true} or {@code false}
 */
public boolean matchesPseudoClassSelector(String selector,DOMNodeImpl node){
  if (selector != null && selector.contains("String_Node_Str")) {
    selector=selector.substring(0,selector.indexOf("String_Node_Str"));
  }
 else   if (selector == null) {
    return false;
  }
switch (selector) {
case "String_Node_Str":
    return matchesFirstOrLastChild(node,true);
case "String_Node_Str":
  return matchesFirstOrLastChild(node,false);
case "String_Node_Str":
return matchesFirstOrLastChild(node,true) && matchesFirstOrLastChild(node,false);
case "String_Node_Str":
return matchesNthChild(node,0,1,true,false);
case "String_Node_Str":
return matchesNthChild(node,0,1,true,true);
case "String_Node_Str":
return matchesNthChild(node,0,1,true,false) && matchesNthChild(node,0,1,true,true);
case "String_Node_Str":
DOMNodeImpl parentDOMNodeImpl=(DOMNodeImpl)node.getParentNode();
return parentDOMNodeImpl != null && parentDOMNodeImpl.getNodeType() == DOMNodeImpl.DOCUMENT_TYPE_NODE;
case "String_Node_Str":
for (DOMNodeImpl child=(DOMNodeImpl)node.getFirstChild(); child != null; child=(DOMNodeImpl)child.getNextSibling()) {
switch (child.getNodeType()) {
case DOMNodeImpl.ELEMENT_NODE:
return false;
case DOMNodeImpl.TEXT_NODE:
String data=child.getNodeName();
if (data != null && !data.isEmpty()) {
return false;
}
}
}
return true;
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
return false;
default :
return false;
}
}

Fixed version (ground truth):
/** 
 * Matches the given pseudo class selector against the given node.
 * @param selector The pseudo class selector.
 * @param node The root node.
 * @return {@code true} or {@code false}
 */
public boolean matchesPseudoClassSelector(String selector,DOMNodeImpl node){
  if (selector != null && selector.contains("String_Node_Str")) {
    selector=selector.substring(0,selector.indexOf("String_Node_Str"));
  }
 else   if (selector == null) {
    return false;
  }
switch (selector) {
case FIRST_CHILD:
    return matchesFirstOrLastChild(node,true);
case LAST_CHILD:
  return matchesFirstOrLastChild(node,false);
case ONLY_CHILD:
return matchesFirstOrLastChild(node,true) && matchesFirstOrLastChild(node,false);
case FIRST_OF_TYPE:
return matchesChild(node,0,1,true,false);
case LAST_OF_TYPE:
return matchesChild(node,0,1,true,true);
case ONLY_OF_TYPE:
return matchesChild(node,0,1,true,false) && matchesChild(node,0,1,true,true);
case ROOT:
DOMNodeImpl parentDOMNodeImpl=(DOMNodeImpl)node.getParentNode();
return parentDOMNodeImpl != null && parentDOMNodeImpl.getNodeType() == DOMNodeImpl.DOCUMENT_TYPE_NODE;
case EMPTY:
return isEmpty(node);
case NTH_CHILD:
case NTH_LAST_CHILD:
case NTH_OF_TYPE:
case NTH_LAST_OF_TYPE:
return false;
default :
return false;
}
}
Program: 60140
Project: 60140
Buggy source:
/** 
 * Creates an absolute URL in a manner equivalent to major browsers.
 * @param baseUrl the base url
 * @param relativeUrl the relative url
 * @return the url
 * @throws MalformedURLException the malformed url exception
 * @throws UnsupportedEncodingException
 */
public static URL createURL(URL baseUrl,String relativeUrl) throws MalformedURLException, UnsupportedEncodingException {
  if (relativeUrl.contains("String_Node_Str")) {
    relativeUrl=new String(Base64.getEncoder().encode(relativeUrl.getBytes(StandardCharsets.UTF_8)));
  }
  if (relativeUrl.contains("String_Node_Str")) {
    return null;
  }
  if (relativeUrl.contains("String_Node_Str")) {
    relativeUrl=relativeUrl.replace("String_Node_Str","String_Node_Str");
  }
  return new URL(baseUrl,relativeUrl);
}

Fixed version (ground truth):
/** 
 * Creates an absolute URL in a manner equivalent to major browsers.
 * @param baseUrl the base url
 * @param relativeUrl the relative url
 * @return the url
 * @throws MalformedURLException the malformed url exception
 * @throws UnsupportedEncodingException
 */
public static URL createURL(URL baseUrl,String relativeUrl) throws MalformedURLException, UnsupportedEncodingException {
  if (relativeUrl.contains("String_Node_Str")) {
    relativeUrl=new String(Base64.getEncoder().encode(relativeUrl.getBytes(StandardCharsets.UTF_8)));
  }
  if (relativeUrl.contains("String_Node_Str")) {
    return null;
  }
  if (relativeUrl.contains("String_Node_Str")) {
    relativeUrl=relativeUrl.replace("String_Node_Str","String_Node_Str");
    return new URL(baseUrl.toExternalForm() + relativeUrl);
  }
  return new URL(baseUrl,relativeUrl);
}
Program: 60141
Project: 60141
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(BASEFONT.equals(doc.getElementById("String_Node_Str").getNodeName()));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(BASEFONT.equals(doc.getElementById("String_Node_Str").getNodeName()));
}
Program: 60142
Project: 60142
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(BODY.equals(doc.getElementById("String_Node_Str").getNodeName()));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(BODY.equals(doc.getElementById("String_Node_Str").getNodeName()));
}
Program: 60143
Project: 60143
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(BR.equals(doc.getElementById("String_Node_Str").getNodeName()));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(BR.equals(doc.getElementById("String_Node_Str").getNodeName()));
}
Program: 60144
Project: 60144
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(BUTTON.equals(doc.getElementById("String_Node_Str").getNodeName()));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(BUTTON.equals(doc.getElementById("String_Node_Str").getNodeName()));
}
Program: 60145
Project: 60145
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(CANVAS.equals(doc.getElementById("String_Node_Str").getNodeName()));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(CANVAS.equals(doc.getElementById("String_Node_Str").getNodeName()));
}
Program: 60146
Project: 60146
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(CAPTION.equals(doc.getElementById("String_Node_Str").getNodeName()));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(CAPTION.equals(doc.getElementById("String_Node_Str").getNodeName()));
}
Program: 60147
Project: 60147
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
}
Program: 60148
Project: 60148
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(DIV.equals(doc.getElementById("String_Node_Str").getNodeName()));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(DIV.equals(doc.getElementById("String_Node_Str").getNodeName()));
}
Program: 60149
Project: 60149
Buggy source:
@Test public void setAttributeNSNone() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
  node.setAttributeNS("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str","String_Node_Str",node.getAttributeNS("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void setAttributeNSNone() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
}
Program: 60150
Project: 60150
Buggy source:
@Test public void getAttributeNone() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
  assertEquals("String_Node_Str","String_Node_Str",node.getAttribute("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void getAttributeNone() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
  assertEquals(null,node.getAttribute("String_Node_Str"));
}
Program: 60151
Project: 60151
Buggy source:
@Test public void hasAttributeNSNone() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
  assertFalse("String_Node_Str",node.hasAttributeNS("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void hasAttributeNSNone() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
}
Program: 60152
Project: 60152
Buggy source:
@Test public void removeAttributeNSWith() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
  node.removeAttributeNS("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str","String_Node_Str",node.getAttributeNS("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void removeAttributeNSWith() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
}
Program: 60153
Project: 60153
Buggy source:
@Test public void getAttributeNSNone() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
  assertEquals("String_Node_Str","String_Node_Str",node.getAttributeNS("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void getAttributeNSNone() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
}
Program: 60154
Project: 60154
Buggy source:
@Test public void getElementsByTagName2() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element body=page.getBody();
  NodeList inputs=body.getElementsByTagName("String_Node_Str");
  assertEquals(1,inputs.getLength());
  assertEquals("String_Node_Str",inputs.item(0).getAttributes().getNamedItem("String_Node_Str").getNodeValue());
  final NodeList divs=body.getElementsByTagName("String_Node_Str");
  assertEquals(3,divs.getLength());
  inputs=page.getElementsByTagName("String_Node_Str");
  assertEquals(1,inputs.getLength());
  inputs=page.getElementsByTagName("String_Node_Str");
  assertEquals(0,inputs.getLength());
  inputs=page.getElementsByTagName(null);
  assertEquals(0,inputs.getLength());
}

Fixed version (ground truth):
@Test public void getElementsByTagName2() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element body=page.getBody();
  NodeList inputs=body.getElementsByTagName("String_Node_Str");
  assertEquals(1,inputs.getLength());
  assertEquals("String_Node_Str",inputs.item(0).getAttributes().getNamedItem("String_Node_Str").getNodeValue());
  final NodeList divs=body.getElementsByTagName("String_Node_Str");
  assertEquals(3,divs.getLength());
  inputs=page.getElementsByTagName("String_Node_Str");
  assertEquals(1,inputs.getLength());
  inputs=page.getElementsByTagName("String_Node_Str");
  assertEquals(0,inputs.getLength());
}
Program: 60155
Project: 60155
Buggy source:
@Test public void getAttributeNSWith() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
  assertEquals("String_Node_Str","String_Node_Str",node.getAttributeNS("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void getAttributeNSWith() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
}
Program: 60156
Project: 60156
Buggy source:
@Test public void hasAttributeNSWith() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
  assertTrue("String_Node_Str",node.hasAttributeNS("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void hasAttributeNSWith() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
}
Program: 60157
Project: 60157
Buggy source:
@Test public void removeAttributeNSNone() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
  node.removeAttributeNS("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str","String_Node_Str",node.getAttributeNS("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void removeAttributeNSNone() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
}
Program: 60158
Project: 60158
Buggy source:
@Test public void setAttributeNSWith() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
  node.setAttributeNS("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str","String_Node_Str",node.getAttributeNS("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void setAttributeNSWith() throws Exception {
  String htmlSource="String_Node_Str";
  HTMLDocumentImpl page=loadPage(htmlSource);
  Element node=page.getElementById("String_Node_Str");
}
Program: 60159
Project: 60159
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(FONT.equals(doc.getElementById("String_Node_Str").getNodeName()));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(FONT.equals(doc.getElementById("String_Node_Str").getNodeName()));
}
Program: 60160
Project: 60160
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(HEAD.equals(doc.getElementById("String_Node_Str").getNodeName()));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(HEAD.equals(doc.getElementById("String_Node_Str").getNodeName()));
}
Program: 60161
Project: 60161
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(IFRAME.equals(doc.getElementById("String_Node_Str").getNodeName()));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(IFRAME.equals(doc.getElementById("String_Node_Str").getNodeName()));
}
Program: 60162
Project: 60162
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(LABEL.equals(doc.getElementById("String_Node_Str").getNodeName()));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
  assertTrue(LABEL.equals(doc.getElementById("String_Node_Str").getNodeName()));
}
Program: 60163
Project: 60163
Buggy source:
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  String htmlSource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  HTMLDocumentImpl doc=loadPage(htmlSource);
}
Program: 60164
Project: 60164
Buggy source:
/** 
 * Determine SimpleDateFormat pattern matching with the given date string. Returns null if format is unknown. You can simply extend DateUtil with more formats if needed.
 * @param dateString The date string to determine the SimpleDateFormat pattern for.
 * @return The matching SimpleDateFormat pattern, or null if format is unknown.
 * @see SimpleDateFormat
 */
public Date determineDateFormat(String dateString,Locale loc){
  ArrayList<String> DATE_FORMAT=formatList();
  for (  String regexp : DATE_FORMAT) {
    try {
      return parse(dateString,regexp,loc);
    }
 catch (    ParseException e) {
      logger.error(e);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Determine SimpleDateFormat pattern matching with the given date string. Returns null if format is unknown. You can simply extend DateUtil with more formats if needed.
 * @param dateString The date string to determine the SimpleDateFormat pattern for.
 * @return The matching SimpleDateFormat pattern, or null if format is unknown.
 * @see SimpleDateFormat
 */
public Date determineDateFormat(String dateString,Locale loc){
  ArrayList<String> DATE_FORMAT=formatList();
  for (  String regexp : DATE_FORMAT) {
    try {
      return parse(dateString,regexp,loc);
    }
 catch (    ParseException e) {
      continue;
    }
  }
  return null;
}
Program: 60165
Project: 60165
Buggy source:
@Override public int getDisplay(){
  Integer d=this.iDisplay;
  if (d != null) {
    return d.intValue();
  }
  CSS2Properties props=this.getCssProperties();
  String displayText=props == null ? null : props.getDisplay();
  int displayInt=0;
  if (displayText != null) {
    String displayTextTL=displayText.toLowerCase();
switch (displayTextTL) {
case BLOCK:
      displayInt=DISPLAY_BLOCK;
    break;
case NONE:
  displayInt=DISPLAY_NONE;
break;
case LIST_ITEM:
displayInt=DISPLAY_LIST_ITEM;
break;
case TABLE:
displayInt=DISPLAY_TABLE;
break;
case TABLE_CELL:
displayInt=DISPLAY_TABLE_CELL;
break;
case TABLE_ROW:
displayInt=DISPLAY_TABLE_ROW;
break;
case INLINE_BLOCK:
displayInt=DISPLAY_INLINE_BLOCK;
break;
case INHERIT:
displayInt=this.getPreviousRenderState().getDisplay();
break;
case INITIAL:
displayInt=this.getDefaultDisplay();
break;
default :
displayInt=this.getDefaultDisplay();
break;
}
}
 else {
displayInt=this.getDefaultDisplay();
}
d=new Integer(displayInt);
this.iDisplay=d;
return displayInt;
}

Fixed version (ground truth):
@Override public int getDisplay(){
  Integer d=this.iDisplay;
  if (d != null) {
    return d.intValue();
  }
  CSS2Properties props=this.getCssProperties();
  String displayText=props == null ? null : props.getDisplay();
  int displayInt=0;
  if (displayText != null) {
    String displayTextTL=displayText.toLowerCase();
switch (displayTextTL) {
case BLOCK:
      displayInt=DISPLAY_BLOCK;
    break;
case NONE:
  displayInt=DISPLAY_NONE;
break;
case LIST_ITEM:
displayInt=DISPLAY_LIST_ITEM;
break;
case TABLE:
displayInt=DISPLAY_TABLE;
break;
case TABLE_CELL:
displayInt=DISPLAY_TABLE_CELL;
break;
case TABLE_ROW:
displayInt=DISPLAY_TABLE_ROW;
break;
case INLINE:
displayInt=DISPLAY_INLINE;
break;
case INLINE_BLOCK:
displayInt=DISPLAY_INLINE_BLOCK;
break;
case INHERIT:
displayInt=this.getPreviousRenderState().getDisplay();
break;
case INITIAL:
displayInt=this.getDefaultDisplay();
break;
default :
displayInt=this.getDefaultDisplay();
break;
}
}
 else {
displayInt=this.getDefaultDisplay();
}
d=new Integer(displayInt);
this.iDisplay=d;
return displayInt;
}
Program: 60167
Project: 60167
Buggy source:
@Override public BackgroundInfo getBackgroundInfo(){
  BackgroundInfo binfo=this.iBackgroundInfo;
  if (binfo != INVALID_BACKGROUND_INFO) {
    return binfo;
  }
  binfo=null;
  AbstractCSS2Properties props=this.getCssProperties();
  if (props != null) {
    String backgroundColorText=props.getBackgroundColor();
    if (backgroundColorText != null) {
      if (binfo == null) {
        binfo=new BackgroundInfo();
      }
      binfo.setBackgroundColor(ColorFactory.getInstance().getColor(backgroundColorText));
    }
    String backgroundImageText=props.getBackgroundImage();
    if ((backgroundImageText != null) && (backgroundImageText.length() > 0)) {
      URL backgroundImage=HtmlValues.getURIFromStyleValue(backgroundImageText);
      if (backgroundImage != null) {
        if (binfo == null) {
          binfo=new BackgroundInfo();
        }
        binfo.setBackgroundImage(backgroundImage);
      }
    }
    String backgroundRepeatText=props.getBackgroundRepeat();
    if (backgroundRepeatText != null) {
      if (binfo == null) {
        binfo=new BackgroundInfo();
      }
      this.applyBackgroundRepeat(binfo,backgroundRepeatText);
    }
    String backgroundPositionText=props.getBackgroundPosition();
    if (backgroundPositionText != null) {
      if (binfo == null) {
        binfo=new BackgroundInfo();
      }
      this.applyBackgroundPosition(binfo,backgroundPositionText);
    }
  }
  this.iBackgroundInfo=binfo;
  return binfo;
}

Fixed version (ground truth):
@Override public BackgroundInfo getBackgroundInfo(){
  BackgroundInfo binfo=this.iBackgroundInfo;
  if (binfo != INVALID_BACKGROUND_INFO) {
    return binfo;
  }
  AbstractCSS2Properties props=this.getCssProperties();
  if (props != null) {
    String backgroundColorText=props.getBackgroundColor();
    if (backgroundColorText != null) {
      if (binfo == null) {
        binfo=new BackgroundInfo();
      }
      binfo.setBackgroundColor(ColorFactory.getInstance().getColor(backgroundColorText));
    }
    String backgroundImageText=props.getBackgroundImage();
    if ((backgroundImageText != null) && (backgroundImageText.length() > 0)) {
      URL backgroundImage=HtmlValues.getURIFromStyleValue(backgroundImageText);
      if (backgroundImage != null) {
        if (binfo == null) {
          binfo=new BackgroundInfo();
        }
        binfo.setBackgroundImage(backgroundImage);
      }
    }
    String backgroundRepeatText=props.getBackgroundRepeat();
    if (backgroundRepeatText != null) {
      if (binfo == null) {
        binfo=new BackgroundInfo();
      }
      this.applyBackgroundRepeat(binfo,backgroundRepeatText);
    }
    String backgroundPositionText=props.getBackgroundPosition();
    if (backgroundPositionText != null) {
      if (binfo == null) {
        binfo=new BackgroundInfo();
      }
      this.applyBackgroundPosition(binfo,backgroundPositionText);
    }
  }
  this.iBackgroundInfo=binfo;
  return binfo;
}
Program: 60169
Project: 60169
Buggy source:
/** 
 * Apply background vertical position.
 * @param binfo the binfo
 * @param yposition the yposition
 */
private void applyBackgroundVerticalPosition(BackgroundInfo binfo,String yposition){
  if (yposition.endsWith("String_Node_Str")) {
    binfo.setBackgroundYPositionAbsolute(false);
    try {
      binfo.setBackgroundYPosition((int)Double.parseDouble(yposition.substring(0,yposition.length() - 1).trim()));
    }
 catch (    NumberFormatException nfe) {
      binfo.setBackgroundYPosition(0);
    }
  }
 else {
switch (yposition) {
case CENTER:
      binfo.setBackgroundYPositionAbsolute(false);
    binfo.setBackgroundYPosition(50);
case RIGHT:
  binfo.setBackgroundYPositionAbsolute(false);
binfo.setBackgroundYPosition(100);
case LEFT:
binfo.setBackgroundYPositionAbsolute(false);
binfo.setBackgroundYPosition(0);
case BOTTOM:
binfo.setBackgroundYPositionAbsolute(false);
binfo.setBackgroundYPosition(100);
case TOP:
binfo.setBackgroundYPositionAbsolute(false);
binfo.setBackgroundYPosition(0);
case INHERIT:
BackgroundInfo bi=this.getPreviousRenderState().getBackgroundInfo();
binfo.setBackgroundYPositionAbsolute(bi.isBackgroundYPositionAbsolute());
binfo.setBackgroundYPosition(bi.getBackgroundYPosition());
case INITIAL:
binfo.setBackgroundYPositionAbsolute(true);
binfo.setBackgroundYPosition(HtmlValues.getPixelSize(yposition,this,0));
default :
binfo.setBackgroundYPositionAbsolute(true);
binfo.setBackgroundYPosition(HtmlValues.getPixelSize(yposition,this,0));
}
}
}

Fixed version (ground truth):
/** 
 * Apply background vertical position.
 * @param binfo the binfo
 * @param yposition the yposition
 */
private void applyBackgroundVerticalPosition(BackgroundInfo binfo,String yposition){
  if (yposition.endsWith("String_Node_Str")) {
    binfo.setBackgroundYPositionAbsolute(false);
    try {
      binfo.setBackgroundYPosition((int)Double.parseDouble(yposition.substring(0,yposition.length() - 1).trim()));
    }
 catch (    NumberFormatException nfe) {
      binfo.setBackgroundYPosition(0);
    }
  }
 else {
switch (yposition) {
case CENTER:
      binfo.setBackgroundYPositionAbsolute(false);
    binfo.setBackgroundYPosition(50);
case RIGHT:
  binfo.setBackgroundYPositionAbsolute(false);
binfo.setBackgroundYPosition(100);
case LEFT:
binfo.setBackgroundYPositionAbsolute(false);
binfo.setBackgroundYPosition(0);
case BOTTOM:
binfo.setBackgroundYPositionAbsolute(false);
binfo.setBackgroundYPosition(100);
case TOP:
binfo.setBackgroundYPositionAbsolute(false);
binfo.setBackgroundYPosition(0);
case INHERIT:
BackgroundInfo bi=this.getPreviousRenderState().getBackgroundInfo();
if (bi != null) {
binfo.setBackgroundYPositionAbsolute(bi.isBackgroundYPositionAbsolute());
binfo.setBackgroundYPosition(bi.getBackgroundYPosition());
}
case INITIAL:
binfo.setBackgroundYPositionAbsolute(true);
binfo.setBackgroundYPosition(HtmlValues.getPixelSize(yposition,this,0));
default :
binfo.setBackgroundYPositionAbsolute(true);
binfo.setBackgroundYPosition(HtmlValues.getPixelSize(yposition,this,0));
}
}
}
Program: 60170
Project: 60170
Buggy source:
@Override public Color getColor(){
  Color c=this.iColor;
  if (c != null) {
    return c;
  }
  AbstractCSS2Properties props=this.getCssProperties();
  String colorValue=props == null ? null : props.getColor();
  if (INHERIT.equals(colorValue) && this.getPreviousRenderState() != null) {
    return this.getPreviousRenderState().getColor();
  }
 else   if (INITIAL.equals(colorValue)) {
    return getDefaultColor();
  }
 else   if ((colorValue == null) || "String_Node_Str".equals(colorValue)) {
    RenderState prs=this.prevRenderState;
    if (prs != null) {
      c=prs.getColor();
      this.iColor=c;
      return c;
    }
 else {
      this.iColor=getDefaultColor();
      return getDefaultColor();
    }
  }
  return c;
}

Fixed version (ground truth):
@Override public Color getColor(){
  Color c=this.iColor;
  if (c != null) {
    return c;
  }
  AbstractCSS2Properties props=this.getCssProperties();
  String colorValue=props == null ? null : props.getColor();
  if (INHERIT.equals(colorValue) && this.getPreviousRenderState() != null) {
    return this.getPreviousRenderState().getColor();
  }
 else   if (INITIAL.equals(colorValue)) {
    return getDefaultColor();
  }
 else   if ((colorValue == null) || "String_Node_Str".equals(colorValue)) {
    RenderState prs=this.prevRenderState;
    if (prs != null) {
      c=prs.getColor();
      this.iColor=c;
      return c;
    }
 else {
      this.iColor=getDefaultColor();
      return getDefaultColor();
    }
  }
 else {
    c=colorValue == null ? null : ColorFactory.getInstance().getColor(colorValue);
    this.iColor=c;
  }
  return c;
}