Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2019-07-05 10:18:25 +0000
committerEd Merks2019-07-05 10:18:25 +0000
commit8cb8e7b61eeb9917f975a2e7621c830ffcbd60de (patch)
treefc23186fae39994cee798ae660832332c8a2a759
parent9e87da3da9434817a06234902ff4c8175530bed2 (diff)
downloadorg.eclipse.oomph-8cb8e7b61eeb9917f975a2e7621c830ffcbd60de.tar.gz
org.eclipse.oomph-8cb8e7b61eeb9917f975a2e7621c830ffcbd60de.tar.xz
org.eclipse.oomph-8cb8e7b61eeb9917f975a2e7621c830ffcbd60de.zip
[549005] NullPointerException in ReflectUtil.getValue()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=549005
-rw-r--r--plugins/org.eclipse.oomph.base/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.oomph.gitbash/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.oomph.util/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.oomph.util/pom.xml2
-rw-r--r--plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/ReflectUtil.java16
5 files changed, 21 insertions, 9 deletions
diff --git a/plugins/org.eclipse.oomph.base/META-INF/MANIFEST.MF b/plugins/org.eclipse.oomph.base/META-INF/MANIFEST.MF
index de8aaf951..12146cba5 100644
--- a/plugins/org.eclipse.oomph.base/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.oomph.base/META-INF/MANIFEST.MF
@@ -15,6 +15,6 @@ Export-Package: org.eclipse.oomph.base;version="1.12.0";x-internal:=true,
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.10.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.ecore.xmi;bundle-version="[2.10.0,3.0.0)";visibility:=reexport,
- org.eclipse.oomph.util;bundle-version="[1.11.0,2.0.0)";visibility:=reexport
+ org.eclipse.oomph.util;bundle-version="[1.12.0,2.0.0)";visibility:=reexport
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.oomph.base
diff --git a/plugins/org.eclipse.oomph.gitbash/META-INF/MANIFEST.MF b/plugins/org.eclipse.oomph.gitbash/META-INF/MANIFEST.MF
index 27634e2f8..e2df180af 100644
--- a/plugins/org.eclipse.oomph.gitbash/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.oomph.gitbash/META-INF/MANIFEST.MF
@@ -17,7 +17,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.egit.ui;bundle-version="[2.0.0,6.0.0)",
org.eclipse.mylyn.tasks.core;bundle-version="[3.3.0,4.0.0)";resolution:=optional,
org.eclipse.mylyn.tasks.ui;bundle-version="[3.3.0,4.0.0)";resolution:=optional,
- org.eclipse.oomph.util;bundle-version="[1.11.0,2.0.0)"
+ org.eclipse.oomph.util;bundle-version="[1.12.0,2.0.0)"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.oomph.gitbash;version="1.11.0";x-internal:=true,
diff --git a/plugins/org.eclipse.oomph.util/META-INF/MANIFEST.MF b/plugins/org.eclipse.oomph.util/META-INF/MANIFEST.MF
index a0f305a92..c99491f9a 100644
--- a/plugins/org.eclipse.oomph.util/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.oomph.util/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.oomph.util;singleton:=true
-Bundle-Version: 1.11.0.qualifier
+Bundle-Version: 1.12.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -13,8 +13,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.apache.httpcomponents.httpclient;bundle-version="[4.0.0,5.0.0)",
org.eclipse.emf.common;bundle-version="[2.10.0,3.0.0)";visibility:=reexport
Import-Package: org.osgi.framework;version="[1.3.0,2.0.0)"
-Export-Package: org.eclipse.oomph.internal.util;version="1.11.0";x-internal:=true,
- org.eclipse.oomph.internal.util.table;version="1.11.0";x-internal:=true,
- org.eclipse.oomph.util;version="1.11.0";x-internal:=true
+Export-Package: org.eclipse.oomph.internal.util;version="1.12.0";x-internal:=true,
+ org.eclipse.oomph.internal.util.table;version="1.12.0";x-internal:=true,
+ org.eclipse.oomph.util;version="1.12.0";x-internal:=true
Eclipse-BuddyPolicy: registered
Automatic-Module-Name: org.eclipse.oomph.util
diff --git a/plugins/org.eclipse.oomph.util/pom.xml b/plugins/org.eclipse.oomph.util/pom.xml
index 6e6de5c6b..e8b974a4d 100644
--- a/plugins/org.eclipse.oomph.util/pom.xml
+++ b/plugins/org.eclipse.oomph.util/pom.xml
@@ -20,7 +20,7 @@
</parent>
<groupId>org.eclipse.oomph</groupId>
<artifactId>org.eclipse.oomph.util</artifactId>
- <version>1.11.0-SNAPSHOT</version>
+ <version>1.12.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
diff --git a/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/ReflectUtil.java b/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/ReflectUtil.java
index 36a1f9929..1f4c5ef79 100644
--- a/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/ReflectUtil.java
+++ b/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/ReflectUtil.java
@@ -200,10 +200,22 @@ public final class ReflectUtil
{
if (target instanceof Class)
{
- return getValue(getField((Class<?>)target, fieldName), null);
+ Field field = getField((Class<?>)target, fieldName);
+ if (field == null)
+ {
+ throw new ReflectionException("No field " + fieldName);
+ }
+
+ return getValue(field, null);
+ }
+
+ Field field = getField(target.getClass(), fieldName);
+ if (field == null)
+ {
+ throw new ReflectionException("No field " + fieldName);
}
- return getValue(getField(target.getClass(), fieldName), target);
+ return getValue(field, target);
}
public static void setValue(String fieldName, Object target, Object value)

Back to the top