Example usage for java.lang ClassCastException printStackTrace

List of usage examples for java.lang ClassCastException printStackTrace

Introduction

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

Prototype

public void printStackTrace() 

Source Link

Document

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

Usage

From source file:integratedprogressdemo.IntegratedProgressIndicator.java

public IntegratedProgressIndicator(Object surface) {
    try {/*from  w w  w. j a  va  2  s .c o m*/
        surfaceContainer = (Container) surface;
    } catch (ClassCastException cce) {
        cce.printStackTrace();
    }
}

From source file:nl.utwente.bigdata.bolts.TweetJsonToTextBolt.java

@Override
public void execute(Tuple tuple, BasicOutputCollector collector) {
    try {/*from ww  w.  j a v a2s. co  m*/
        Status tweet = TwitterObjectFactory.createStatus(tuple.getString(0));
        //        String text = (String) tweet.get("text");
        //        String lang = (String) tweet.get("lang");
        //        String createdAt = (String) tweet.get("created_at");

        if (!tweet.isRetweet()) {
            collector.emit(new Values(tweet));
        }
    } catch (ClassCastException e) {
        System.out.println("ClassCass");
        e.printStackTrace();
        return; // do nothing (we might log this)
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:cn.stj.fphealth.views.dialog.QrcodeDialog.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {// w  ww  .  j a  v  a 2s . c om
        mListener = (OnQrcodeDialogClickListener) activity;
    } catch (ClassCastException e) {
        e.printStackTrace();
    }
}

From source file:com.florianmski.tracktoid.trakt.tasks.TraktTask.java

public TraktTask(TraktManager tm, Fragment fragment) {
    this.tm = tm;
    this.fragment = fragment;
    this.context = fragment.getActivity();

    try {//  ww w  . j a  va  2s.  c  om
        tListener = (TraktListener) fragment;
    } catch (ClassCastException e) {
        e.printStackTrace();
    }
}

From source file:com.tr4android.support.extension.typeface.TypefaceCompatFactory.java

@Deprecated
private TypefaceCompatFactory(Context context, boolean typefaceDetectionEnabled) {
    TypefaceCompat.setTypefaceDetectionEnabled(typefaceDetectionEnabled);
    try {/*from  ww w .ja v a  2s .  c  o m*/
        this.mBaseFactory = (LayoutInflaterFactory) ((AppCompatActivity) context).getDelegate();
    } catch (ClassCastException e) {
        e.printStackTrace();
    }
}

From source file:customprogressindicator.CustomProgress.java

public void init(Object surface, Object stub) {
    try {/*ww w .ja va2  s.co m*/
        surfaceContainer = (Container) surface;
        appletStub = (AppletStub) stub;
    } catch (ClassCastException cce) {
        cce.printStackTrace();
    }
}

From source file:com.seongil.simpleavatarpicker.demo.PictureChooserDialog.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {//from   w  w w .  jav  a 2s  .co m
        mCallerCallback = (PictureChooserDialogListener) context;
    } catch (ClassCastException e) {
        e.printStackTrace();
    }
}

From source file:nl.utwente.bigdata.bolts.WorldCupJsonToDataBolt.java

@Override
public void execute(Tuple tuple, BasicOutputCollector collector) {
    try {//from w w w .j a  v  a 2  s .  c om
        JSONObject game = (JSONObject) parser.parse(tuple.getString(0));

        JSONArray officials = (JSONArray) game.get("officials");
        JSONObject home = (JSONObject) game.get("home");
        JSONObject away = (JSONObject) game.get("away");

        String referee_name = "";
        String home_name = (String) home.get("name");
        String away_name = (String) away.get("name");

        SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy - k:mm");
        Date matchTime = new Date();
        matchTime = formatter.parse((String) game.get("time"));
        Iterator i = officials.iterator();

        while (i.hasNext()) {
            JSONObject official = (JSONObject) i.next();
            if (official.get("role").equals("Referee")) {
                referee_name = (String) official.get("name");
            }
        }
        //System.out.println(referee_name);
        collector.emit(new Values(referee_name, home_name, away_name, matchTime));
    } catch (ClassCastException e) {
        System.out.println("ClassCass");
        e.printStackTrace();
        return; // do nothing (we might log this)
    } catch (org.json.simple.parser.ParseException e) {
        System.out.println("ParseException");
        e.printStackTrace();
        return; // do nothing 
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:jamel.gui.charts.TimeChart.java

/**
 * Sets the time range.//from w w w.  j a v a 2s. c o m
 * 
 * @param lower  the lower date limit.
 * @param upper  the upper date limit.
 */
public void setTimeRange(Date lower, Date upper) {
    setNotify(true);
    try {
        ((DateAxis) ((XYPlot) getPlot()).getDomainAxis()).setRange(lower, upper);
    } catch (ClassCastException e) {
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    }
    setNotify(false);
}

From source file:cn.stj.fphealth.views.dialog.DeviceBindDialog.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {/* w w w . j  a  va2 s . c om*/
        mListener = (OnDeviceBindDialogClickListener) activity;
    } catch (ClassCastException e) {
        e.printStackTrace();
    }
}