NIHVIVO-3506 removed some old calls to printStackTrace()

This commit is contained in:
brianjlowe 2011-12-14 18:57:14 +00:00
parent a16f504315
commit 951dfe9d2c
19 changed files with 73 additions and 44 deletions

View file

@ -42,7 +42,8 @@ public class Classes2ClassesOperationController extends BaseEditController {
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException f) { } catch (IOException f) {
e.printStackTrace(); log.error(f, f);
throw new RuntimeException(f);
} }
return; return;
} }
@ -52,7 +53,8 @@ public class Classes2ClassesOperationController extends BaseEditController {
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
return; return;
} }
@ -115,7 +117,7 @@ public class Classes2ClassesOperationController extends BaseEditController {
} }
} }
} catch (Exception e) { } catch (Exception e) {
//e.printStackTrace(); log.error(e, e);
} }
} }
@ -127,13 +129,15 @@ public class Classes2ClassesOperationController extends BaseEditController {
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
} else { } else {
try { try {
response.sendRedirect(referer); response.sendRedirect(referer);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
} }

View file

@ -88,7 +88,7 @@ public class DatapropEditController extends BaseEditController {
try { try {
domainStr = (dp.getDomainClassURI() == null) ? "" : "<a href=\"vclassEdit?uri="+URLEncoder.encode(dp.getDomainClassURI(),"UTF-8")+"\">"+dp.getDomainClassURI()+"</a>"; domainStr = (dp.getDomainClassURI() == null) ? "" : "<a href=\"vclassEdit?uri="+URLEncoder.encode(dp.getDomainClassURI(),"UTF-8")+"\">"+dp.getDomainClassURI()+"</a>";
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
e.printStackTrace(); log.error(e, e);
} }
results.add(domainStr); results.add(domainStr);

View file

@ -145,7 +145,9 @@ public class EntityEditController extends BaseEditController {
} }
} }
OptionMap.put("externalIds", externalIdOptionList); OptionMap.put("externalIds", externalIdOptionList);
} catch (Exception e) {e.printStackTrace();} } catch (Exception e) {
log.error(e, e);
}
List classGroups = vreq.getFullWebappDaoFactory().getVClassGroupDao().getPublicGroupsWithVClasses(true,true,false); // order by displayRank, include uninstantiated classes, don't count the individuals List classGroups = vreq.getFullWebappDaoFactory().getVClassGroupDao().getPublicGroupsWithVClasses(true,true,false); // order by displayRank, include uninstantiated classes, don't count the individuals
Iterator classGroupIt = classGroups.iterator(); Iterator classGroupIt = classGroups.iterator();
@ -158,7 +160,9 @@ public class EntityEditController extends BaseEditController {
} }
try { try {
OptionMap.put("VClassURI", optGroupMap); OptionMap.put("VClassURI", optGroupMap);
} catch (Exception e) {e.printStackTrace();} } catch (Exception e) {
log.error(e, e);
}
PropertyInstanceDao piDao = vreq.getFullWebappDaoFactory().getPropertyInstanceDao(); PropertyInstanceDao piDao = vreq.getFullWebappDaoFactory().getPropertyInstanceDao();
// existing property statements // existing property statements
@ -173,7 +177,7 @@ public class EntityEditController extends BaseEditController {
} }
OptionMap.put("ExistingPropertyInstances", epiOptionList); OptionMap.put("ExistingPropertyInstances", epiOptionList);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error(e, e);
} }
// possible property statements // possible property statements
try { try {
@ -182,7 +186,7 @@ public class EntityEditController extends BaseEditController {
piList.addAll(piColl); piList.addAll(piColl);
OptionMap.put("PropertyURI", FormUtils.makeOptionListFromBeans(piList, "PropertyURI", "DomainPublic", (String)null, (String)null, false)); OptionMap.put("PropertyURI", FormUtils.makeOptionListFromBeans(piList, "PropertyURI", "DomainPublic", (String)null, (String)null, false));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error(e, e);
} }
foo.setOptionLists(OptionMap); foo.setOptionLists(OptionMap);

View file

@ -40,7 +40,8 @@ public class IndividualTypeOperationController extends BaseEditController {
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException f) { } catch (IOException f) {
e.printStackTrace(); log.error(f, f);
throw new RuntimeException(f);
} }
return; return;
} }
@ -50,7 +51,8 @@ public class IndividualTypeOperationController extends BaseEditController {
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
return; return;
} }
@ -71,7 +73,7 @@ public class IndividualTypeOperationController extends BaseEditController {
dao.addVClass(request.getParameter("individualURI"),request.getParameter("TypeURI")); dao.addVClass(request.getParameter("individualURI"),request.getParameter("TypeURI"));
} }
} catch (Exception e) { } catch (Exception e) {
//e.printStackTrace(); log.error(e, e);
} }
} }
@ -83,13 +85,15 @@ public class IndividualTypeOperationController extends BaseEditController {
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
} else { } else {
try { try {
response.sendRedirect(referer); response.sendRedirect(referer);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
} }

View file

@ -49,7 +49,8 @@ public class NamespacePrefixOperationController extends BaseEditController {
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException f) { } catch (IOException f) {
e.printStackTrace(); log.error(f, f);
throw new RuntimeException(f);
} }
return; return;
} }
@ -59,7 +60,8 @@ public class NamespacePrefixOperationController extends BaseEditController {
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
return; return;
} }
@ -127,13 +129,15 @@ public class NamespacePrefixOperationController extends BaseEditController {
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
} else { } else {
try { try {
response.sendRedirect(referer); response.sendRedirect(referer);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
} }

View file

@ -46,7 +46,8 @@ public class Properties2PropertiesOperationController extends
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException f) { } catch (IOException f) {
e.printStackTrace(); log.error(f, f);
throw new RuntimeException(f);
} }
return; return;
} }
@ -88,13 +89,15 @@ public class Properties2PropertiesOperationController extends
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
} else { } else {
try { try {
response.sendRedirect(referer); response.sendRedirect(referer);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
} }

View file

@ -82,7 +82,9 @@ public class PropertyEditController extends BaseEditController {
if (parent != null && parent.getURI() != null) { if (parent != null && parent.getURI() != null) {
try { try {
parentPropertyStr = "<a href=\"propertyEdit?uri="+URLEncoder.encode(parent.getURI(),"UTF-8")+"\">"+parent.getLocalNameWithPrefix()+"</a>"; parentPropertyStr = "<a href=\"propertyEdit?uri="+URLEncoder.encode(parent.getURI(),"UTF-8")+"\">"+parent.getLocalNameWithPrefix()+"</a>";
} catch (UnsupportedEncodingException e) {e.printStackTrace();} } catch (UnsupportedEncodingException e) {
log.error(e, e);
}
} }
} }
results.add(parentPropertyStr); // column 2 results.add(parentPropertyStr); // column 2
@ -97,7 +99,9 @@ public class PropertyEditController extends BaseEditController {
} else { } else {
domainStr = "<a href=\"vclassEdit?uri="+URLEncoder.encode(domainClass.getURI(),"UTF-8")+"\">"+domainClass.getLocalNameWithPrefix()+"</a>"; domainStr = "<a href=\"vclassEdit?uri="+URLEncoder.encode(domainClass.getURI(),"UTF-8")+"\">"+domainClass.getLocalNameWithPrefix()+"</a>";
} }
} catch (UnsupportedEncodingException e) {e.printStackTrace();} } catch (UnsupportedEncodingException e) {
log.error(e, e);
}
} }
} }
results.add(domainStr); // column 3 results.add(domainStr); // column 3
@ -112,7 +116,9 @@ public class PropertyEditController extends BaseEditController {
} else { } else {
rangeStr = "<a href=\"vclassEdit?uri="+URLEncoder.encode(rangeClass.getURI(),"UTF-8")+"\">"+rangeClass.getLocalNameWithPrefix()+"</a>"; rangeStr = "<a href=\"vclassEdit?uri="+URLEncoder.encode(rangeClass.getURI(),"UTF-8")+"\">"+rangeClass.getLocalNameWithPrefix()+"</a>";
} }
} catch (UnsupportedEncodingException e) {e.printStackTrace();} } catch (UnsupportedEncodingException e) {
log.error(e, e);
}
} }
} }
results.add(rangeStr); // column 4 results.add(rangeStr); // column 4

