Small bug fixes from static analysis
This commit is contained in:
parent
38f79971d6
commit
d737f86084
8 changed files with 22 additions and 22 deletions
|
@ -22,18 +22,18 @@ public class Classes2Classes {
|
|||
public void setSuperclassURI(String in){ superclassURI=in;}
|
||||
|
||||
public String getSuperclassNamespace(){ return superclassNamespace; }
|
||||
public void setSuperclassNamespace(){ this.superclassNamespace=superclassNamespace;}
|
||||
public void setSuperclassNamespace(String superclassNamespace){ this.superclassNamespace=superclassNamespace;}
|
||||
|
||||
public String getSuperclassLocalName(){ return superclassLocalName; }
|
||||
public void setSuperclassLocalName(){ this.superclassLocalName=superclassLocalName;}
|
||||
public void setSuperclassLocalName(String superclassLocalName){ this.superclassLocalName=superclassLocalName;}
|
||||
|
||||
public String getSubclassURI(){ return subclassURI;}
|
||||
public void setSubclassURI(String in){ subclassURI=in;}
|
||||
|
||||
public String getSubclassNamespace(){ return subclassNamespace; }
|
||||
public void setSubclassNamespace(){ this.subclassNamespace=subclassNamespace;}
|
||||
public void setSubclassNamespace(String subclassNamespace){ this.subclassNamespace=subclassNamespace;}
|
||||
|
||||
public String getSubclassLocalName(){ return subclassLocalName; }
|
||||
public void setSubclassLocalName(){ this.subclassLocalName=subclassLocalName;}
|
||||
public void setSubclassLocalName(String subclassLocalName){ this.subclassLocalName=subclassLocalName;}
|
||||
|
||||
}
|
|
@ -356,7 +356,7 @@ public class IndividualRdfAssembler {
|
|||
}
|
||||
|
||||
private Literal createDateLiteral(OntModel o) {
|
||||
String date = new SimpleDateFormat("YYYY-MM-dd'T'HH:mm:ss")
|
||||
String date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss")
|
||||
.format(new Date());
|
||||
return o.createTypedLiteral(date, XSDDatatype.XSDdateTime);
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ public class JenaXMLFileUpload extends JenaIngestController {
|
|||
} catch (Exception e) {
|
||||
System.out.println(this.getClass().getName()+" could not forward to view.");
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println(e.getStackTrace());
|
||||
e.printStackTrace(System.out);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,7 @@ public class JenaXMLFileUpload extends JenaIngestController {
|
|||
} catch (Exception e) {
|
||||
System.out.println(this.getClass().getName()+" could not forward to view.");
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println(e.getStackTrace());
|
||||
e.printStackTrace(System.out);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -271,7 +271,7 @@ public class BasicValidationVTwo {
|
|||
if( unknown.isEmpty() )
|
||||
return ;
|
||||
|
||||
throw new Error( "Unknown basic validators: " + unknown.toArray());
|
||||
throw new Error( "Unknown basic validators: " + Arrays.toString(unknown.toArray()));
|
||||
}
|
||||
|
||||
private static boolean isEmpty(String value) {
|
||||
|
|
|
@ -34,14 +34,14 @@ public class IndividualURIQueue<E> implements Queue<E> {
|
|||
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
return m.contains(o);
|
||||
return m.containsKey(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsAll(Collection<?> c) {
|
||||
boolean contains = true;
|
||||
for(Object e : c) {
|
||||
contains |= m.contains(e);
|
||||
contains |= m.containsKey(e);
|
||||
}
|
||||
return contains;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.apache.commons.logging.LogFactory;
|
|||
|
||||
import org.apache.jena.ontology.OntModel;
|
||||
import org.apache.jena.ontology.OntModelSpec;
|
||||
import org.apache.jena.rdf.model.AnonId;
|
||||
import org.apache.jena.rdf.model.Literal;
|
||||
import org.apache.jena.rdf.model.Model;
|
||||
import org.apache.jena.rdf.model.ModelFactory;
|
||||
|
@ -72,7 +73,7 @@ public class JenaIngestUtils {
|
|||
// the dedupUnionModel is so we can guard against reusing a URI in an
|
||||
// existing model, as well as in the course of running this process
|
||||
inModel.enterCriticalSection(Lock.READ);
|
||||
Set<String> doneSet = new HashSet<String>();
|
||||
Set<AnonId> doneSet = new HashSet<AnonId>();
|
||||
try {
|
||||
outModel.add(inModel);
|
||||
ClosableIterator closeIt = inModel.listSubjects();
|
||||
|
@ -93,7 +94,7 @@ public class JenaIngestUtils {
|
|||
if (stmt != null) {
|
||||
Resource outRes = stmt.getSubject();
|
||||
ResourceUtils.renameResource(outRes,getNextURI(namespaceEtc,dedupUnionModel));
|
||||
doneSet.add(res.getId().toString());
|
||||
doneSet.add(res.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +121,7 @@ public class JenaIngestUtils {
|
|||
if (stmt != null) {
|
||||
Resource outRes = stmt.getSubject();
|
||||
ResourceUtils.renameResource(outRes,getNextURI(namespaceEtc, dedupUnionModel));
|
||||
doneSet.add(res.getId().toString());
|
||||
doneSet.add(res.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +146,7 @@ public class JenaIngestUtils {
|
|||
// the dedupUnionModel is so we can guard against reusing a URI in an
|
||||
// existing model, as well as in the course of running this process
|
||||
inModel.enterCriticalSection(Lock.READ);
|
||||
Set<String> doneSet = new HashSet<String>();
|
||||
Set<AnonId> doneSet = new HashSet<AnonId>();
|
||||
|
||||
try {
|
||||
outModel.add(inModel);
|
||||
|
@ -173,7 +174,7 @@ public class JenaIngestUtils {
|
|||
: pattern + value;
|
||||
ResourceUtils.renameResource(outRes, namespaceEtc + suffix);
|
||||
}
|
||||
doneSet.add(res.getId().toString());
|
||||
doneSet.add(res.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -191,13 +192,13 @@ public class JenaIngestUtils {
|
|||
|
||||
public Map<String, LinkedList<String>> generatePropertyMap(List<Model> sourceModels, ModelMaker maker){
|
||||
Map<String,LinkedList<String>> propertyMap = Collections.synchronizedMap(new HashMap<String, LinkedList<String>>());
|
||||
Set<String> doneList = new HashSet<String>();
|
||||
Set<AnonId> doneSet = new HashSet<AnonId>();
|
||||
for(Model model : sourceModels) {
|
||||
ClosableIterator cItr = model.listSubjects();
|
||||
while(cItr.hasNext()){
|
||||
Resource res = (Resource) cItr.next();
|
||||
if(res.isAnon() && !doneList.contains(res.getId())){
|
||||
doneList.add(res.getId().toString());
|
||||
if(res.isAnon() && !doneSet.contains(res.getId())){
|
||||
doneSet.add(res.getId());
|
||||
StmtIterator stmtItr = model.listStatements(res, (Property)null, (RDFNode)null);
|
||||
while(stmtItr.hasNext()){
|
||||
Statement stmt = stmtItr.next();
|
||||
|
@ -220,8 +221,8 @@ public class JenaIngestUtils {
|
|||
RDFNode rdfn = (RDFNode) cItr.next();
|
||||
if(rdfn.isResource()){
|
||||
Resource res = (Resource)rdfn;
|
||||
if(res.isAnon() && !doneList.contains(res.getId())){
|
||||
doneList.add(res.getId().toString());
|
||||
if(res.isAnon() && !doneSet.contains(res.getId())){
|
||||
doneSet.add(res.getId());
|
||||
StmtIterator stmtItr = model.listStatements(res, (Property)null, (RDFNode)null);
|
||||
while(stmtItr.hasNext()){
|
||||
Statement stmt = stmtItr.next();
|
||||
|
|
|
@ -70,7 +70,7 @@ public class VitroBackgroundThread extends Thread {
|
|||
|
||||
public void setWorkLevel(WorkLevel level, String... flags) {
|
||||
log.debug("Set work level on '" + this.getName() + "' to " + level
|
||||
+ ", flags=" + flags);
|
||||
+ ", flags=" + Arrays.toString(flags));
|
||||
stamp = new WorkLevelStamp(level, flags);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
|
|||
propertyUri = property.getURI();
|
||||
localName = property.getLocalName();
|
||||
this.name = name;
|
||||
this.displayLimit = displayLimit;
|
||||
addUrl = "";
|
||||
|
||||
fauxProperty = isFauxProperty(property);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue