Example usage for java.lang IllegalAccessException printStackTrace

List of usage examples for java.lang IllegalAccessException printStackTrace

Introduction

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

Prototype

public void printStackTrace() 

Source Link

Document

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

Usage

From source file:org.dmfs.android.retentionmagic.RetentionMagic.java

/**
 * Store all retainable fields of an Activity in a {@link Bundle}.
 * //from   w ww  .  j a v a 2  s  . c om
 * @param activity
 *            The {@link Activity}.
 * @param instanceState
 *            The {@link Bundle} to store the state in.
 */
public static void store(final Activity activity, final Bundle instanceState) {
    try {
        storeAndRestore(activity.getClass(), activity, instanceState, true /* store */);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}

From source file:org.dmfs.android.retentionmagic.RetentionMagic.java

/**
 * Store all retainable fields of a {@link Fragment} in a {@link Bundle}.
 * /*  w ww .j a v  a 2s.c  o m*/
 * @param fragment
 *            The {@link Fragment}.
 * @param instanceState
 *            The {@link Bundle} to store the state in.
 */
public static void store(final Fragment fragment, final Bundle instanceState) {
    try {
        storeAndRestore(fragment.getClass(), fragment, instanceState, true /* store */);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}

From source file:org.dmfs.android.retentionmagic.RetentionMagic.java

/**
 * Store all retainable fields of a {@link android.support.v4.app.Fragment} in a {@link Bundle}.
 * /*from www.ja v  a 2 s.  co  m*/
 * @param fragment
 *            The {@link android.support.v4.app.Fragment}.
 * @param instanceState
 *            The {@link Bundle} to store the state in.
 */
public static void store(final android.support.v4.app.Fragment fragment, final Bundle instanceState) {
    try {
        storeAndRestore(fragment.getClass(), fragment, instanceState, true /* store */);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}

From source file:org.dmfs.android.retentionmagic.RetentionMagic.java

/**
 * Restore all retainable fields of an Activity from a {@link Bundle}.
 * //from  www. j ava 2 s  .c  o m
 * @param activity
 *            The {@link Activity}.
 * @param instanceState
 *            The {@link Bundle} to store the state in.
 */
public static void restore(final Activity activity, final Bundle instanceState) {
    try {
        storeAndRestore(activity.getClass(), activity, instanceState, false /* restore */);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}

From source file:org.dmfs.android.retentionmagic.RetentionMagic.java

/**
 * Restore all retainable fields of a {@link Fragment} from a {@link Bundle}.
 * /*from ww  w .  j av a  2s  . co  m*/
 * @param fragment
 *            The {@link Fragment}.
 * @param instanceState
 *            The {@link Bundle} to store the state in.
 */
public static void restore(final Fragment fragment, final Bundle instanceState) {
    try {
        storeAndRestore(fragment.getClass(), fragment, instanceState, false /* restore */);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}

From source file:org.dmfs.android.retentionmagic.RetentionMagic.java

/**
 * Restore all retainable fields of a {@link android.support.v4.app.Fragment} from a {@link Bundle}.
 * /*  www .j  av  a  2 s  .  co m*/
 * @param fragment
 *            The {@link android.support.v4.app.Fragment}.
 * @param instanceState
 *            The {@link Bundle} to store the state in.
 */
public static void restore(final android.support.v4.app.Fragment fragment, final Bundle instanceState) {
    try {
        storeAndRestore(fragment.getClass(), fragment, instanceState, false /* restore */);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}

From source file:org.dmfs.android.retentionmagic.RetentionMagic.java

public static void persist(final android.support.v4.app.Fragment fragment,
        final SharedPreferences.Editor editor) {
    try {//ww w . ja  v  a 2s .co  m
        persist(fragment.getClass(), fragment, editor);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}

From source file:de.knurt.fam.plugin.DefaultPluginResolver.java

private void initPlugins() {
    File pluginDirectory = new File(FamConnector.me().getPluginDirectory());
    if (pluginDirectory.exists() && pluginDirectory.isDirectory() && pluginDirectory.canRead()) {
        File[] files = pluginDirectory.listFiles();
        ClassLoader currentThreadClassLoader = Thread.currentThread().getContextClassLoader();
        for (File file : files) {
            if (file.isFile() && file.getName().toLowerCase().endsWith("jar")) {
                JarFile jar = null;
                try {
                    jar = new JarFile(file.getAbsoluteFile().toString());
                    Enumeration<JarEntry> jarEntries = jar.entries();
                    while (jarEntries.hasMoreElements()) {
                        JarEntry entry = jarEntries.nextElement();
                        if (entry.getName().toLowerCase().endsWith("class")) {
                            String className = entry.getName().replaceAll("/", ".").replaceAll("\\.class$", "");
                            // @SuppressWarnings("resource") // classLoader must not be closed, getting an "IllegalStateException: zip file closed" otherwise
                            URLClassLoader classLoader = new URLClassLoader(new URL[] { file.toURI().toURL() },
                                    currentThreadClassLoader);
                            Class<?> cl = classLoader.loadClass(className);
                            if (this.isPlugin(cl)) {
                                Plugin plugin = (Plugin) cl.newInstance();
                                this.plugins.add(plugin);
                            }/*from  www. ja  v  a  2 s .c  om*/
                        }
                    }
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                    FamLog.logException(this.getClass(), e, "failed to load plugin", 201010091426l);
                } catch (InstantiationException e) {
                    e.printStackTrace();
                    FamLog.logException(this.getClass(), e, "failed to load plugin", 201010091424l);
                } catch (ClassNotFoundException e) {
                    e.printStackTrace();
                    FamLog.logException(this.getClass(), e, "failed to load plugin", 201010091425l);
                } catch (IOException e) {
                    e.printStackTrace();
                    FamLog.logException(this.getClass(), e, "failed to load plugin", 201010091351l);
                } finally {
                    try {
                        jar.close();
                    } catch (Exception e) {
                    }
                }
            }
        }
        for (Plugin plugin : this.plugins) {
            boolean found = false;
            if (this.implementz(plugin.getClass(), RegisterSubmission.class)) {
                if (found == true) {
                    throw new PluginConfigurationException("Found more than one RegisterSubmission classes");
                    // TODO #19 supply a solution Ticket
                }
                this.registerSubmission = (RegisterSubmission) plugin;
                found = true;
            }
        }
        for (Plugin plugin : this.plugins) {
            plugin.start();
        }
    }
    // search plugin
    if (this.registerSubmission == null) {
        this.registerSubmission = new DefaultRegisterSubmission();
    }
}

From source file:gov.nih.nci.rembrandt.web.struts2.action.EditClinicalDataAction.java

public String execute() {

    form = new ClinicalDataForm();
    form.reset(this.servletRequest);

    String sessionId = this.servletRequest.getSession().getId();
    SessionQueryBag queryBag = presentationTierCache.getSessionQueryBag(sessionId);
    String queryKey = (String) this.servletRequest.getAttribute("queryKey");
    if (queryBag != null) {
        //get the Form from the sessionQB
        ClinicalDataForm origCdForm = (ClinicalDataForm) queryBag.getFormBeanMap().get(queryKey);
        try {/*w  ww  . ja v a 2  s . com*/
            //try this, else call each setter
            PropertyUtils.copyProperties(form, origCdForm);
        } catch (IllegalAccessException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        //  cdForm = origCdForm.cloneMe();

    }

    String editForward = "";
    if (this.copy.equalsIgnoreCase("true"))
        form.setQueryName(form.getQueryName() + "_copy");

    editForward = "goEditClinical";

    //saveToken(request);

    return editForward;
}

From source file:org.rti.zcore.dar.dao.PersistenceDAOImpl.java

public void updatePatientValues(Connection conn, EncounterData vo, Form form) throws SQLException {
    Map voMap = null;/*from   ww w .jav  a  2 s .com*/
    try {
        voMap = BeanUtils.describe(vo);
    } catch (IllegalAccessException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    } catch (InvocationTargetException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    } catch (NoSuchMethodException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
    Set<PageItem> pageItems = form.getPageItems();
    Date dateVisit = vo.getDateVisit();
    Long patientId = vo.getPatientId();
    Long encounterId = vo.getId();
    for (PageItem pageItem : pageItems) {
        FormField formField = pageItem.getForm_field();
        if ((!formField.getType().equals("Display") && !pageItem.getInputType().equals("multiselect_enum"))
                || (formField.getOpenmrs_concept() != null
                        && pageItem.getInputType().equals("display-header"))) {
            Long formFieldId = formField.getId();
            String fieldName = StringManipulation.firstCharToLowerCase(formField.getStarSchemaName());
            String value = (String) voMap.get(fieldName);
            try {
                int intValue = new Integer(value);
                updatePatientValues(conn, patientId, formFieldId.intValue(), intValue, dateVisit, encounterId);
            } catch (NumberFormatException e) {
                // skip
            }
        }
    }
}