View file

@ -471,7 +471,8 @@ public class RefactorOperationController extends BaseEditController {
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
} catch (IOException f) { } catch (IOException f) {
e.printStackTrace(); log.error(f, f);
throw new RuntimeException(f);
} }
return; return;
} }
@ -507,7 +508,8 @@ public class RefactorOperationController extends BaseEditController {
try { try {
response.sendRedirect(redirectStr); response.sendRedirect(redirectStr);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error(e, e);
throw new RuntimeException(e);
} }
} }

View file

@ -191,12 +191,13 @@ public class RestrictionOperationController extends BaseEditController {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error(e, e);
try { try {
response.sendRedirect(defaultLandingPage); response.sendRedirect(defaultLandingPage);
return; return;
} catch (Exception f) { } catch (Exception f) {
e.printStackTrace(); log.error(f, f);
throw new RuntimeException(f);
} }
} }

View file

@ -181,7 +181,7 @@ public class VclassEditController extends BaseEditController {
} }
request.setAttribute("disjointClasses",djVClasses); request.setAttribute("disjointClasses",djVClasses);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error(e, e);
} }
try { try {
@ -200,7 +200,7 @@ public class VclassEditController extends BaseEditController {
request.setAttribute("equivalentClasses",eqVClasses); request.setAttribute("equivalentClasses",eqVClasses);
} catch (Exception e) { } catch (Exception e) {
log.error("Couldn't get the equivalent classes: "); log.error("Couldn't get the equivalent classes: ");
e.printStackTrace(); log.error(e, e);
} }
// add the options // add the options

View file

@ -319,7 +319,7 @@ public class IndividualDaoJena extends JenaBaseDao implements IndividualDao {
} }
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error(e, e);
} }
for (Iterator<String> oldIt = oldTypeURIsSet.iterator(); oldIt.hasNext();) { for (Iterator<String> oldIt = oldTypeURIsSet.iterator(); oldIt.hasNext();) {
String uri = oldIt.next(); String uri = oldIt.next();

View file

@ -618,7 +618,7 @@ public class IndividualJena extends IndividualImpl implements Individual {
else else
rv = 0; rv = 0;
} catch (NullPointerException e) { } catch (NullPointerException e) {
e.printStackTrace(); log.error(e, e);
} }
if( cAsc ) if( cAsc )

View file

@ -952,7 +952,7 @@ public class IndividualSDB extends IndividualImpl implements Individual {
else else
rv = 0; rv = 0;
} catch (NullPointerException e) { } catch (NullPointerException e) {
e.printStackTrace(); log.error(e, e);
} }
if( cAsc ) if( cAsc )

