From f358dabf0266e515e6e5d9e4e98a2a0ba43c1b05 Mon Sep 17 00:00:00 2001 From: avurro Date: Fri, 31 Jul 2015 22:24:34 +0200 Subject: [PATCH] pom modified and some improvements --- JMapper Framework/pom.xml | 4 ++-- .../jmapper/util/ClassesManager.java | 22 +++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/JMapper Framework/pom.xml b/JMapper Framework/pom.xml index 3c56e80a..d23df502 100644 --- a/JMapper Framework/pom.xml +++ b/JMapper Framework/pom.xml @@ -9,10 +9,10 @@ jmapper-core jar JMapper Framework - 1.3.3.1 + 1.4.0 - JMapper Framework is a java bean mapper based on javassist that exposes + JMapper Framework is a java bean mapper based on javassist. JMapper exposes interesting features as relational mapping, dynamic conversions and more diff --git a/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java b/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java index 7c216e3b..8419bdfc 100644 --- a/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java +++ b/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java @@ -18,14 +18,24 @@ import static com.googlecode.jmapper.util.AutoBoxing.boxingOperations; import static com.googlecode.jmapper.util.AutoBoxing.unBoxingOperations; -import static com.googlecode.jmapper.util.GeneralUtility.*; - +import static com.googlecode.jmapper.util.FilesManager.isPath; +import static com.googlecode.jmapper.util.GeneralUtility.collectionIsAssignableFrom; +import static com.googlecode.jmapper.util.GeneralUtility.enrichList; +import static com.googlecode.jmapper.util.GeneralUtility.getMethod; +import static com.googlecode.jmapper.util.GeneralUtility.isAccessModifier; +import static com.googlecode.jmapper.util.GeneralUtility.isBoolean; +import static com.googlecode.jmapper.util.GeneralUtility.isEmpty; +import static com.googlecode.jmapper.util.GeneralUtility.isNull; +import static com.googlecode.jmapper.util.GeneralUtility.mGet; +import static com.googlecode.jmapper.util.GeneralUtility.mSet; +import static com.googlecode.jmapper.util.GeneralUtility.mapIsAssignableFrom; +import static com.googlecode.jmapper.util.GeneralUtility.toList; +import static com.googlecode.jmapper.util.GeneralUtility.write; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import java.util.Random; import com.googlecode.jmapper.annotations.Annotation; import com.googlecode.jmapper.config.Constants; @@ -33,8 +43,6 @@ import com.googlecode.jmapper.enums.ChooseConfig; import com.googlecode.jmapper.operations.beans.MappedField; import com.googlecode.jmapper.xml.XML; - -import static com.googlecode.jmapper.util.FilesManager.isPath; /** * Utility class that allows you to manage classes. * @author Alessandro Vurro @@ -370,12 +378,12 @@ public static String mapperClassName(Class destination, Class source, Stri // if resource is a content, the mapper must be regenerated, // to ensure this, to the name is appended a random integer if(!isPath(resource)) - return className+= String.valueOf(new Random().nextInt()); + return write(className, String.valueOf(resource.hashCode())); String[]dep = resource.split("\\\\"); if(dep.length<=1)dep = resource.split("/"); String xml = dep[dep.length-1]; - return className += xml.replaceAll("\\.","").replaceAll(" ",""); + return write(className, xml.replaceAll("\\.","").replaceAll(" ","")); } /**