List of usage examples for java.lang IllegalArgumentException printStackTrace
public void printStackTrace()
From source file:de.tudarmstadt.ukp.uby.integration.alignment.xml.transform.AlignmentGenericXml.java
public AlignmentGenericXml(String sourceUrl, String dbDriver, String dbVendor, String alignmentFile, String user, String pass) { this.alignment = new File(alignmentFile); lmfMetaData = new LinkedList<>(); logString = new StringBuilder(); if (!alignment.exists() && !alignment.isFile()) { logger.warn("Alignment file: " + alignmentFile + " doesn't exist! "); System.exit(1);/*from w w w . j a v a 2 s . c o m*/ } DBConfig dbConfig = new DBConfig(sourceUrl, dbDriver, dbVendor, user, pass, false); try { uby = new Uby(dbConfig); } catch (IllegalArgumentException e) { e.printStackTrace(); } try { readAlignmentFile(alignment); } catch (IOException e) { e.printStackTrace(); } }
From source file:it.txt.ens.core.impl.test.BasicENSResourceTest.java
@Test public void testCreation() { System.out.println(//from ww w . j av a2 s.c o m "Creation of a " + BasicENSResource.class.getSimpleName() + " instance with full constructor"); String host = "www.myhost.com"; String path = "myENSService"; String namespace = "this is my namespace"; String pattern = "this.is.my.ens.pattern.*"; ENSResource resource; try { resource = testCreation(host, path, namespace, pattern); testURI(resource); } catch (IllegalArgumentException e) { fail(e.getMessage()); e.printStackTrace(); } System.out.println("TEST SUCCEEDED"); System.out.println("-----------------------------------------------------------------------"); System.out.println( "Creation of a " + BasicENSResource.class.getSimpleName() + " instance with 3-params constructor"); host = "www.myhost.com"; namespace = "this is my second namespace"; pattern = "this.is.my.second.ens.pattern.*"; try { resource = testCreation(host, null, namespace, pattern); testURI(resource); } catch (IllegalArgumentException e) { fail(e.getMessage()); e.printStackTrace(); } System.out.println("TEST SUCCEEDED"); }
From source file:com.touchgallery.GalleryWidget.GalleryViewPager.java
@Override public boolean onInterceptTouchEvent(MotionEvent event) { if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP) { //super.onInterceptTouchEvent(event); float endX = event.getX(); float endY = event.getY(); if (isAClick(startX, endX, startY, endY)) { if (mOnItemClickListener != null) { mOnItemClickListener.onItemClicked(mCurrentView, getCurrentItem()); }//from ww w .j a va 2 s . c om } else { super.onInterceptTouchEvent(event); } } if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) { startX = event.getX(); startY = event.getY(); } float[] difference = handleMotionEvent(event); if (mCurrentView.pagerCanScroll()) { try { return super.onInterceptTouchEvent(event); } catch (IllegalArgumentException e) { e.printStackTrace(); } } else { if (difference != null && mCurrentView.onRightSide && difference[0] < 0) //move right { return super.onInterceptTouchEvent(event); } if (difference != null && mCurrentView.onLeftSide && difference[0] > 0) //move left { return super.onInterceptTouchEvent(event); } if (difference == null && (mCurrentView.onLeftSide || mCurrentView.onRightSide)) { return super.onInterceptTouchEvent(event); } } return false; }
From source file:com.morlunk.mumbleclient.service.PlumbleConnectionNotification.java
/** * Hides the notification and unregisters the action receiver. *//*from w w w. j a v a 2s .c om*/ public void hide() { try { mService.unregisterReceiver(mNotificationReceiver); } catch (IllegalArgumentException e) { // Thrown if receiver is not registered. e.printStackTrace(); } mService.stopForeground(true); }
From source file:org.apache.ws.java2wsdl.jaxws.JAXWS2WSDLCodegenEngine.java
/** * Merge original args.//from w w w . j av a 2s .c o m * * @param args * the args */ private void mergeOriginalArgs(List<String> args) { List<String> axisOptionList = new ArrayList<String>(); List<String> originalArgsOps = new ArrayList<String>(Arrays.asList(originalArgs)); originalArgsOps.remove("-".concat(Java2WSDLConstants.JAX_WS_SERVICE_OPTION)); originalArgsOps.remove("-".concat(Java2WSDLConstants.JAX_WS_SERVICE_OPTION_LONG)); Field[] allFields = Java2WSDLConstants.class.getFields(); Iterator<String> mapItr = optionsMap.keySet().iterator(); for (Field field : allFields) { if (String.class.equals(field.getType())) { try { axisOptionList.add((String) field.get(Java2WSDLConstants.class)); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } } while (mapItr.hasNext()) { Java2WSDLCommandLineOption op = optionsMap.get(mapItr.next()); if (axisOptionList.contains(op.getOptionType())) { if (op.getOptionType() != null) { originalArgsOps.remove("-".concat(op.getOptionType())); } if (op.getOptionValue() != null) { originalArgsOps.remove(op.getOptionValue()); } } } args.addAll(originalArgsOps); log.debug("Original WSImport options" + Arrays.asList(originalArgsOps)); log.debug("All WSImport options" + Arrays.asList(args)); }
From source file:com.nbzs.ningbobus.ui.fragments.app.BusRunInfoListFragment.java
@Override public void onPause() { super.onPause(); try {// ww w.ja va 2s .c om if (mArticleFeedReceiver != null) { /* Unregister the receiver when we pause the fragment */ getSherlockActivity().unregisterReceiver(mArticleFeedReceiver); } } catch (IllegalArgumentException e) { e.printStackTrace(); } }
From source file:org.eclipsetrader.yahoo.internal.news.RSSNewsHandler.java
@Override public HeadLine[] parseNewsPages(URL[] url, IProgressMonitor monitor) { List<HeadLine> list = new ArrayList<HeadLine>(); HttpClient client = new HttpClient(); client.getHttpConnectionManager().getParams().setConnectionTimeout(5000); for (int i = 0; i < url.length && !monitor.isCanceled(); i++) { monitor.subTask(url[i].toString()); try {/*from w w w . j a v a 2 s.c om*/ Util.setupProxy(client, url[i].getHost()); SyndFeed feed = fetcher.retrieveFeed(url[i], client); for (Iterator<?> iter = feed.getEntries().iterator(); iter.hasNext();) { SyndEntry entry = (SyndEntry) iter.next(); String link = entry.getLink(); if (link.lastIndexOf('*') != -1) { link = link.substring(link.lastIndexOf('*') + 1); } link = URLDecoder.decode(link, "UTF-8"); String source = null; String title = entry.getTitle(); if (title.startsWith("[$$]")) { title = title.substring(4, title.length()); } if (title.endsWith(")")) { int s = title.lastIndexOf('('); if (s != -1) { source = title.substring(s + 1, title.length() - 1); if (source.startsWith("at ")) { source = source.substring(3); } title = title.substring(0, s - 1).trim(); } } list.add(new HeadLine(entry.getPublishedDate(), source, title, null, link)); } } catch (IllegalArgumentException e) { // Do nothing, could be an invalid URL } catch (Exception e) { e.printStackTrace(); } monitor.worked(1); } return list.toArray(new HeadLine[list.size()]); }
From source file:org.kalypso.model.wspm.tuhh.ui.export.csv.CsvExportColumnsPage.java
void applyDialogSettings(final IDialogSettings dialogSettings) { try {/* ww w .ja v a 2s. com*/ if (dialogSettings == null) return; final String typeName = dialogSettings.get(SETTINGS_TYPE); if (typeName != null) { m_type = OUTPUT_TYPE.valueOf(typeName); } if (m_typeCombo != null) { m_typeCombo.setSelection(new StructuredSelection(m_type)); } m_columnsComposite.applyDialogSettings(dialogSettings); } catch (final IllegalArgumentException e) { e.printStackTrace(); } }
From source file:com.morlunk.mumbleclient.service.PlumbleConnectionNotification.java
/** * Shows the notification and registers the notification action button receiver. *///from w w w . j a v a2 s . c o m public void show() { createNotification(); IntentFilter filter = new IntentFilter(); filter.addAction(BROADCAST_DEAFEN); filter.addAction(BROADCAST_MUTE); filter.addAction(BROADCAST_OVERLAY); try { mService.registerReceiver(mNotificationReceiver, filter); } catch (IllegalArgumentException e) { // Thrown if receiver is already registered. e.printStackTrace(); } }
From source file:geogebra.kernel.statistics.AlgoTMeanEstimate.java
protected final void compute() { try {/*from w w w . j a v a 2 s. c om*/ // get statistics from sample data input if (input.length == 2) { int size = geoList.size(); if (!geoList.isDefined() || size < 2) { result.setUndefined(); return; } val = new double[size]; for (int i = 0; i < size; i++) { GeoElement geo = geoList.get(i); if (geo.isNumberValue()) { NumberValue num = (NumberValue) geo; val[i] = num.getDouble(); } else { result.setUndefined(); return; } } stats = new SummaryStatistics(); for (int i = 0; i < val.length; i++) { stats.addValue(val[i]); } n = stats.getN(); sd = stats.getStandardDeviation(); mean = stats.getMean(); } else { mean = geoMean.getDouble(); sd = geoSD.getDouble(); n = geoN.getDouble(); } level = geoLevel.getDouble(); // validate statistics if (level < 0 || level > 1 || sd < 0 || n < 1) { result.setUndefined(); return; } // get interval estimate me = getMarginOfError(sd, n, level); // return list = {low limit, high limit, mean, margin of error, df } result.clear(); boolean oldSuppress = cons.isSuppressLabelsActive(); cons.setSuppressLabelCreation(true); result.add(new GeoNumeric(cons, mean - me)); result.add(new GeoNumeric(cons, mean + me)); //result.add(new GeoNumeric(cons, mean)); //result.add(new GeoNumeric(cons, me)); //result.add(new GeoNumeric(cons, n-1)); // df cons.setSuppressLabelCreation(oldSuppress); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (MathException e) { e.printStackTrace(); } }