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:org.kuali.rice.core.framework.persistence.jpa.CompositePrimaryKeyBase.java

public boolean equals(Object o) {
    Class thisClass = (this.getClass());
    Class otherClass = thisClass.cast(o).getClass();

    if (o == this)
        return true;
    if (!(thisClass.isInstance(o)))
        return false;
    if (o == null)
        return false;

    Method[] methods = thisClass.getMethods();
    for (Method method : methods) {
        if (isGetter(method)) {
            try {
                if (method.invoke(this) != null) {
                    if (method.getReturnType().isInstance(Object.class)
                            && !method.invoke(this).equals(method.invoke(o))) {
                        return false;
                    } else if (method.invoke(this) != method.invoke(o)) {
                        return false;
                    }/*from w w w  .  j av a  2  s .c  o m*/
                } else {
                    return false;
                }
            } catch (IllegalArgumentException ex) {
                ex.printStackTrace();
                return false;
            } catch (SecurityException ex) {
                ex.printStackTrace();
                return false;
            } catch (IllegalAccessException ex) {
                ex.printStackTrace();
                return false;
            } catch (InvocationTargetException ex) {
                ex.printStackTrace();
                return false;
            }
        }
    }
    return true;
}

From source file:org.hansel.myAlert.PanicButtonFragment.java

private void ActivaRadios() {
    Log.v("Intentamos activar Datos");
    try {/*from   w ww.  j  a  v a 2s . c om*/
        setMobileDataEnabled(getActivity().getApplicationContext(), true);
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    } catch (NoSuchFieldException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    }
    Log.v("Activamos WIFI");
    //WifiManager wifiManager = (WifiManager)getActivity().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
    //wifiManager.setWifiEnabled(true);

}

From source file:com.dngames.mobilewebcam.PhotoSettings.java

private static int GetPrefColor(SharedPreferences prefs, String name, String def, int c) {
    String v = prefs.getString(name, def);
    if (v.length() == 9) {
        try {/*from w w  w  . j av  a2  s . c om*/
            return Color.parseColor(v);
        } catch (IllegalArgumentException e) {
            MobileWebCam.LogE("Wrong color string: '" + v + "'");
            e.printStackTrace();
        }
    }

    return c;
}

From source file:com.extradea.framework.images.workers.DownloadWorker.java

private byte[] downloadImage(String url, final ImageTask task, final ImageController controller) {
    try {//from w w  w. j  av  a2  s.  c om
        HttpGet get = new HttpGet(url.replace(" ", "%20"));
        HttpResponse response = client.execute(get);
        if (response.getEntity().getContentLength() == 0)
            return null;

        if (response.getStatusLine().getStatusCode() == 404)
            return null;

        final int totalCount = (int) response.getEntity().getContentLength();

        CountingOutputStream output = new CountingOutputStream(new ProgressListener() {
            @Override
            public void transferred(long transferedBytes) {
                notifyDownloading((int) transferedBytes, totalCount, task, controller);
            }
        });
        try {
            response.getEntity().writeTo(output);
        } finally {

        }

        notifyDownloading((int) response.getEntity().getContentLength(),
                (int) response.getEntity().getContentLength(), task, controller);

        return output.toByteArray();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
        //Log.e(TAG, e);
        return null;
    } catch (Exception e) {
        e.printStackTrace();
        //Log.e(TAG, e);
        return null;
    }
}

From source file:de.clusteval.data.statistics.DataStatisticCalculator.java

@SuppressWarnings("unchecked")
@Override//  w w  w .ja va2 s . co  m
public DataStatisticCalculator<T> clone() {
    try {
        return this.getClass().getConstructor(DataStatisticCalculator.class).newInstance(this);
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (SecurityException e) {
        e.printStackTrace();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
    this.log.warn("Cloning instance of class " + this.getClass().getSimpleName() + " failed");
    return null;
}

From source file:com.polyvi.xface.extension.XNotificationExt.java

@Override
public XExtensionResult exec(String action, JSONArray args, XCallbackContext callbackCtx) throws JSONException {
    XExtensionResult.Status status = XExtensionResult.Status.OK;
    String result = "";
    mCallbackCtx = callbackCtx;/* ww  w . j  a v a 2s  .  c  om*/
    try {
        if (action.equals(COMMAND_ALERT)) {
            alert(args.getString(0), args.getString(1), args.getString(2));
            XExtensionResult r = new XExtensionResult(XExtensionResult.Status.NO_RESULT);
            r.setKeepCallback(true);
            return r;
        } else if (action.equals(COMMAND_CONFIRM)) {
            confirm(args.getString(0), args.getString(1), args.getString(2));
            XExtensionResult r = new XExtensionResult(XExtensionResult.Status.NO_RESULT);
            r.setKeepCallback(true);
            return r;
        } else if (action.equals(COMMAND_BEEP)) {
            mXNotification.beep(args.getLong(0));
        } else if (action.equals(COMMAND_VIBRATE)) {
            mXNotification.vibrate(args.getLong(0));
        } else if (action.equals(COMMAND_ACTIVITY_START)) {
            mXNotification.activityStart(args.getString(0), args.getString(1));
        } else if (action.equals(COMMAND_ACTIVITY_STOP)) {
            mXNotification.activityStop();
        } else if (action.equals(COMMAND_PROGRESS_START)) {
            mXNotification.progressStart(args.getString(0), args.getString(1));
        } else if (action.equals(COMMAND_PROGRESS_VALUE)) {
            mXNotification.progressValue(args.getInt(0));
        } else if (action.equals(COMMAND_PROGRESS_STOP)) {
            mXNotification.progressStop();
        } else {
            status = XExtensionResult.Status.INVALID_ACTION;
            result = "Unsupported Operation: " + action;
        }
        return new XExtensionResult(status, result);
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
        return new XExtensionResult(XExtensionResult.Status.ERROR);
    }
}

From source file:com.gongpingjia.carplay.view.gallery.GalleryViewPager.java

@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
    if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP) {
        super.onInterceptTouchEvent(event);
    }//from  w w  w.  j a va 2 s  .  c  o m

    float[] difference = handleMotionEvent(event);

    if (mCurrentView.pagerCanScroll()) {

        try {
            return super.onInterceptTouchEvent(event);
        } catch (IllegalArgumentException e) {
            // TODO Auto-generated catch block
            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:geogebra.kernel.statistics.AlgoTTestPaired.java

protected final void compute() {

    if (!(tail.getTextString().equals("<") || tail.getTextString().equals(">")
            || tail.getTextString().equals("!=") || tail.getTextString().equals(""))) {
        result.setUndefined();/*www  . j a va 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.isNumberValue() && geo1.isNumberValue()) {
            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:de.clusteval.run.statistics.RunStatisticCalculator.java

@SuppressWarnings("unchecked")
@Override//from w w  w .  j a va2s .  c  o  m
public RunStatisticCalculator<T> clone() {
    try {
        return this.getClass().getConstructor(RunStatisticCalculator.class).newInstance(this);
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (SecurityException e) {
        e.printStackTrace();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
    this.log.warn("Cloning instance of class " + this.getClass().getSimpleName() + " failed");
    return null;
}

From source file:org.adorsys.waguia.lightxls.generic.EasyXlsClazzLoader.java

public List<T> loadClazzData(Class clazz) {
    List<T> result = new ArrayList<T>();
    try {/*from w  w  w . j  a  v  a2s.  co m*/
        result = loadClazz();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (InstantiationException e) {
        e.printStackTrace();
    }
    return result;
}