Program: 178016
Project: 178016
Buggy source:
/** 
 * Publish a zipped shapefile. <P>These are the equivalent calls with cUrl: <PRE>  {@code curl -u admin:geoserver -XPUT -H 'Content-type: application/zip' \ --data-binary @$ZIPFILE \ http://$GSIP:$GSPORT/$SERVLET/rest/workspaces/$WORKSPACE/datastores/$STORENAME/file.shp curl -u admin:geoserver -XPOST -H 'Content-type: text/xml'  \ -d "<featureType><name>$BARE</name><nativeCRS>EPSG:4326</nativeCRS><enabled>true</enabled></featureType>"  \ http://$GSIP:$GSPORT/$SERVLET/rest/workspaces/$WORKSPACE/datastores/$STORENAME/featuretypes/$LAYERNAME}</PRE>
 * @return true if the operation completed successfully.
 */
public boolean publishShp(String workspace,String storename,String layername,File zipFile,String srs) throws FileNotFoundException {
  StringBuilder sbUrl=new StringBuilder(restURL).append("String_Node_Str").append(workspace).append("String_Node_Str").append(storename).append("String_Node_Str");
  String sentResult=HTTPUtils.put(sbUrl.toString(),zipFile,"String_Node_Str",gsuser,gspass);
  boolean shpSent=sentResult != null;
  if (shpSent) {
    LOGGER.info("String_Node_Str" + layername + "String_Node_Str"+ zipFile+ "String_Node_Str");
    StringBuilder postUrl=new StringBuilder(restURL).append("String_Node_Str").append(workspace).append("String_Node_Str").append(storename).append("String_Node_Str").append(layername);
    GSFeatureTypeEncoder fte=new GSFeatureTypeEncoder();
    fte.addName(layername);
    fte.addSRS(srs);
    fte.addProjectionPolicy(ProjectionPolicy.REPROJECT_TO_DECLARED);
    String configuredResult=HTTPUtils.putXml(postUrl.toString(),fte.toString(),this.gsuser,this.gspass);
    boolean shpConfigured=configuredResult != null;
    if (!shpConfigured) {
      LOGGER.warn("String_Node_Str" + workspace + "String_Node_Str"+ storename+ "String_Node_Str"+ layername+ "String_Node_Str"+ zipFile);
    }
 else {
      LOGGER.info("String_Node_Str" + layername + "String_Node_Str");
    }
    return shpConfigured;
  }
 else {
    LOGGER.warn("String_Node_Str" + workspace + "String_Node_Str"+ storename+ "String_Node_Str"+ layername+ "String_Node_Str"+ zipFile);
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Publish a zipped shapefile. <P> These are the equivalent calls with cUrl: <PRE>  {@code curl -u admin:geoserver -XPUT -H 'Content-type: application/zip' \ --data-binary @$ZIPFILE \ http://$GSIP:$GSPORT/$SERVLET/rest/workspaces/$WORKSPACE/datastores/$STORENAME/file.shp curl -u admin:geoserver -XPOST -H 'Content-type: text/xml'  \ -d "<featureType><name>$BARE</name><nativeCRS>EPSG:4326</nativeCRS><enabled>true</enabled></featureType>"  \ http://$GSIP:$GSPORT/$SERVLET/rest/workspaces/$WORKSPACE/datastores/$STORENAME/featuretypes/$LAYERNAME}</PRE>
 * @return true if the operation completed successfully.
 */
public boolean publishShp(String workspace,String storename,String layername,File zipFile,String srs) throws FileNotFoundException {
  StringBuilder sbUrl=new StringBuilder(restURL).append("String_Node_Str").append(workspace).append("String_Node_Str").append(storename).append("String_Node_Str");
  String sentResult=HTTPUtils.put(sbUrl.toString(),zipFile,"String_Node_Str",gsuser,gspass);
  boolean shpSent=sentResult != null;
  if (shpSent) {
    LOGGER.info("String_Node_Str" + layername + "String_Node_Str"+ zipFile+ "String_Node_Str");
    StringBuilder postUrl=new StringBuilder(restURL).append("String_Node_Str").append(workspace).append("String_Node_Str").append(storename).append("String_Node_Str").append(layername);
    GSFeatureTypeEncoder fte=new GSFeatureTypeEncoder();
    fte.addName(layername);
    fte.addSRS(srs);
    fte.addProjectionPolicy(ProjectionPolicy.REPROJECT_TO_DECLARED);
    String configuredResult=HTTPUtils.putXml(postUrl.toString(),fte.toString(),this.gsuser,this.gspass);
    boolean shpConfigured=configuredResult != null;
    if (!shpConfigured) {
      LOGGER.warn("String_Node_Str" + workspace + "String_Node_Str"+ storename+ "String_Node_Str"+ layername+ "String_Node_Str"+ zipFile);
    }
 else {
      LOGGER.info("String_Node_Str" + layername + "String_Node_Str");
    }
    return shpConfigured;
  }
 else {
    LOGGER.warn("String_Node_Str" + workspace + "String_Node_Str"+ storename+ "String_Node_Str"+ layername+ "String_Node_Str"+ zipFile);
    return false;
  }
}