List of usage examples for java.lang IllegalArgumentException printStackTrace
public void printStackTrace()
From source file:de.fuberlin.wiwiss.marbles.dataproviders.FalconsProvider.java
public List<URI> getURLsFromData(CacheController cacheController, RepositoryConnection conn, Resource resource) {/*from w w w . j a v a2 s.c o m*/ String lookupURL; Resource lookupURLContext; List<Statement> statementsList = null; List<URI> urlsToBeFetched = new ArrayList<URI>(); if (null == (lookupURL = getFalconsLookupURL(resource))) return null; String redirectURL = cacheController.getCachedRedirect(lookupURL); try { lookupURLContext = new URIImpl(redirectURL != null ? redirectURL : lookupURL); } catch (IllegalArgumentException e) { e.printStackTrace(); return null; } RepositoryResult<Statement> statements; try { statements = conn.getStatements(null, RDFS.SEEALSO, null, true, lookupURLContext); statementsList = Iterations.addAll(statements, new ArrayList<Statement>()); statements.close(); } catch (RepositoryException e1) { e1.printStackTrace(); return null; } for (Statement st : statementsList) { Value obj = st.getObject(); if (obj instanceof org.openrdf.model.URI && !urlsToBeFetched.contains(obj.toString())) try { urlsToBeFetched.add(new URI(obj.toString(), true)); } catch (URIException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); } } return urlsToBeFetched; }
From source file:org.kuali.rice.core.framework.persistence.jpa.CompositePrimaryKeyBase.java
public int hashCode() { HashCodeBuilder hashCodeBuilder = new HashCodeBuilder(); Class thisClass = (this.getClass()); Method[] methods = thisClass.getMethods(); //need to sort methods so we can be sure they are ordered correctly every time. Arrays.sort(methods, new Comparator() { public int compare(Object a, Object b) { return ((Method) a).getName().compareTo(((Method) b).getName()); }// w ww . ja va 2 s .c o m }); for (Method method : methods) { if (isGetter(method)) { try { hashCodeBuilder.append(method.invoke(this)); } catch (IllegalArgumentException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InvocationTargetException ex) { ex.printStackTrace(); } } } return hashCodeBuilder.toHashCode(); }
From source file:de.fuberlin.wiwiss.marbles.dataproviders.SindiceProvider.java
public List<URI> getURLsFromData(CacheController cacheController, RepositoryConnection conn, Resource resource) {/* w w w.j a va 2s. c o m*/ String lookupURL; Resource lookupURLContext; List<Statement> statementsList = null; List<URI> urlsToBeFetched = new ArrayList<URI>(); if (null == (lookupURL = getSindiceLookupURL(resource))) return null; String redirectURL = cacheController.getCachedRedirect(lookupURL); try { lookupURLContext = new URIImpl(redirectURL != null ? redirectURL : lookupURL); } catch (IllegalArgumentException e) { e.printStackTrace(); return null; } RepositoryResult<Statement> statements; try { statements = conn.getStatements(null, new URIImpl(Constants.nsSindiceVocab + "link"), null, true, lookupURLContext); statementsList = Iterations.addAll(statements, new ArrayList<Statement>()); statements.close(); } catch (RepositoryException e1) { e1.printStackTrace(); return null; } for (Statement st : statementsList) { Value obj = st.getObject(); if (obj instanceof org.openrdf.model.URI && !urlsToBeFetched.contains(obj.toString())) try { urlsToBeFetched.add(new URI(obj.toString(), true)); } catch (URIException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); } } return urlsToBeFetched; }
From source file:com.francetelecom.rd.app.nodessimulator.devices.Shutter.java
@SuppressLint("UseValueOf") public void addDefaultRules() { try {//from w ww . j av a 2 s . c o m Condition condition = DeviceManager.getInstance().getHomeBusFactory() .createCondition(Condition.OPERATOR_EQUAL, new Integer(100), RESOURCE_LEVEL_PATH); Rule rule = DeviceManager.getInstance().getHomeBusFactory().createRule("test", condition, "TestCondition", "", false, this.id); connector.addRule(rule); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (HomeBusException e) { e.printStackTrace(); } }
From source file:org.kalypso.model.wspm.tuhh.core.profile.profileobjects.building.BuildingWehrProvider.java
private WeirType toWeirType(final String wehrart) { if (StringUtils.isBlank(wehrart)) return BuildingWehr.DEFAULT_WEIRTYPE; /* backwards compatibility: old constants */ switch (wehrart) { case "org.kalypso.model.wspm.core.profil.IProfil.WEHR_TYP_BEIWERT": //$NON-NLS-1$ return WeirType.beiwert; case "org.kalypso.model.wspm.core.profil.IProfil.WEHR_TYP_BREITKRONIG": //$NON-NLS-1$ return WeirType.breitkronig; case "org.kalypso.model.wspm.core.profil.IProfil.WEHR_TYP_RUNDKRONIG": //$NON-NLS-1$ return WeirType.rundkronig; case "org.kalypso.model.wspm.core.profil.IProfil.WEHR_TYP_SCHARFKANTIG": //$NON-NLS-1$ return WeirType.scharfkantig; }//from w w w . j a va 2s . c o m try { return WeirType.valueOf(wehrart); } catch (final IllegalArgumentException e) { e.printStackTrace(); return BuildingWehr.DEFAULT_WEIRTYPE; } }
From source file:org.kepler.Kepler.java
/** Run the appropriate application based on command line arguments. */ public static int runApplication() { try {/*from www . ja v a 2s . com*/ // see if we're running the gui editor if (_action == Action.Kepler) { addActorModule("org/kepler/ActorModuleDefault"); initialize(); _applicationArgsList.addFirst("-kepler"); String[] loadArgs = _applicationArgsList.toArray(new String[0]); if (_showSplash) { SplashWindow.invokeMain("ptolemy.vergil.VergilApplication", loadArgs); SplashWindow.disposeSplash(); } else { VergilApplication.main(loadArgs); } // check for patches now that the UI has started. PatchChecker.check(false); } else if (_action == Action.Vergil) { addActorModule("org/kepler/ActorModuleDefault"); String[] loadArgs = _applicationArgsList.toArray(new String[0]); VergilApplication.main(loadArgs); } else if (_action == Action.RunWf || _action == Action.RunKAR) { String className = null; // if we are running a workflow from the cmd line and have // the gui enabled, the program does not quit until the user // enters control-c. if (_runWithGui) { _mustManuallyQuit = true; } addActorModule("org/kepler/ActorModuleDefault"); if (_runWithGui && _runWithCache) { if (_action == Action.RunKAR) { if (_applicationArgsList.getLast().endsWith(".xml")) { throw new IllegalArgumentException( "ERROR: -runkar " + "can only be used to run kar file, not xml file." + "to run xml file, please use -runwf option"); } className = "org.kepler.KeplerConfigurationApplication"; _applicationArgsList.addFirst("-run"); _applicationArgsList.addFirst("ptolemy/configs/kepler/ConfigGUIAndCache.xml"); } else { // _action == Action.RunWf if (_applicationArgsList.getLast().endsWith(".kar")) { throw new IllegalArgumentException( "ERROR: -runwf " + "can only be used to run xml file, not kar file." + " To run kar file, please use -runkar option"); } className = "ptolemy.actor.gui.PtExecuteApplication"; _applicationArgsList.addFirst("ptolemy/configs/kepler/ConfigGUIAndCache.xml"); _applicationArgsList.addFirst("-conf"); } } else if (_runWithGui && !_runWithCache) { if (_applicationArgsList.getLast().endsWith(".kar")) { throw new IllegalArgumentException( "ERROR: -runkar " + "cannot be used with -nocache option." + " Please remove nocache option and try again."); } className = "ptolemy.actor.gui.PtExecuteApplication"; _applicationArgsList.addFirst("ptolemy/configs/kepler/ConfigGUINoCache.xml"); _applicationArgsList.addFirst("-conf"); } else if (!_runWithGui && _runWithCache) { String spec; if (_displayRedirectOutputPath != null) { //add display redirection filter BackwardCompatibility.addFilter( new au.edu.jcu.kepler.hydrant.DisplayRedirectFilter(_displayRedirectOutputPath)); addActorModule("org/kepler/ActorModuleBatch"); spec = "ptolemy/configs/kepler/ConfigRedirectGUIWithCache.xml"; } else { spec = "ptolemy/configs/kepler/ConfigNoGUIWithCache.xml"; } className = "org.kepler.KeplerConfigurationApplication"; _applicationArgsList.addFirst("-runThenExit"); _applicationArgsList.addFirst(spec); // ConfigurationApplication.readConfiguration(ConfigurationApplication.specToURL(spec)); } else { // if(!gui && !cache) if (_applicationArgsList.getLast().endsWith(".kar")) { throw new IllegalArgumentException( "ERROR: -runkar " + "cannot be used with -nocache option." + " Please remove '-nocache' option and try again."); } String spec; if (_displayRedirectOutputPath != null) //enter into display redirection mode { BackwardCompatibility.addFilter( new au.edu.jcu.kepler.hydrant.DisplayRedirectFilter(_displayRedirectOutputPath)); addActorModule("org/kepler/ActorModuleBatch"); // DisplayRediectClassChanges.classChanges(); // BackwardCompatibility.addFilter(new DisplayRedirectFilter(outputPath)); spec = "ptolemy/configs/kepler/ConfigRedirectGUINoCache.xml"; } else { spec = "ptolemy/configs/kepler/ConfigNoGUINoCache.xml"; } className = "org.kepler.KeplerConfigurationApplication"; _applicationArgsList.addFirst("-runThenExit"); _applicationArgsList.addFirst(spec); // else{ // className = "ptolemy.moml.MoMLCommandLineApplication"; // } } if (className != null) { // initialize and run the class. String[] loadArgs = _applicationArgsList.toArray(new String[0]); load(className, loadArgs); } } else if (_action == Action.CreateActorXML) { String[] loadArgs = _applicationArgsList.toArray(new String[0]); load("org.kepler.loader.util.UpdateActorTreeFiles", "buildXMLs", loadArgs); } else if (_action == Action.UpdateActorDocs) { String[] loadArgs = _applicationArgsList.toArray(new String[0]); load("org.kepler.loader.util.UpdateActorTreeFiles", "updateKarXMLDocsForFile", loadArgs); } else if (_action == Action.HSQLStart) { System.out.println("going to start hsql servers."); _runHSQLServers(true); } else if (_action == Action.HSQLStop) { System.out.println("going to stop hsql servers."); _runHSQLServers(false); } } catch (IllegalArgumentException e) { System.out.print(e.getMessage()); return 1; } catch (Exception e) { System.out.println(e.getClass() + ": " + e.getMessage()); e.printStackTrace(); return 1; } if (_exitAfterRun) { System.exit(0); } return 0; }
From source file:de.geeksfactory.opacclient.apis.TouchPoint.java
static List<LentItem> parse_medialist(Document doc) { List<LentItem> media = new ArrayList<>(); Elements copytrs = doc.select(".data tr"); DateTimeFormatter fmt = DateTimeFormat.forPattern("dd.MM.yyyy").withLocale(Locale.GERMAN); int trs = copytrs.size(); if (trs == 1) { return null; }//w w w .ja v a2s. c om assert (trs > 0); for (int i = 1; i < trs; i++) { Element tr = copytrs.get(i); LentItem item = new LentItem(); if (tr.text().contains("keine Daten")) { return null; } item.setTitle(tr.select(".account-display-title").select("b, strong").text().trim()); try { item.setAuthor(tr.select(".account-display-title").html().split("<br[ /]*>")[1].trim()); String[] col3split = tr.select(".account-display-state").html().split("<br[ /]*>"); String deadline = Jsoup.parse(col3split[0].trim()).text().trim(); if (deadline.contains(":")) { // BSB Munich: <span class="hidden-sm hidden-md hidden-lg">Flligkeitsdatum : </span>26.02.2016<br> deadline = deadline.split(":")[1].trim(); } if (deadline.contains("-")) { // Chemnitz: 22.07.2015 - 20.10.2015<br> deadline = deadline.split("-")[1].trim(); } try { item.setDeadline(fmt.parseLocalDate(deadline).toString()); } catch (IllegalArgumentException e1) { e1.printStackTrace(); } if (col3split.length > 1) item.setHomeBranch(col3split[1].trim()); if (tr.select("a").size() > 0) { for (Element link : tr.select("a")) { String href = link.attr("abs:href"); Map<String, String> hrefq = getQueryParamsFirst(href); if (hrefq.get("methodToCall").equals("renewal")) { item.setProlongData(href.split("\\?")[1]); item.setRenewable(true); break; } } } } catch (Exception ex) { ex.printStackTrace(); } media.add(item); } return media; }
From source file:gemlite.core.util.CommandBase.java
protected String getValue(CmdField f) { Object value = null;/*from w ww .ja va2 s . c om*/ f.field.setAccessible(true); try { value = f.field.get(this); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return StringUtils.trim("" + value); }
From source file:gemlite.core.util.CommandBase.java
/** * //from ww w . ja va 2 s . c o m * * @param f * @return */ protected String setValue(CmdField f) { Object value = null; f.field.setAccessible(true); try { f.field.set(this, ""); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return StringUtils.trim("" + value); }
From source file:com.morlunk.mumbleclient.service.PlumbleReconnectNotification.java
public void hide() { try {/*from ww w.j a v a2 s. c om*/ mContext.unregisterReceiver(mNotificationReceiver); } catch (IllegalArgumentException e) { // Thrown if receiver is not registered. e.printStackTrace(); } NotificationManagerCompat nmc = NotificationManagerCompat.from(mContext); nmc.cancel(NOTIFICATION_ID); }