/** * Creates a non-internal error. Currently implemented in terms of * internal errors, but later we will create resourced messages. */ public static RuntimeException newError(String message) { return newInternal(message); }
/** * Creates a non-internal error. Currently implemented in terms of * internal errors, but later we will create resourced messages. */ public static RuntimeException newError(Throwable e, String message) { return newInternal(e, message); }
private static RuntimeException cannotConvert( Object o, final Type targetType) { return Util.newInternal( "cannot convert value '" + o + "' to targetType '" + targetType + "'"); }
/** * Throws an internal error if condition is not true. It would be called * <code>assert</code>, but that is a keyword as of JDK 1.4. */ public static void assertTrue(boolean b) { if (!b) { throw newInternal("assert failed"); } }
private URLConnection getConnection() { try { return url.openConnection(); } catch (IOException e) { throw Util.newInternal( e, "Error while opening properties file '" + url + "'"); } }
Dimension getPublicDimension(String dimensionName) { for (int i = 0; i < dimensions.length; i++) { if (dimensions[i].name.equals(dimensionName)) { return dimensions[i]; } } throw Util.newInternal( "Cannot find public dimension '" + dimensionName + "'"); } // END pass-through code block ---
Dimension getPublicDimension(String dimensionName) { for (int i = 0; i < dimensions.length; i++) { if (dimensions[i].name.equals(dimensionName)) { return dimensions[i]; } } throw Util.newInternal( "Cannot find public dimension '" + dimensionName + "'"); } // END pass-through code block ---
protected String deduceProductVersion(DatabaseMetaData databaseMetaData) { String productVersion; try { productVersion = databaseMetaData.getDatabaseProductVersion(); } catch (SQLException e11) { throw Util.newInternal( e11, "while detecting database product version"); } return productVersion; }
Cube getCube(String cubeName) { for (int i = 0; i < cubes.length; i++) { if (cubes[i].name.equals(cubeName)) { return cubes[i]; } } throw Util.newInternal("Cannot find cube '" + cubeName + "'"); } Dimension getPublicDimension(String dimensionName) {
Cube getCube(String cubeName) { for (int i = 0; i < cubes.length; i++) { if (cubes[i].name.equals(cubeName)) { return cubes[i]; } } throw Util.newInternal("Cannot find cube '" + cubeName + "'"); } Dimension getPublicDimension(String dimensionName) {
/** * Returns an exception indicating that we didn't expect to find this value * here. */ public RuntimeException unexpected(V value) { return Util.newInternal( "Was not expecting value '" + value + "' for enumeration '" + getClass().getName() + "' in this context"); }
public void tupleComplete() { if (memberList.size() < hierarchyList.size()) { throw Util.newInternal("too few members"); } } }
/** * Returns an exception indicating that we didn't expect to find this value * here. */ public static <T extends Enum<T>> RuntimeException badValue( Enum<T> anEnum) { return Util.newInternal( "Was not expecting value '" + anEnum + "' for enumeration '" + anEnum.getDeclaringClass().getName() + "' in this context"); }
public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) { throw Util.newInternal( "function '" + getSignature() + "' has not been implemented"); }
/** * Returns an error indicating that the value is illegal. (The client needs * to throw the error.) */ public RuntimeException badValue(int ordinal) { return Util.newInternal( "bad value " + ordinal + "(" + getName(ordinal) + ") for enumeration '" + getClass().getName() + "'"); }
protected int deduceMaxColumnNameLength(DatabaseMetaData databaseMetaData) { try { return databaseMetaData.getMaxColumnNameLength(); } catch (SQLException e) { throw Util.newInternal( e, "while detecting maxColumnNameLength"); } }
public InputStream openStream() { try { final URLConnection connection = getConnection(); this.lastModified = connection.getLastModified(); return connection.getInputStream(); } catch (IOException e) { throw Util.newInternal( e, "Error while opening properties file '" + url + "'"); } }
Dimension getDimension(Schema xmlSchema, String dimensionName) { for (int i = 0; i < dimensions.length; i++) { if (dimensions[i].name.equals(dimensionName)) { return dimensions[i].getDimension(xmlSchema); } } throw Util.newInternal( "Cannot find dimension '" + dimensionName + "' in cube '" + name + "'"); } // END pass-through code block ---
Dimension getDimension(Schema xmlSchema, String dimensionName) { for (int i = 0; i < dimensions.length; i++) { if (dimensions[i].name.equals(dimensionName)) { return dimensions[i].getDimension(xmlSchema); } } throw Util.newInternal( "Cannot find dimension '" + dimensionName + "' in cube '" + name + "'"); } public boolean equals(Object o) {
NoCacheMemberReader(MemberReader source) { this.source = source; if (!source.setCache(this)) { throw Util.newInternal( "MemberSource (" + source + ", " + source.getClass() + ") does not support cache-writeback"); } }