]> git.mxchange.org Git - jcore.git/commitdiff
New jar for merging arrays added
authorRoland Haeder <roland@mxchange.org>
Thu, 27 Aug 2015 13:33:54 +0000 (15:33 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 27 Aug 2015 13:34:01 +0000 (15:34 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/commons-lang3-3.4.jar [new file with mode: 0644]
nbproject/project.properties
src/org/mxchange/jcore/BaseFrameworkSystem.java

diff --git a/lib/commons-lang3-3.4.jar b/lib/commons-lang3-3.4.jar
new file mode 100644 (file)
index 0000000..8ec91d4
Binary files /dev/null and b/lib/commons-lang3-3.4.jar differ
index 33c94ac75a243ba291d89469b6bd2083998d344a..8659f929f52df34606b7a541120d8fffc7568802 100644 (file)
@@ -32,6 +32,7 @@ dist.javadoc.dir=${dist.dir}/javadoc
 endorsed.classpath=
 excludes=
 file.reference.commons-codec-1.10.jar=lib/commons-codec-1.10.jar
+file.reference.commons-lang3-3.4.jar=lib\\commons-lang3-3.4.jar
 file.reference.log4j-api-2.3.jar=lib/log4j-api-2.3.jar
 file.reference.log4j-core-2.3.jar=lib/log4j-core-2.3.jar
 includes=**
@@ -41,7 +42,8 @@ jar.index=${jnlp.enabled}
 javac.classpath=\
     ${file.reference.log4j-api-2.3.jar}:\
     ${file.reference.log4j-core-2.3.jar}:\
-    ${file.reference.commons-codec-1.10.jar}
+    ${file.reference.commons-codec-1.10.jar}:\
+    ${file.reference.commons-lang3-3.4.jar}
 # Space-separated list of extra javac options
 javac.compilerargs=-Xlint:unchecked
 javac.deprecation=true
@@ -62,6 +64,7 @@ javadoc.nonavbar=false
 javadoc.notree=false
 javadoc.private=true
 javadoc.reference.commons-codec-1.10.jar=/home/quix0r/MyProjects/JARs/commons-codec-1.10-javadoc.jar
+javadoc.reference.commons-lang3-3.4.jar=C:\\Users\\KLC\\JARs\\commons-lang3-3.4-javadoc.jar
 javadoc.reference.log4j-api-2.3.jar=/home/quix0r/MyProjects/JARs/log4j-api-2.3-javadoc.jar
 javadoc.splitindex=true
 javadoc.use=true
@@ -96,6 +99,7 @@ run.test.classpath=\
     ${build.test.classes.dir}
 source.encoding=UTF-8
 source.reference.commons-codec-1.10.jar=/home/quix0r/MyProjects/JARs/commons-codec-1.10-sources.jar
+source.reference.commons-lang3-3.4.jar=C:\\Users\\KLC\\JARs\\commons-lang3-3.4-src.zip!/commons-lang3-3.4-src/src/main/java/
 source.reference.log4j-api-2.3.jar=/home/quix0r/MyProjects/JARs/log4j-api-2.3-sources.jar
 src.dir=src
 test.src.dir=test
index 25a0d3c30ce5556e7ce52bd8173f28c8bcbcff9c..5443e55b0b89f12b411583644cdb504a89abfc1e 100644 (file)
@@ -33,6 +33,7 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.ResourceBundle;
 import java.util.StringTokenizer;
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.mxchange.jcore.application.Application;
@@ -220,11 +221,27 @@ public class BaseFrameworkSystem implements FrameworkInterface {
                // Trace messahe
                this.getLogger().trace(MessageFormat.format("targetClass={0},methodName={1}", targetClass, methodName)); //NOI18N
 
-               // Get target class instance
-               Class<? extends FrameworkInterface> c = this.getClassFromTarget(instance, targetClass);
 
-               // Init field instance
-               Method method = c.getDeclaredMethod(methodName, new Class<?>[0]);
+               // Init method instance
+               Method method = null;
+
+               // Try it from target class
+               try {
+                       // Get target class instance
+                       Class<? extends FrameworkInterface> c = this.getClassFromTarget(instance, targetClass);
+
+                       // Init field instance
+                       method = c.getDeclaredMethod(methodName, new Class<?>[0]);
+               } catch (final NoSuchMethodException e) {
+                       // Didn't found it
+                       this.getLogger().warn(e);
+
+                       // So try it from super class
+                       Class<? extends FrameworkInterface> c = this.getClassFromTarget(instance, "BaseFrameworkSystem"); //NOI18N
+
+                       // Init field instance
+                       method = c.getDeclaredMethod(methodName, new Class<?>[0]);
+               }
 
                // Assert on field
                assert (method instanceof Method) : "method is not a Method instance"; //NOI18N
@@ -249,11 +266,26 @@ public class BaseFrameworkSystem implements FrameworkInterface {
                // Trace messahe
                this.getLogger().trace(MessageFormat.format("targetClass={0},methodName={1},type={2}", targetClass, methodName, type)); //NOI18N
 
-               // Get target class instance
-               Class<? extends FrameworkInterface> c = this.getClassFromTarget(instance, targetClass);
+               // Init method instance
+               Method method = null;
 
-               // Init field instance
-               Method method = c.getDeclaredMethod(methodName, type);
+               // Try it from target class
+               try {
+                       // Get target class instance
+                       Class<? extends FrameworkInterface> c = this.getClassFromTarget(instance, targetClass);
+
+                       // Init field instance
+                       method = c.getDeclaredMethod(methodName, type);
+               } catch (final NoSuchMethodException e) {
+                       // Didn't found it
+                       this.getLogger().warn(e);
+
+                       // So try it from super class
+                       Class<? extends FrameworkInterface> c = this.getClassFromTarget(instance, "BaseFrameworkSystem"); //NOI18N
+
+                       // Init field instance
+                       method = c.getDeclaredMethod(methodName, type);
+               }
 
                // Assert on field
                assert (method instanceof Method) : "method is not a Method instance"; //NOI18N
@@ -1191,8 +1223,11 @@ public class BaseFrameworkSystem implements FrameworkInterface {
                // Init field tye
                Class<?> type = null;
 
+               // Get super class fields
+               Field[] superFields = this.getClassFromTarget(instance, "BaseFrameworkSystem").getDeclaredFields(); //NOI18N
+
                // Get all attributes from given instance
-               Field[] fields = this.getClassFromTarget(instance, targetClass).getFields();
+               Field[] fields = ArrayUtils.addAll(superFields, this.getClassFromTarget(instance, targetClass).getDeclaredFields());
 
                // Debug message
                this.getLogger().debug(MessageFormat.format("fields()={0}", fields.length)); //NOI18N
@@ -1222,7 +1257,7 @@ public class BaseFrameworkSystem implements FrameworkInterface {
                }
 
                // Debug message
-               this.getLogger().debug(MessageFormat.format("type={0}", type));
+               this.getLogger().debug(MessageFormat.format("type={0}", type)); //NOI18N
 
                // type should not be null
                if (null == type) {