Example usage for java.text ParseException setStackTrace

List of usage examples for java.text ParseException setStackTrace

Introduction

In this page you can find the example usage for java.text ParseException setStackTrace.

Prototype

public void setStackTrace(StackTraceElement[] stackTrace) 

Source Link

Document

Sets the stack trace elements that will be returned by #getStackTrace() and printed by #printStackTrace() and related methods.

Usage

From source file:org.kalypso.wspwin.core.WspWinProfProj.java

/**
 * Reads the file profproj.txt/*from w ww .  j  a  v a 2 s .co m*/
 */
public void read(final File wspwinDir) throws IOException, ParseException {
    final WspWinProject wspWinProject = new WspWinProject(wspwinDir);
    final File profprojFile = wspWinProject.getProfProjFile();

    try (LineNumberReader reader = new LineNumberReader(new FileReader(profprojFile));) {
        final int[] counts = readStrHeader(reader);
        final int profilCount = counts[0];
        final int relationCount = counts[1];

        if (relationCount == 0) {
            // ignore for now; later we may do sanity checks, if there are unused profiles
        }

        final ProfileBean[] profiles = ProfileBean.readProfiles(reader, profilCount);
        m_profiles.addAll(Arrays.asList(profiles));
    } catch (final ParseException pe) {
        final String msg = Messages.getString("org.kalypso.wspwin.core.WspCfg.6") //$NON-NLS-1$
                + profprojFile.getAbsolutePath() + " \n" + pe.getLocalizedMessage(); //$NON-NLS-1$
        final ParseException newPe = new ParseException(msg, pe.getErrorOffset());
        newPe.setStackTrace(pe.getStackTrace());
        throw newPe;
    }
}