private static AbstractType<?> getRawAbstractType(Class<? extends AbstractType<?>> typeClass, TypeParser parser) throws ConfigurationException { try { Method method = typeClass.getDeclaredMethod("getInstance", TypeParser.class); return (AbstractType<?>) method.invoke(null, parser); } catch (NoSuchMethodException | IllegalAccessException e) { throw new ConfigurationException("Invalid comparator class " + typeClass.getName() + ": must define a public static instance field or a public static method getInstance(TypeParser)."); } catch (InvocationTargetException e) { ConfigurationException ex = new ConfigurationException("Invalid definition for comparator " + typeClass.getName() + "."); ex.initCause(e.getTargetException()); throw ex; } }
private static AbstractType<?> getRawAbstractType(Class<? extends AbstractType<?>> typeClass, TypeParser parser) throws ConfigurationException { try { Method method = typeClass.getDeclaredMethod("getInstance", TypeParser.class); return (AbstractType<?>) method.invoke(null, parser); } catch (NoSuchMethodException | IllegalAccessException e) { throw new ConfigurationException("Invalid comparator class " + typeClass.getName() + ": must define a public static instance field or a public static method getInstance(TypeParser)."); } catch (InvocationTargetException e) { ConfigurationException ex = new ConfigurationException("Invalid definition for comparator " + typeClass.getName() + "."); ex.initCause(e.getTargetException()); throw ex; } }
private static AbstractType<?> getRawAbstractType(Class<? extends AbstractType<?>> typeClass, TypeParser parser) throws ConfigurationException { try { Method method = typeClass.getDeclaredMethod("getInstance", TypeParser.class); return (AbstractType<?>) method.invoke(null, parser); } catch (NoSuchMethodException | IllegalAccessException e) { throw new ConfigurationException("Invalid comparator class " + typeClass.getName() + ": must define a public static instance field or a public static method getInstance(TypeParser)."); } catch (InvocationTargetException e) { ConfigurationException ex = new ConfigurationException("Invalid definition for comparator " + typeClass.getName() + "."); ex.initCause(e.getTargetException()); throw ex; } }
private static AbstractType<?> getRawAbstractType(Class<? extends AbstractType<?>> typeClass, TypeParser parser) throws ConfigurationException { try { Method method = typeClass.getDeclaredMethod("getInstance", TypeParser.class); return (AbstractType<?>) method.invoke(null, parser); } catch (NoSuchMethodException | IllegalAccessException e) { throw new ConfigurationException("Invalid comparator class " + typeClass.getName() + ": must define a public static instance field or a public static method getInstance(TypeParser)."); } catch (InvocationTargetException e) { ConfigurationException ex = new ConfigurationException("Invalid definition for comparator " + typeClass.getName() + "."); ex.initCause(e.getTargetException()); throw ex; } }
private static AbstractType<?> getRawAbstractType(Class<? extends AbstractType<?>> typeClass, TypeParser parser) throws ConfigurationException { try { Method method = typeClass.getDeclaredMethod("getInstance", TypeParser.class); return (AbstractType<?>) method.invoke(null, parser); } catch (NoSuchMethodException e) { throw new ConfigurationException("Invalid comparator class " + typeClass.getName() + ": must define a public static instance field or a public static method getInstance(TypeParser)."); } catch (IllegalAccessException e) { throw new ConfigurationException("Invalid comparator class " + typeClass.getName() + ": must define a public static instance field or a public static method getInstance(TypeParser)."); } catch (InvocationTargetException e) { ConfigurationException ex = new ConfigurationException("Invalid definition for comparator " + typeClass.getName() + "."); ex.initCause(e.getTargetException()); throw ex; } }
private static AbstractType<?> getAbstractType(String compareWith, TypeParser parser) throws SyntaxException, ConfigurationException { String className = compareWith.contains(".") ? compareWith : "org.apache.cassandra.db.marshal." + compareWith; Class<? extends AbstractType<?>> typeClass = FBUtilities.<AbstractType<?>>classForName(className, "abstract-type"); try { Method method = typeClass.getDeclaredMethod("getInstance", TypeParser.class); return (AbstractType<?>) method.invoke(null, parser); } catch (NoSuchMethodException | IllegalAccessException e) { // Trying to see if we have an instance field and apply the default parameter to it AbstractType<?> type = getRawAbstractType(typeClass); return AbstractType.parseDefaultParameters(type, parser); } catch (InvocationTargetException e) { ConfigurationException ex = new ConfigurationException("Invalid definition for comparator " + typeClass.getName() + "."); ex.initCause(e.getTargetException()); throw ex; } }
private static AbstractType<?> getAbstractType(String compareWith, TypeParser parser) throws SyntaxException, ConfigurationException { String className = compareWith.contains(".") ? compareWith : "org.apache.cassandra.db.marshal." + compareWith; Class<? extends AbstractType<?>> typeClass = FBUtilities.<AbstractType<?>>classForName(className, "abstract-type"); try { Method method = typeClass.getDeclaredMethod("getInstance", TypeParser.class); return (AbstractType<?>) method.invoke(null, parser); } catch (NoSuchMethodException | IllegalAccessException e) { // Trying to see if we have an instance field and apply the default parameter to it AbstractType<?> type = getRawAbstractType(typeClass); return AbstractType.parseDefaultParameters(type, parser); } catch (InvocationTargetException e) { ConfigurationException ex = new ConfigurationException("Invalid definition for comparator " + typeClass.getName() + "."); ex.initCause(e.getTargetException()); throw ex; } }
private static AbstractType<?> getAbstractType(String compareWith, TypeParser parser) throws SyntaxException, ConfigurationException { String className = compareWith.contains(".") ? compareWith : "org.apache.cassandra.db.marshal." + compareWith; Class<? extends AbstractType<?>> typeClass = FBUtilities.<AbstractType<?>>classForName(className, "abstract-type"); try { Method method = typeClass.getDeclaredMethod("getInstance", TypeParser.class); return (AbstractType<?>) method.invoke(null, parser); } catch (NoSuchMethodException | IllegalAccessException e) { // Trying to see if we have an instance field and apply the default parameter to it AbstractType<?> type = getRawAbstractType(typeClass); return AbstractType.parseDefaultParameters(type, parser); } catch (InvocationTargetException e) { ConfigurationException ex = new ConfigurationException("Invalid definition for comparator " + typeClass.getName() + "."); ex.initCause(e.getTargetException()); throw ex; } }
private static AbstractType<?> getAbstractType(String compareWith, TypeParser parser) throws SyntaxException, ConfigurationException { String className = compareWith.contains(".") ? compareWith : "org.apache.cassandra.db.marshal." + compareWith; Class<? extends AbstractType<?>> typeClass = FBUtilities.<AbstractType<?>>classForName(className, "abstract-type"); try { Method method = typeClass.getDeclaredMethod("getInstance", TypeParser.class); return (AbstractType<?>) method.invoke(null, parser); } catch (NoSuchMethodException | IllegalAccessException e) { // Trying to see if we have an instance field and apply the default parameter to it AbstractType<?> type = getRawAbstractType(typeClass); return AbstractType.parseDefaultParameters(type, parser); } catch (InvocationTargetException e) { ConfigurationException ex = new ConfigurationException("Invalid definition for comparator " + typeClass.getName() + "."); ex.initCause(e.getTargetException()); throw ex; } }
private static AbstractType<?> getAbstractType(String compareWith, TypeParser parser) throws SyntaxException, ConfigurationException { String className = compareWith.contains(".") ? compareWith : "org.apache.cassandra.db.marshal." + compareWith; Class<? extends AbstractType<?>> typeClass = FBUtilities.<AbstractType<?>>classForName(className, "abstract-type"); try { Method method = typeClass.getDeclaredMethod("getInstance", TypeParser.class); return (AbstractType<?>) method.invoke(null, parser); } catch (NoSuchMethodException e) { // Trying to see if we have an instance field and apply the default parameter to it AbstractType<?> type = getRawAbstractType(typeClass); return AbstractType.parseDefaultParameters(type, parser); } catch (IllegalAccessException e) { // Trying to see if we have an instance field and apply the default parameter to it AbstractType<?> type = getRawAbstractType(typeClass); return AbstractType.parseDefaultParameters(type, parser); } catch (InvocationTargetException e) { ConfigurationException ex = new ConfigurationException("Invalid definition for comparator " + typeClass.getName() + "."); ex.initCause(e.getTargetException()); throw ex; } }
ex.initCause(err); throw ex;
ex.initCause(err); throw ex;
ex.initCause(err); throw ex;
ex.initCause(err); throw ex;