Program: 12569
Project: 12569
Buggy source:
@Override public long getSubProperties(TextureContext context,long currentProperties){
  long subProperties=getFeatureId();
  IProceduralWallFeature leftBlockFeature=ruinWallTexture.getValidFeature(context,getLayer(),TextureDirection.LEFT);
  IProceduralWallFeature rightBlockFeature=ruinWallTexture.getValidFeature(context,getLayer(),TextureDirection.RIGHT);
  IProceduralWallFeature aboveBlockFeature=ruinWallTexture.getValidFeature(context,getLayer(),TextureDirection.ABOVE);
  IProceduralWallFeature belowBlockFeature=ruinWallTexture.getValidFeature(context,getLayer(),TextureDirection.BELOW);
  if (!(leftBlockFeature instanceof PlateRuinWallFeature)) {
    subProperties|=ProceduralConnectedTexture.FEATURE_EDGE_LEFT;
  }
  if (!(rightBlockFeature instanceof PlateRuinWallFeature)) {
    subProperties|=ProceduralConnectedTexture.FEATURE_EDGE_RIGHT;
  }
  if (!(aboveBlockFeature instanceof PlateRuinWallFeature)) {
    subProperties|=ProceduralConnectedTexture.FEATURE_EDGE_TOP;
  }
  if (!(belowBlockFeature instanceof PlateRuinWallFeature)) {
    subProperties|=ProceduralConnectedTexture.FEATURE_EDGE_BOTTOM;
  }
  final long FEATURE_EDGE_TOP_AND_BOTTOM=ProceduralConnectedTexture.FEATURE_EDGE_TOP | ProceduralConnectedTexture.FEATURE_EDGE_BOTTOM;
  final long FEATURE_EDGE_LEFT_AND_RIGHT=ProceduralConnectedTexture.FEATURE_EDGE_LEFT | ProceduralConnectedTexture.FEATURE_EDGE_RIGHT;
  if ((subProperties & FEATURE_EDGE_TOP_AND_BOTTOM) == FEATURE_EDGE_TOP_AND_BOTTOM) {
    return 0;
  }
 else   if ((subProperties & FEATURE_EDGE_LEFT_AND_RIGHT) == FEATURE_EDGE_LEFT_AND_RIGHT) {
    return 0;
  }
  if (aboveBlockFeature instanceof PlateRuinWallFeature && leftBlockFeature instanceof PlateRuinWallFeature) {
    IProceduralWallFeature corner=ruinWallTexture.getValidFeature(context,getLayer(),TextureDirection.ABOVE,TextureDirection.LEFT);
    if (!(corner instanceof PlateRuinWallFeature)) {
      subProperties|=RuinWallTexture.FEATURE_PLATE_TL_CORNER;
    }
  }
  if (aboveBlockFeature instanceof PlateRuinWallFeature && rightBlockFeature instanceof PlateRuinWallFeature) {
    IProceduralWallFeature corner=ruinWallTexture.getValidFeature(context,getLayer(),TextureDirection.ABOVE,TextureDirection.RIGHT);
    if (!(corner instanceof PlateRuinWallFeature)) {
      subProperties|=RuinWallTexture.FEATURE_PLATE_TR_CORNER;
    }
  }
  if (belowBlockFeature instanceof PlateRuinWallFeature && leftBlockFeature instanceof PlateRuinWallFeature) {
    IProceduralWallFeature corner=ruinWallTexture.getValidFeature(context,getLayer(),TextureDirection.BELOW,TextureDirection.LEFT);
    if (!(corner instanceof PlateRuinWallFeature)) {
      subProperties|=RuinWallTexture.FEATURE_PLATE_BL_CORNER;
    }
  }
  if (belowBlockFeature instanceof PlateRuinWallFeature && rightBlockFeature instanceof PlateRuinWallFeature) {
    IProceduralWallFeature corner=ruinWallTexture.getValidFeature(context,getLayer(),TextureDirection.BELOW,TextureDirection.RIGHT);
    if (!(corner instanceof PlateRuinWallFeature)) {
      subProperties|=RuinWallTexture.FEATURE_PLATE_BR_CORNER;
    }
  }
  return subProperties;
}

