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 {
response.sendRedirect(defaultLandingPage);
} catch (IOException f) {
e.printStackTrace();
log.error(f, f);
throw new RuntimeException(f);
}
return;
}
@ -52,7 +53,8 @@ public class Classes2ClassesOperationController extends BaseEditController {
try {
response.sendRedirect(defaultLandingPage);
} catch (IOException e) {
e.printStackTrace();
log.error(e, e);
throw new RuntimeException(e);
}
return;
}
@ -115,7 +117,7 @@ public class Classes2ClassesOperationController extends BaseEditController {
}
}
} catch (Exception e) {
//e.printStackTrace();
log.error(e, e);
}
}
@ -127,13 +129,15 @@ public class Classes2ClassesOperationController extends BaseEditController {
try {
response.sendRedirect(defaultLandingPage);
} catch (IOException e) {
e.printStackTrace();
log.error(e, e);
throw new RuntimeException(e);
}
} else {
try {
response.sendRedirect(referer);
} 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 {
domainStr = (dp.getDomainClassURI() == null) ? "" : "<a href=\"vclassEdit?uri="+URLEncoder.encode(dp.getDomainClassURI(),"UTF-8")+"\">"+dp.getDomainClassURI()+"</a>";
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
log.error(e, e);
}
results.add(domainStr);

View file

@ -145,7 +145,9 @@ public class EntityEditController extends BaseEditController {
}
}
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
Iterator classGroupIt = classGroups.iterator();
@ -158,7 +160,9 @@ public class EntityEditController extends BaseEditController {
}
try {
OptionMap.put("VClassURI", optGroupMap);
} catch (Exception e) {e.printStackTrace();}
} catch (Exception e) {
log.error(e, e);
}
PropertyInstanceDao piDao = vreq.getFullWebappDaoFactory().getPropertyInstanceDao();
// existing property statements
@ -173,7 +177,7 @@ public class EntityEditController extends BaseEditController {
}
OptionMap.put("ExistingPropertyInstances", epiOptionList);
} catch (Exception e) {
e.printStackTrace();
log.error(e, e);
}
// possible property statements
try {
@ -182,7 +186,7 @@ public class EntityEditController extends BaseEditController {
piList.addAll(piColl);
OptionMap.put("PropertyURI", FormUtils.makeOptionListFromBeans(piList, "PropertyURI", "DomainPublic", (String)null, (String)null, false));
} catch (Exception e) {
e.printStackTrace();
log.error(e, e);
}
foo.setOptionLists(OptionMap);

View file

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

View file

@ -46,7 +46,8 @@ public class Properties2PropertiesOperationController extends
try {
response.sendRedirect(defaultLandingPage);
} catch (IOException f) {
e.printStackTrace();
log.error(f, f);
throw new RuntimeException(f);
}
return;
}
@ -88,13 +89,15 @@ public class Properties2PropertiesOperationController extends
try {
response.sendRedirect(defaultLandingPage);
} catch (IOException e) {
e.printStackTrace();
log.error(e, e);
throw new RuntimeException(e);
}
} else {
try {
response.sendRedirect(referer);
} 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) {
try {
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
@ -97,7 +99,9 @@ public class PropertyEditController extends BaseEditController {
} else {
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
@ -112,7 +116,9 @@ public class PropertyEditController extends BaseEditController {
} else {
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

View file

@ -471,7 +471,8 @@ public class RefactorOperationController extends BaseEditController {
try {
response.sendRedirect(defaultLandingPage);
} catch (IOException f) {
e.printStackTrace();
log.error(f, f);
throw new RuntimeException(f);
}
return;
}
@ -507,7 +508,8 @@ public class RefactorOperationController extends BaseEditController {
try {
response.sendRedirect(redirectStr);
} 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) {
e.printStackTrace();
log.error(e, e);
try {
response.sendRedirect(defaultLandingPage);
return;
} 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);
} catch (Exception e) {
e.printStackTrace();
log.error(e, e);
}
try {
@ -200,7 +200,7 @@ public class VclassEditController extends BaseEditController {
request.setAttribute("equivalentClasses",eqVClasses);
} catch (Exception e) {
log.error("Couldn't get the equivalent classes: ");
e.printStackTrace();
log.error(e, e);
}
// add the options

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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