protected static boolean autoFlushIfRequired(SessionImpl rawSession, Set<Serializable> querySpaces) { try { return (Boolean)AUTO_FLUSH_If_REQUIRED.invoke(rawSession, querySpaces); } catch (IllegalAccessException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
public static RuntimeException rethrow(Throwable throwable) { if (throwable instanceof RuntimeException) { throw (RuntimeException)throwable; } if (throwable instanceof Error) { throw (Error)throwable; } throw new UncheckedException(throwable); } }
if (!UncheckedException.isRuntimeExceptionOrError(exceptionType)) { throw new IllegalProgramException( defaultConstructorThrowsCheckedException( throw new AssertionError(ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException());
public static XEntityManagerFactoryBuilderImpl of( PersistenceUnitDescriptor persistenceUnit, Map<?, ?> integrationSettings, ClassLoader providedClassLoader) { try { return CONSTRUCTOR.newInstance(persistenceUnit, integrationSettings, providedClassLoader); } catch (InstantiationException | IllegalAccessException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
protected XQuery applyProperties(XQuery query) { try { return (XQuery)APPLY_PROPERTIES.invoke(this, query); } catch (IllegalAccessException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
protected static void afterOperation(SessionImpl rawSession, boolean success) { try { AFTER_OPERATION_METHOD.invoke(rawSession, success); } catch (IllegalAccessException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
protected static void initQuery(SessionImpl rawSession, Query query, NamedQueryDefinition nqd) { try { INIT_QUERY_METHOD.invoke(rawSession, query, nqd); } catch (IllegalAccessException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
@Override public AbstractObjectModel4JPAReplacer createReplacer(String className, File classFile) { try { return (AbstractObjectModel4JPAReplacer)REPLACER_CONSTRUCTOR.newInstance(this, className, classFile); } catch (InstantiationException | IllegalAccessException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
protected void setInvocationHandlerWrapped(InvocationHandler invocationHandler, Session session) { try { INVOCATION_HANDLER_SET_WRAPPED.invoke(invocationHandler, session); } catch (IllegalAccessException ex) { throw new AssertionError(ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
protected static void errorIfClosed(SessionImpl rawSession) { try { ERROR_IF_CLOSED_METHOD.invoke(rawSession); } catch (IllegalAccessException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
protected static void checkTransactionSynchStatus(SessionImpl rawSession) { try { CHECK_TRANSACTION_SYNCH_STATUS_METHOD.invoke(rawSession); } catch (IllegalAccessException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
private static Object newDynamicFilterKey(FilterImpl filterImpl) { try { return DYNAMIC_FILTER_KEY_CONSTRUCTOR.newInstance(filterImpl); } catch (InstantiationException ex) { throw new AssertionError("Internal bug", ex); } catch (IllegalAccessException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
public static PersistenceProvider newInstance(List<PersistenceUnitInfoDescriptor> descriptors) { try { return (PersistenceProvider)CONSTRUCTOR.newInstance(descriptors); } catch (InstantiationException ex) { throw new AssertionError("Internal bug", ex); } catch (IllegalAccessException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
protected InvocationHandler createInvocationHandler(Session session) { try { if (INVOCATION_HANDLER_CONSTRUCTOR.getParameterTypes().length == 1) { return (InvocationHandler)INVOCATION_HANDLER_CONSTRUCTOR.newInstance(session); } return (InvocationHandler)INVOCATION_HANDLER_CONSTRUCTOR.newInstance(this, session); } catch (InstantiationException | IllegalAccessException ex) { throw new AssertionError(ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
public static XQueryTranslatorImpl newInstance( String queryIdentifier, String queryString, PathPlanKey pathPlanKey, Map<String, Filter> filters, SessionFactoryImplementor factory, EntityGraphQueryHint entityGraphQueryHint) { try { return CONSTRUCTOR.newInstance( new Object[] { queryIdentifier, queryString, pathPlanKey, filters, factory, entityGraphQueryHint } ); } catch (InstantiationException ex) { throw new AssertionError("Internal bug", ex); } catch (IllegalAccessException ex) { throw UncheckedException.rethrow(ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
throw new AssertionError(ex); } catch (InvocationTargetException ex) { UncheckedException.rethrow(ex.getTargetException());
private static ClassWrapper getInstance0(Class<? extends ClassWrapper> wrapperClass) { Arguments.mustNotBeNull("enhancerClass", wrapperClass); Arguments.mustBeCompatibleWithValue("wrapperClass", wrapperClass, ClassWrapper.class); Arguments.mustNotBeAbstract("wrapperClass", wrapperClass); Constructor<? extends ClassWrapper> constructor; try { constructor = wrapperClass.getDeclaredConstructor(); } catch (NoSuchMethodException ex) { throw new IllegalArgumentException( mustSupportDefaultConstructor(wrapperClass), ex ); } constructor.setAccessible(true); try { return constructor.newInstance(); } catch (InstantiationException ex) { throw UncheckedException.rethrow(ex); } catch (IllegalAccessException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } }
@Override public Serializable getIdentifier() { if (!this.isUninitialized()) { try { return (Serializable) this.getIdentifierMethod .invoke(this.lazyInitializer.getImplementation(), EMPTY_ARGS); } catch (IllegalAccessException | IllegalArgumentException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { throw UncheckedException.rethrow(ex.getTargetException()); } } return this.lazyInitializer.getIdentifier(); }
private void setRawIdentifier(Serializable id) { this.lazyInitializer.setIdentifier(id); if (!this.isUninitialized() && !this.disableSetTargetIdentifier) { try { Method setIdentifierMethod = this.setIdentifierMethod; if (!setIdentifierMethod.isAccessible()) { setIdentifierMethod.setAccessible(true); } this.disableTargetListener = true; try { setIdentifierMethod.invoke(this.getImplementation(), new Object[] { id }); } finally { this.disableTargetListener = false; } } catch (IllegalAccessException | IllegalArgumentException ex) { throw new AssertionError("Internal bug", ex); } catch (InvocationTargetException ex) { UncheckedException.rethrow(ex.getTargetException()); } } }
private void generate(Collection<MetadataClass> metadataClasses) { for (MetadataClass metadataClass : metadataClasses) { try { JavaFileObject fo = this .processingEnv .getFiler() .createSourceFile(metadataClass.getName() + SourceGenerator.NAME_POSTFIX); try (Writer writer = fo.openWriter()) { new SourceGenerator(metadataClass, metadataClasses).generate(writer); } } catch (Throwable ex) { UncheckedException.rethrow(ex); } } } }