@Override public void visitFieldInsn(int opcode, String owner, String name, String desc) { // App References to Enum org.hibernate.FlushMode.NEVER (0) should be transformed to reference FlushMode.MANUAL (0) instead. if (opcode == Opcodes.GETSTATIC && owner.equals("org/hibernate/FlushMode") && name.equals("NEVER") && desc.equals("Lorg/hibernate/FlushMode;")) { logger.debugf("Deprecated Hibernate51CompatibilityTransformer transformed application classes in '%s', " + "class '%s' is using org.hibernate.FlushMode.NEVER, change to org.hibernate.FlushMode.MANUAL." , moduleName, className); mv.visitFieldInsn(opcode, owner, "MANUAL", desc); transformedState.setClassTransformed(true); } else { mv.visitFieldInsn(opcode, owner, name, desc); } }
logger.debugf("Deprecated Hibernate51CompatibilityTransformer transformed application classes in '%s', " + "class '%s' is calling method %s.%s, which must be changed to use SharedSessionContractImplementor as parameter.", moduleName, className, owner, name); (owner.equals("org/hibernate/Session") || owner.equals("org/hibernate/BasicQueryContract")) && name.equals("getFlushMode") && desc.equals("()Lorg/hibernate/FlushMode;")) { logger.debugf("Deprecated Hibernate51CompatibilityTransformer transformed application classes in '%s', " + "class '%s' is calling %s.getFlushMode, which must be changed to call getHibernateFlushMode().", moduleName, className, owner); name.equals("getFirstResult") && desc.equals("()Ljava/lang/Integer;")) { logger.debugf("Deprecated Hibernate51CompatibilityTransformer transformed application classes in '%s', " + "class '%s', is calling org.hibernate.Query.getFirstResult, which must be changed to call getHibernateFirstResult() " + "so null can be returned when the value is uninitialized. Please note that if a negative value was set using " + name.equals("getMaxResults") && desc.equals("()Ljava/lang/Integer;")) { logger.debugf("Deprecated Hibernate51CompatibilityTransformer transformed application classes in '%s', " + "class '%s', is calling org.hibernate.Query.getMaxResults, which must be changed to call getHibernateMaxResults() " + "so that null will be returned when the value is uninitialized or ORM 5.1 org.hibernate.Query#setMaxResults was " + name.equals("setFirstResult") && desc.equals("(I)Lorg/hibernate/Query;")) { logger.debugf("Deprecated Hibernate51CompatibilityTransformer transformed application classes in '%s', " + "class '%s', is calling org.hibernate.Query.setFirstResult, which must be changed to call setHibernateFirstResult() " + "so setting a value < 0 results in pagination starting with the 0th row as was done in Hibernate ORM 5.1 " + name.equals("setMaxResults") &&
@Override public byte[] transform(final ClassLoader loader, final String className, final Class<?> classBeingRedefined, final ProtectionDomain protectionDomain, final byte[] classfileBuffer) { logger.debugf("Hibernate51CompatibilityTransformer transforming deployment class '%s' from '%s'", className, getModuleName(loader));
expectHeader(input, protocol.paramNumFiles()); int numFiles = input.readInt(); log.debugf("Received %d files for %s", numFiles, localPath); switch (numFiles) { case -1: { // Not found on DC expectHeader(input, protocol.paramFileSize()); final long length = input.readLong(); log.debugf("Received file [%s] of length %d", path, length); final File file = new File(localPath, path); if (!file.getParentFile().exists() && !file.getParentFile().mkdirs()) {
expectHeader(input, protocol.paramNumFiles()); int numFiles = input.readInt(); log.debugf("Received %d files for %s", numFiles, localPath); switch (numFiles) { case -1: { // Not found on DC expectHeader(input, protocol.paramFileSize()); final long length = input.readLong(); log.debugf("Received file [%s] of length %d", path, length); final File file = new File(localPath, path); if (!file.getParentFile().exists() && !file.getParentFile().mkdirs()) {