Fixed version (ground truth):
@Override public long getSubProperties(TextureContext context,long currentProperties){
  long subProperties=getFeatureId();
  boolean isLeftBlockValid=ruinWallTexture.isBlockPartOfWallAndUnobstructed(context,TextureDirection.LEFT) && ruinWallTexture.isFeatureAtCoordCompatibleWith(context,getLayer(),this,TextureDirection.LEFT);
  boolean isRightBlockValid=ruinWallTexture.isBlockPartOfWallAndUnobstructed(context,TextureDirection.RIGHT) && ruinWallTexture.isFeatureAtCoordCompatibleWith(context,getLayer(),this,TextureDirection.RIGHT);
  boolean isAboveBlockValid=ruinWallTexture.isBlockPartOfWallAndUnobstructed(context,TextureDirection.ABOVE) && ruinWallTexture.isFeatureAtCoordCompatibleWith(context,getLayer(),this,TextureDirection.ABOVE);
  boolean isBelowBlockValid=ruinWallTexture.isBlockPartOfWallAndUnobstructed(context,TextureDirection.BELOW) && ruinWallTexture.isFeatureAtCoordCompatibleWith(context,getLayer(),this,TextureDirection.BELOW);
  if (!isLeftBlockValid) {
    subProperties|=ProceduralConnectedTexture.FEATURE_EDGE_LEFT;
  }
  if (!isRightBlockValid) {
    subProperties|=ProceduralConnectedTexture.FEATURE_EDGE_RIGHT;
  }
  if (!isAboveBlockValid) {
    subProperties|=ProceduralConnectedTexture.FEATURE_EDGE_TOP;
  }
  if (!isBelowBlockValid) {
    subProperties|=ProceduralConnectedTexture.FEATURE_EDGE_BOTTOM;
  }
  final long FEATURE_EDGE_TOP_AND_BOTTOM=ProceduralConnectedTexture.FEATURE_EDGE_TOP | ProceduralConnectedTexture.FEATURE_EDGE_BOTTOM;
  final long FEATURE_EDGE_LEFT_AND_RIGHT=ProceduralConnectedTexture.FEATURE_EDGE_LEFT | ProceduralConnectedTexture.FEATURE_EDGE_RIGHT;
  if ((subProperties & FEATURE_EDGE_TOP_AND_BOTTOM) == FEATURE_EDGE_TOP_AND_BOTTOM) {
    return 0;
  }
 else   if ((subProperties & FEATURE_EDGE_LEFT_AND_RIGHT) == FEATURE_EDGE_LEFT_AND_RIGHT) {
    return 0;
  }
  if (isAboveBlockValid && isLeftBlockValid) {
    boolean isCornerValid=ruinWallTexture.isBlockPartOfWallAndUnobstructed(context,TextureDirection.ABOVE,TextureDirection.LEFT) && ruinWallTexture.isFeatureAtCoordCompatibleWith(context,getLayer(),this,TextureDirection.ABOVE,TextureDirection.LEFT);
    if (!isCornerValid) {
      subProperties|=RuinWallTexture.FEATURE_PLATE_TL_CORNER;
    }
  }
  if (isAboveBlockValid && isRightBlockValid) {
    boolean isCornerValid=ruinWallTexture.isBlockPartOfWallAndUnobstructed(context,TextureDirection.ABOVE,TextureDirection.RIGHT) && ruinWallTexture.isFeatureAtCoordCompatibleWith(context,getLayer(),this,TextureDirection.ABOVE,TextureDirection.RIGHT);
    if (!isCornerValid) {
      subProperties|=RuinWallTexture.FEATURE_PLATE_TR_CORNER;
    }
  }
  if (isBelowBlockValid && isLeftBlockValid) {
    boolean isCornerValid=ruinWallTexture.isBlockPartOfWallAndUnobstructed(context,TextureDirection.BELOW,TextureDirection.LEFT) && ruinWallTexture.isFeatureAtCoordCompatibleWith(context,getLayer(),this,TextureDirection.BELOW,TextureDirection.LEFT);
    if (!isCornerValid) {
      subProperties|=RuinWallTexture.FEATURE_PLATE_BL_CORNER;
    }
  }
  if (isBelowBlockValid && isRightBlockValid) {
    boolean isCornerValid=ruinWallTexture.isBlockPartOfWallAndUnobstructed(context,TextureDirection.BELOW,TextureDirection.RIGHT) && ruinWallTexture.isFeatureAtCoordCompatibleWith(context,getLayer(),this,TextureDirection.BELOW,TextureDirection.RIGHT);
    if (!isCornerValid) {
      subProperties|=RuinWallTexture.FEATURE_PLATE_BR_CORNER;
    }
  }
  return subProperties;
}