Example usage for java.lang IllegalArgumentException printStackTrace

List of usage examples for java.lang IllegalArgumentException printStackTrace

Introduction

In this page you can find the example usage for java.lang IllegalArgumentException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:geogebra.common.kernel.statistics.AlgoTTestPaired.java

@Override
public final void compute() {

    if (!(StringUtil.isInequality(tail.getTextString()))) {
        result.setUndefined();/*from   w  ww . j a v a  2  s  .c o m*/
        return;
    }

    double p, testStat;

    // sample data input

    int size = geoList0.size();
    if (!geoList1.isDefined() || geoList1.size() != size) {
        result.setUndefined();
        return;
    }

    // create number value arrays
    val0 = new double[size];
    val1 = new double[size];
    GeoElement geo0, geo1;
    NumberValue num0, num1;

    for (int i = 0; i < size; i++) {
        geo0 = geoList0.get(i);
        geo1 = geoList1.get(i);
        if (geo0 instanceof NumberValue && geo1 instanceof NumberValue) {
            num0 = (NumberValue) geo0;
            num1 = (NumberValue) geo1;
            val0[i] = num0.getDouble();
            val1[i] = num1.getDouble();

        } else {
            result.setUndefined();
            return;
        }
    }

    try {

        // get the test statistic and p
        if (tTestImpl == null)
            tTestImpl = new TTestImpl();
        testStat = tTestImpl.pairedT(val0, val1);
        p = tTestImpl.pairedTTest(val0, val1);
        testStat = tTestImpl.pairedT(val0, val1);
        p = adjustedPValue(p, testStat);

        // put these results into the output list
        result.clear();
        result.add(new GeoNumeric(cons, p));
        result.add(new GeoNumeric(cons, testStat));

    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (MathException e) {
        e.printStackTrace();
    }

}

From source file:org.kalypso.ui.catalogs.FeatureTypePropertiesCatalog.java

private Set<QName> parseHiddenChildren(final String hiddenChildrenValue) {
    final Set<QName> hiddenChildren = new HashSet<>();

    if (StringUtils.isBlank(hiddenChildrenValue))
        return hiddenChildren;

    final String[] split = StringUtils.split(hiddenChildrenValue, ',');
    for (final String element : split) {
        try {//from  w  ww  .  j  a v  a2 s .c om
            final QName qname = QName.valueOf(element);
            hiddenChildren.add(qname);
        } catch (final IllegalArgumentException e) {
            e.printStackTrace();
        }
    }

    return hiddenChildren;
}

From source file:com.beinformed.framework.osgi.osgitest.testrunner.AllTestSuitesAvailableAsserter.java

/**
 * Retrieves the actual TestSuite from the component
 * @param component/*from  www .  jav a 2s. c o m*/
 * @return the TestSuite or null if it could not be retrieved
 */
private TestSuite getTestSuite(Component component) {
    //Try to obtain the implementation using reflection...
    Field[] fields = component.getClass().getDeclaredFields();
    Object implementation = null;
    try {
        for (Field field : fields) {
            if (field.getName().equals("m_implementation")) { //$NON-NLS-1$
                field.setAccessible(true);
                implementation = field.get(component);
                field.setAccessible(false);
            }
        }
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
    if (implementation instanceof TestSuite) {
        return (TestSuite) implementation;
    }
    return null;
}

From source file:com.projity.field.SelectOption.java

Object getStaticObject() {
    if (object == null || objectField == null)
        return null;

    try {/*from   w  w w.  j av  a2  s .com*/
        return ClassUtils.forName(object).getField(objectField).get(null);
    } catch (IllegalArgumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (SecurityException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (NoSuchFieldException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return null;
}

From source file:com.morlunk.mumbleclient.service.PlumbleReconnectNotification.java

public void show(String error, boolean autoReconnect) {
    IntentFilter filter = new IntentFilter();
    filter.addAction(BROADCAST_DISMISS);
    filter.addAction(BROADCAST_RECONNECT);
    filter.addAction(BROADCAST_CANCEL_RECONNECT);
    try {//from w w  w .j  a  va 2s  . c  o m
        mContext.registerReceiver(mNotificationReceiver, filter);
    } catch (IllegalArgumentException e) {
        // Thrown if receiver is already registered.
        e.printStackTrace();
    }
    NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext);
    builder.setSmallIcon(R.drawable.ic_stat_notify);
    builder.setPriority(NotificationCompat.PRIORITY_MAX);
    builder.setDefaults(NotificationCompat.DEFAULT_VIBRATE | NotificationCompat.DEFAULT_LIGHTS);
    builder.setContentTitle(mContext.getString(R.string.plumbleDisconnected));
    builder.setContentText(error);
    builder.setTicker(mContext.getString(R.string.plumbleDisconnected));

    Intent dismissIntent = new Intent(BROADCAST_DISMISS);
    builder.setDeleteIntent(
            PendingIntent.getBroadcast(mContext, 2, dismissIntent, PendingIntent.FLAG_CANCEL_CURRENT));

    if (autoReconnect) {
        Intent cancelIntent = new Intent(BROADCAST_CANCEL_RECONNECT);
        builder.addAction(R.drawable.ic_action_delete_dark, mContext.getString(R.string.cancel_reconnect),
                PendingIntent.getBroadcast(mContext, 2, cancelIntent, PendingIntent.FLAG_CANCEL_CURRENT));
        builder.setOngoing(true);
    } else {
        Intent reconnectIntent = new Intent(BROADCAST_RECONNECT);
        builder.addAction(R.drawable.ic_action_move, mContext.getString(R.string.reconnect),
                PendingIntent.getBroadcast(mContext, 2, reconnectIntent, PendingIntent.FLAG_CANCEL_CURRENT));
    }

    NotificationManagerCompat nmc = NotificationManagerCompat.from(mContext);
    nmc.notify(NOTIFICATION_ID, builder.build());
}

From source file:it.txt.ens.core.impl.test.BasicENSResourceTest.java

private ENSResource testCreation(String host, String path, String namespace, String pattern) {
    ENSResource resource = null;//from  w w w  .  ja  va2  s.co m
    BasicENSResourceFactory factory = new BasicENSResourceFactory();
    try {
        if (path == null)
            resource = factory.create(host, namespace, pattern);
        else
            resource = factory.create(host, path, namespace, pattern);

        assertEquals("Unexpected host", host, resource.getHost());
        if (path == null)
            assertEquals("Unexpected path", ENSResource.DEFAULT_PATH, resource.getPath());
        else if (path.startsWith("/"))
            assertEquals("Unexpected path", path, resource.getPath());
        else
            assertEquals("Unexpected path", "/" + path, resource.getPath());
        assertEquals("Unexpected namespace", namespace, resource.getNamespace());
        assertEquals("Unexpected pattern", pattern, resource.getPattern());

    } catch (IllegalArgumentException e) {
        fail(e.getMessage());
        e.printStackTrace();
    } catch (URIBuildingException e) {
        fail(e.getMessage());
        e.printStackTrace();
    }
    return resource;
}

From source file:com.ml.ws.service.CommonService.java

private void transResult(Map<String, Object> map, Object obj) {

    for (String key : map.keySet()) {
        key.toLowerCase();//from w  ww . jav a2s  . c  om
    }

    for (Field field : obj.getClass().getDeclaredFields()) {
        final String name = field.getName();
        if (name.equalsIgnoreCase("serialVersionUID")) {
            continue;
        }
        field.setAccessible(true);
        try {
            field.set(obj, map.get(name));
        } catch (IllegalArgumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

From source file:it.txt.ens.core.impl.osgi.test.BasicENSResourceOsgiTest.java

@Test
public void testBasicENSResourceFactoryRetrivalAndUsage() {
    System.out.println("Testing retrieval and usage of an instance of the factory "
            + BasicENSResourceFactory.class.getName());
    assertNotNull(resourcefactory);//from ww w. j a  v  a 2s  .com
    try {
        ENSResource r = resourcefactory.create("myHost", "myNamespace", "my.pattern");
        assertNotNull("The resource has not been created.");
        assertTrue(
                "The factory is not an instance of " + BasicENSResourceFactory.class.getName()
                        + ". Actual class: " + resourcefactory.getClass().getName(),
                resourcefactory instanceof BasicENSResourceFactory);
        assertTrue("The resource is not an instance of " + BasicENSResource.class.getName() + ". Actual class: "
                + r.getClass().getName(), r instanceof BasicENSResource);
        System.out.println("TEST SUCCEEDED");
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
        fail(e.getMessage());
    } catch (URIBuildingException e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
    System.out.println();
}

From source file:de.tudarmstadt.ukp.uby.integration.alignment.xml.transform.AlignmentGenericXml.java

public AlignmentGenericXml(DBConfig dbconf, String alignmentFile) {

    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  av  a 2 s .  c o m
    }

    DBConfig dbConfig = dbconf;
    try {
        uby = new Uby(dbConfig);
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    }

    try {
        readAlignmentFile(alignment);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:edu.temple.cis3238.wiki.parser.TagsFromContentParser.java

private void extractTagNamesCSVFromTopicContent(String _topicContent) {
    if (!edu.temple.cis3238.wiki.utils.StringUtils.toS(_topicContent, "").isEmpty()) {
        ArrayList<TagsVO> tagsVO = _extractTagsFromTopic(_topicContent);
        try {/*from w w  w. j ava 2  s.c  o  m*/
            setTagNameSet(edu.temple.cis3238.wiki.utils.CollectionsUtilities.pluckList(tagsVO, "tagname"));
            setTagNameCSV(setToCSV(getTagNameSet()));
            extracted = true;
        } catch (IllegalArgumentException ex) {
            ex.printStackTrace();
            LOG.log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            ex.printStackTrace();
            LOG.log(Level.SEVERE, null, ex);
        }
    }

}