fix issued from codacy
This commit is contained in:
parent
acf6460ea2
commit
a204809f3d
@ -79,7 +79,7 @@ public class ProjectMetadata implements Jsonizable {
|
||||
private Map<String, Serializable> _customMetadata = new HashMap<String, Serializable>();
|
||||
private PreferenceStore _preferenceStore = new PreferenceStore();
|
||||
|
||||
final static Logger logger = LoggerFactory.getLogger("project_metadata");
|
||||
private final static Logger logger = LoggerFactory.getLogger("project_metadata");
|
||||
|
||||
protected ProjectMetadata(Date date) {
|
||||
_created = date;
|
||||
|
@ -6,10 +6,7 @@ import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONTokener;
|
||||
import org.json.JSONWriter;
|
||||
|
||||
import com.google.refine.ProjectManager;
|
||||
import com.google.refine.ProjectMetadata;
|
||||
@ -35,9 +32,6 @@ public class SetProjectMetaDataCommand extends Command {
|
||||
try {
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setHeader("Content-Type", "application/json");
|
||||
JSONWriter writer = new JSONWriter(response.getWriter());
|
||||
|
||||
Object o = StringUtils.isEmpty(valueString) ? null : new JSONTokener(valueString).nextValue();
|
||||
|
||||
meta.setAnyField(metaName, valueString);
|
||||
ProjectManager.singleton.saveMetadata(meta, project.id);
|
||||
|
@ -45,7 +45,6 @@ import java.util.Properties;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.tools.tar.TarEntry;
|
||||
import org.apache.tools.tar.TarInputStream;
|
||||
import org.apache.tools.tar.TarOutputStream;
|
||||
|
@ -37,7 +37,7 @@ function EditMetadataDialog(metaData, targetRowElem) {
|
||||
|
||||
Refine.OpenProjectUI.refreshProject(targetRowElem, metaData);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
this._createDialog();
|
||||
}
|
||||
@ -81,11 +81,11 @@ EditMetadataDialog.prototype._createDialog = function() {
|
||||
for (var k in flatMetaData) {
|
||||
var tr = metadataTable.insertRow(metadataTable.rows.length);
|
||||
|
||||
if (typeof flatMetaData[k] === 'string')
|
||||
if (typeof flatMetaData[k] === 'string') {
|
||||
v = flatMetaData[k].replace(/\"/g, "");
|
||||
else
|
||||
} else {
|
||||
v = JSON.stringify(flatMetaData[k]);
|
||||
|
||||
}
|
||||
|
||||
this._metaDataUIs.push(new this._MetaDataUI(tr, k, v, flatMetaData.id));
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
|
||||
.appendTo($(tr.insertCell(tr.cells.length)).attr('width', '10%'));
|
||||
|
||||
var appendMetaField = function(data, width) {
|
||||
var width = width || '1%';
|
||||
width = width || '1%';
|
||||
$('<div></div>')
|
||||
.html(data)
|
||||
.appendTo($(tr.insertCell(tr.cells.length)).attr('width', width));
|
||||
@ -248,9 +248,6 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
|
||||
appendMetaField(data[i].value);
|
||||
}
|
||||
}
|
||||
console.log('===================');
|
||||
console.log(JSON.stringify(project));
|
||||
// END TODO
|
||||
|
||||
$(tr).mouseenter(function() {
|
||||
renameLink.css("visibility", "visible");
|
||||
@ -336,7 +333,7 @@ Refine.OpenProjectUI.refreshProject = function(tr, metaData) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Refine.actionAreas.push({
|
||||
id: "open-project",
|
||||
|
Loading…
Reference in New Issue
Block a user