View file

@ -221,7 +221,7 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
p.setGroupURI(groupRes.getURI()); p.setGroupURI(groupRes.getURI());
} }
} catch (Throwable t) { } catch (Throwable t) {
t.printStackTrace(); log.error(t, t);
} }
return p; return p;
} }
@ -401,7 +401,7 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
try { try {
doUpdate(prop,p,inv,ontModel); doUpdate(prop,p,inv,ontModel);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error(e, e);
} }
} finally { } finally {
getOntModel().getBaseModel().notifyEvent(new EditEvent(getWebappDaoFactory().getUserURI(),false)); getOntModel().getBaseModel().notifyEvent(new EditEvent(getWebappDaoFactory().getUserURI(),false));

View file

@ -105,7 +105,7 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec
try { try {
objPropertyStmt.setObjectURI(((Resource)st.getObject()).getURI()); objPropertyStmt.setObjectURI(((Resource)st.getObject()).getURI());
} catch (Throwable t) { } catch (Throwable t) {
t.printStackTrace(); log.error(t, t);
} }
objPropertyStmt.setPropertyURI(st.getPredicate().getURI()); objPropertyStmt.setPropertyURI(st.getPredicate().getURI());
try { try {
@ -137,7 +137,7 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec
objPropertyStmtList.add(objPropertyStmt); objPropertyStmtList.add(objPropertyStmt);
} }
} catch (Throwable t) { } catch (Throwable t) {
t.printStackTrace(); log.error(t, t);
} }
} }
} }

View file

@ -112,7 +112,9 @@ public class VClassDaoSDB extends VClassDaoJena {
group.add(vcw); group.add(vcw);
} }
} }
} catch (ClassCastException cce) {cce.printStackTrace();} } catch (ClassCastException cce) {
log.error(cce, cce);
}
} }
} finally { } finally {
annotIt.close(); annotIt.close();

View file

@ -166,7 +166,7 @@ public class VitroJenaSDBModelMaker implements ModelMaker {
qe.execAsk(); qe.execAsk();
return true; return true;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error(e, e);
return false; return false;
} finally { } finally {
qe.close(); qe.close();

View file

@ -392,8 +392,7 @@ public class PelletListener implements ModelChangedListener {
localRemovalQueue.clear(); localRemovalQueue.clear();
} catch (Exception e) { } catch (Exception e) {
log.error("Exception in "+this.getClass().getName()+".getInferences()"); log.error("Error getting inferences", e);
e.printStackTrace();
} }
tempModel = null; tempModel = null;
} }

View file

@ -293,7 +293,7 @@ public class JenaIngestUtils {
processor = stringProcessorClass.newInstance(); processor = stringProcessorClass.newInstance();
meth = stringProcessorClass.getMethod(processorMethod,methArgs); meth = stringProcessorClass.getMethod(processorMethod,methArgs);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error(e, e);
return; return;
} }
Property prop = ResourceFactory.createProperty(originalPropertyURI); Property prop = ResourceFactory.createProperty(originalPropertyURI);
@ -314,7 +314,7 @@ public class JenaIngestUtils {
} }
newLex = (String) meth.invoke(processor,args); newLex = (String) meth.invoke(processor,args);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error(e, e);
return; return;
} }
if (!newLex.equals(lex)) { if (!newLex.equals(lex)) {