Example usage for java.lang InternalError InternalError

List of usage examples for java.lang InternalError InternalError

Introduction

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

Prototype

public InternalError() 

Source Link

Document

Constructs an InternalError with no detail message.

Usage

From source file:com.echopf.contents.blogs.ECHOEntryObject.java

public void fetchInBackground(FetchCallback<ECHOEntryObject> callback) {
    try {//from   ww  w . j av  a  2 s  .co m
        doFetch(false, callback);
    } catch (ECHOException e) {
        throw new InternalError();
    }
}

From source file:com.echopf.members.ECHOMembersGroupObject.java

public void fetchInBackground(FetchCallback<ECHOMembersGroupObject> callback) {
    try {/*from w w  w.j av a 2s .  c o m*/
        doFetch(false, callback);
    } catch (ECHOException e) {
        throw new InternalError();
    }
}

From source file:phex.rules.condition.FilenameCondition.java

@Override
public synchronized Object clone() {
    try {//w w w .  ja  v a2 s.  c  o m
        FilenameCondition clone = (FilenameCondition) super.clone();
        clone.terms = new ListOrderedSet();
        clone.terms.addAll(terms);
        return clone;
    } catch (CloneNotSupportedException exp) {
        throw new InternalError();
    }
}

From source file:com.echopf.members.ECHOMailmagObject.java

public void pushInBackground(PushCallback<ECHOMailmagObject> callback) {
    try {/*  w w w.ja va 2 s  .  co  m*/
        doPush(false, callback);
    } catch (ECHOException e) {
        throw new InternalError();
    }
}

From source file:com.echopf.contents.ECHOContentsCategoryObject.java

public void fetchInBackground(FetchCallback<ECHOContentsCategoryObject> callback) {
    try {/*w  w  w  .  j  av  a 2s. c om*/
        doFetch(false, callback);
    } catch (ECHOException e) {
        throw new InternalError();
    }
}

From source file:org.sweble.wikitext.engine.MassExpansionTest.java

private static NamedParametrizedSuite enumerateSuiteTestCasesFromZip(File zipFile) throws IOException {
    ZipFile zf = new ZipFile(zipFile);
    try {//from  ww  w.  j  a  v  a 2s  .  com
        Enumeration<? extends ZipEntry> entries = zf.entries();

        String suiteName;
        {
            String zfname = zipFile.getName();
            if (!zfname.toLowerCase().endsWith(".zip"))
                throw new InternalError();
            suiteName = zfname.substring(0, zfname.length() - 4);
        }

        String testPrefix = suiteName + "/tests/";
        String resourcesPrefix = suiteName + "/resources/";

        Map<FileUrlKey, String> fileUrls = new HashMap<FileUrlKey, String>();

        Map<String, ArticleDesc> articles = new HashMap<String, ArticleDesc>();

        List<Object[]> testCases = new ArrayList<Object[]>();

        while (entries.hasMoreElements()) {
            ZipEntry ze = (ZipEntry) entries.nextElement();

            // Skip directories
            if (ze.getName().endsWith("/"))
                continue;

            long longSize = ze.getSize();
            if (longSize > Integer.MAX_VALUE)
                throw new IllegalArgumentException("Archives contains files too big to process!");

            InputStream is = zf.getInputStream(ze);
            byte[] content = IOUtils.toByteArray(is);
            is.close();

            String filename = ze.getName();
            if (filename.startsWith(resourcesPrefix + "fileUrl-") && filename.endsWith(".txt")) {
                filename = filename.substring(resourcesPrefix.length());
                Matcher m = FILE_URL_RX.matcher(filename);
                if (!m.matches())
                    throw new IllegalArgumentException("Wrong 'fileUrl' pattern: " + ze.getName());

                String encName = m.group(1);
                int width = Integer.parseInt(m.group(2));
                int height = Integer.parseInt(m.group(3));

                FileUrlKey key = new FileUrlKey(encName, width, height);
                fileUrls.put(key, new String(content, "UTF8"));
            } else if (filename.startsWith(resourcesPrefix + "retrieveWikitext-")
                    && filename.endsWith(".wikitext")) {
                filename = filename.substring(resourcesPrefix.length());
                Matcher m = ARTICLE_RX.matcher(filename);
                if (!m.matches())
                    throw new IllegalArgumentException("Wrong 'retrieveWikitext' pattern: " + ze.getName());

                String encName = m.group(1);
                long revision = Long.parseLong(m.group(2));

                ArticleDesc article = new ArticleDesc(revision, new String(content, "UTF8"));

                articles.put(encName, article);
            } else if (filename.startsWith(testPrefix) && filename.endsWith(".txt")) {
                filename = filename.substring(testPrefix.length());
                Matcher m = TEST_RX.matcher(filename);
                if (!m.matches())
                    throw new IllegalArgumentException("Invalid test case filename: " + ze.getName());

                String title = m.group(1);
                String test = new String(content, "UTF8");

                testCases.add(new Object[] { title, fileUrls, articles, test });
            } else {
                System.err.println("Ignored file in " + zipFile + ": " + ze.getName());
                continue;
            }
        }

        Collections.sort(testCases, new Comparator<Object[]>() {
            @Override
            public int compare(Object[] o1, Object[] o2) {
                return ((String) o1[0]).compareTo((String) o2[0]);
            }
        });

        return new NamedParametrizedSuite(zipFile.getName(), MassExpansionTest.class.getSimpleName(),
                testCases);
    } finally {
        zf.close();
    }
}

From source file:net.sf.eclipsecs.core.projectconfig.filters.AbstractFilter.java

/**
 * {@inheritDoc}//ww w.j a v  a  2  s .c  om
 */
public IFilter clone() {

    IFilter o = null;
    try {
        o = (IFilter) super.clone();
    } catch (CloneNotSupportedException cnse) {
        // this shouldn't happen, since we are Cloneable
        throw new InternalError();
    }
    return o;
}

From source file:com.echopf.members.ECHOPushNotificationObject.java

public void pushInBackground(PushCallback<ECHOPushNotificationObject> callback) {
    try {/*from  ww  w  .jav a  2s. c o  m*/
        doPush(false, callback);
    } catch (ECHOException e) {
        throw new InternalError();
    }
}

From source file:com.echopf.members.ECHOMemberObject.java

public void pushInBackground(PushCallback<ECHOMemberObject> callback) {
    try {//from www  .  j a  va 2s. c o  m
        doPush(false, callback);
    } catch (ECHOException e) {
        throw new InternalError();
    }
}

From source file:com.echopf.contents.databases.ECHORecordObject.java

public void pushInBackground(PushCallback<ECHORecordObject> callback) {
    try {/*from  w ww. j  a  va  2 s .  c om*/
        doPush(false, callback);
    } catch (ECHOException e) {
        throw new InternalError();
    }
}