@@ -56,33 +56,13 @@ public abstract class AbstractApp extends AbstractRichPlugin implements App {
5656 /** JAR manifest with metadata about the application. */
5757 private Manifest manifest ;
5858
59+ // -- App methods --
60+
5961 @ Override
6062 public String getTitle () {
6163 return getInfo ().getName ();
6264 }
6365
64- @ Override
65- public String getVersion () {
66- // NB: We do not use VersionUtils.getVersion(c, groupId, artifactId)
67- // because that method does not cache the parsed Manifest and/or POM.
68- // We might have them already parsed here, and if not, we want to
69- // parse then cache locally, rather than discarding them afterwards.
70-
71- // try the manifest first, since it might know its build number
72- final Manifest m = getManifest ();
73- if (m != null ) {
74- final String v = m .getVersion ();
75- if (v != null ) return v ;
76- }
77- // try the POM
78- final POM p = getPOM ();
79- if (p != null ) {
80- final String v = p .getVersion ();
81- if (v != null ) return v ;
82- }
83- return "Unknown" ;
84- }
85-
8666 @ Override
8767 public POM getPOM () {
8868 if (pom == null ) {
@@ -145,4 +125,28 @@ public void quit() {
145125 getContext ().dispose ();
146126 }
147127
128+ // -- Versioned methods --
129+
130+ @ Override
131+ public String getVersion () {
132+ // NB: We do not use VersionUtils.getVersion(c, groupId, artifactId)
133+ // because that method does not cache the parsed Manifest and/or POM.
134+ // We might have them already parsed here, and if not, we want to
135+ // parse then cache locally, rather than discarding them afterwards.
136+
137+ // try the manifest first, since it might know its build number
138+ final Manifest m = getManifest ();
139+ if (m != null ) {
140+ final String v = m .getVersion ();
141+ if (v != null ) return v ;
142+ }
143+ // try the POM
144+ final POM p = getPOM ();
145+ if (p != null ) {
146+ final String v = p .getVersion ();
147+ if (v != null ) return v ;
148+ }
149+ return "Unknown" ;
150+ }
151+
148152}
0 commit comments