List of usage examples for java.lang InternalError InternalError
public InternalError()
InternalError
with no detail message. From source file:org.sweble.wikitext.parser.postprocessor.ElementType.java
public static ElementType getType(WtNamedXmlElement e) { String name = e.getName().toLowerCase(); if (name.isEmpty()) throw new InternalError(); if (name.charAt(0) == '@') { return (ElementType) xmlElementTypeMap.get(name.substring(1)); } else {/*from w w w . jav a 2 s . com*/ ElementType type = (ElementType) xmlElementTypeMap.get(name); if (type == null) return UNKNOWN; return type; } }
From source file:CopyOnWriteArrayList.java
/** * Returns a shallow copy of this list. (The elements themselves * are not copied.)/*from ww w . ja v a 2 s. c o m*/ * * @return a clone of this list */ public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
From source file:net.sf.eclipsecs.core.projectconfig.ProjectConfigurationWorkingCopy.java
/** * {@inheritDoc}//from w w w. j av a 2 s . co m */ public Object clone() { ProjectConfigurationWorkingCopy clone = null; try { clone = (ProjectConfigurationWorkingCopy) super.clone(); clone.mFileSets = new LinkedList<FileSet>(); clone.setUseSimpleConfig(this.isUseSimpleConfig()); clone.setSyncFormatter(this.isSyncFormatter()); // clone file sets for (FileSet fileSet : getFileSets()) { clone.getFileSets().add(fileSet.clone()); } // clone filters List<IFilter> clonedFilters = new ArrayList<IFilter>(); for (IFilter filter : getFilters()) { clonedFilters.add(filter.clone()); } clone.mFilters = clonedFilters; } catch (CloneNotSupportedException e) { throw new InternalError(); } return clone; }
From source file:CopyOnWriteArrayList.java
/** * Returns a shallow copy of this list. (The elements themselves are not * copied.)//from w ww . j a v a2s . c o m * * @return a clone of this list. */ public Object clone() { try { Object[] elementData = array(); CopyOnWriteArrayList v = (CopyOnWriteArrayList) super.clone(); v.array_ = new Object[elementData.length]; System.arraycopy(elementData, 0, v.array_, 0, elementData.length); return v; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
From source file:immf.Util.java
public static String getParameter(String header, String name) { HeaderTokenizer tokenizer = new HeaderTokenizer(header, HeaderTokenizer.MIME, true); HeaderTokenizer.Token token;//from w w w . j a va 2s . co m StringBuffer sb = new StringBuffer(); // It is specified in first encoded-part. Encoding encoding = new Encoding(); String n; String v; try { while (true) { token = tokenizer.next(); if (token.getType() == HeaderTokenizer.Token.EOF) break; if (token.getType() != ';') continue; token = tokenizer.next(); checkType(token); n = token.getValue(); token = tokenizer.next(); if (token.getType() != '=') { throw new ParseException("Illegal token : " + token.getValue()); } token = tokenizer.next(); checkType(token); v = token.getValue(); if (n.equalsIgnoreCase(name)) { // It is not divided and is not encoded. return v; } int index = name.length(); if (!n.startsWith(name) || n.charAt(index) != '*') { // another parameter continue; } // be folded, or be encoded int lastIndex = n.length() - 1; if (n.charAt(lastIndex) == '*') { sb.append(decodeRFC2231(v, encoding)); } else { sb.append(v); } if (index == lastIndex) { // not folding break; } } return new String(sb); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ParseException e) { e.printStackTrace(); } throw new InternalError(); }
From source file:org.netflux.core.FieldMetadata.java
/** * Returns a copy of this metadata./*w ww. ja v a 2s . c o m*/ * * @return a clone of this <code>FieldMetadata</code> instance */ @Override public FieldMetadata clone() { try { // No need to do anything else return (FieldMetadata) super.clone(); } catch (CloneNotSupportedException exc) { FieldMetadata.log.fatal(FieldMetadata.messages.getString("error.clone.not.supported"), exc); throw new InternalError(); } }
From source file:craterdog.collections.primitives.RandomizedTree.java
@Override public Object clone() { try {//from w w w. j a va 2 s .co m @SuppressWarnings("unchecked") RandomizedTree<E> copy = (RandomizedTree<E>) super.clone(); copy.duplicatesAllowed = this.duplicatesAllowed; copy.comparator = this.comparator; copy.root = null; for (E element : this) { copy.add(element); } return copy; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
From source file:net.gtaun.shoebill.data.Color.java
@Override public Color clone() { try {//from w w w .jav a2 s .com return (Color) super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(); } }
From source file:IntHashMap.java
/** * Returns a shallow copy of this <tt>IntHashMap</tt> instance: the keys and * values themselves are not cloned.// w ww . j ava 2 s.c om * * @return a shallow copy of this map. */ public Object clone() { try { IntHashMap t = (IntHashMap) super.clone(); t.table = new Entry[table.length]; for (int i = table.length; i-- > 0;) { t.table[i] = (table[i] != null) ? (Entry) table[i].clone() : null; } t.keySet = null; t.entrySet = null; t.values = null; t.modCount = 0; return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
From source file:com.projity.script.object.TimeIntervals.java
public Object clone() { try {// w w w . j ava 2s. c o m TimeIntervals t = (TimeIntervals) super.clone(); t.win = new LinkedList<TimeWindow>(); t.history = new LinkedList<TimeWindow>(); for (TimeWindow w : win) t.win.add(w); for (TimeWindow w : history) t.history.add(w); return t; } catch (CloneNotSupportedException e) { throw new InternalError(); } }