Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2009-11-04 10:05:00 +0000
committerAlexander Kurtakov2009-11-04 10:05:00 +0000
commit4c37b312941bdda1eb2715461660023e8f42f4ee (patch)
tree0a85912858bcc091cbee7287a219e0cc033a4f2a /rpmstubby
parentea5d32954c75e3d11fae5fdeb94e6ebafa7c2afa (diff)
downloadorg.eclipse.linuxtools-4c37b312941bdda1eb2715461660023e8f42f4ee.tar.gz
org.eclipse.linuxtools-4c37b312941bdda1eb2715461660023e8f42f4ee.tar.xz
org.eclipse.linuxtools-4c37b312941bdda1eb2715461660023e8f42f4ee.zip
2009-11-04 Alexander Kurtakov <akurtako@redhat.com>
* src/org/eclipse/linuxtools/rpmstubby/model/PomModel.java (getVersion): Return inherited parent version if one wasn't defined.
Diffstat (limited to 'rpmstubby')
-rw-r--r--rpmstubby/org.eclipse.linuxtools.rpmstubby/ChangeLog4
-rw-r--r--rpmstubby/org.eclipse.linuxtools.rpmstubby/src/org/eclipse/linuxtools/rpmstubby/model/PomModel.java9
2 files changed, 11 insertions, 2 deletions
diff --git a/rpmstubby/org.eclipse.linuxtools.rpmstubby/ChangeLog b/rpmstubby/org.eclipse.linuxtools.rpmstubby/ChangeLog
index c34fb0a109..594be96f9d 100644
--- a/rpmstubby/org.eclipse.linuxtools.rpmstubby/ChangeLog
+++ b/rpmstubby/org.eclipse.linuxtools.rpmstubby/ChangeLog
@@ -1,3 +1,7 @@
+2009-11-04 Alexander Kurtakov <akurtako@redhat.com>
+
+ * src/org/eclipse/linuxtools/rpmstubby/model/PomModel.java (getVersion): Return inherited parent version if one wasn't defined.
+
2009-09-07 Alexander Kurtakov <akurtako@redhat.com>
* src/org/eclipse/linuxtools/rpmstubby/model/PomModel.java (xpathEvalNodes): Format.
diff --git a/rpmstubby/org.eclipse.linuxtools.rpmstubby/src/org/eclipse/linuxtools/rpmstubby/model/PomModel.java b/rpmstubby/org.eclipse.linuxtools.rpmstubby/src/org/eclipse/linuxtools/rpmstubby/model/PomModel.java
index 8836f7242d..46ef33f281 100644
--- a/rpmstubby/org.eclipse.linuxtools.rpmstubby/src/org/eclipse/linuxtools/rpmstubby/model/PomModel.java
+++ b/rpmstubby/org.eclipse.linuxtools.rpmstubby/src/org/eclipse/linuxtools/rpmstubby/model/PomModel.java
@@ -88,12 +88,17 @@ public class PomModel {
}
/**
- * Returns the project version (xpath:/project/version).
+ * Returns the project version (xpath:/project/version) or the parent version if
+ * version is not present.
*
* @return The version.
*/
public String getVersion() {
- return xpathEval("/project/version");
+ String version = xpathEval("/project/version");
+ if (version.equals("")) {
+ version = xpathEval("/project/parent/version");
+ }
+ return version;
}
/**

Back to the top