Bug 7903 - org.apache.fop.apps.Version.getVersion()
Summary: org.apache.fop.apps.Version.getVersion()
Status: CLOSED INVALID
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 0.20.3
Hardware: PC Linux
: P3 enhancement
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
: 17817 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-04-10 01:45 UTC by Jonathan Moore
Modified: 2012-04-01 13:48 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Moore 2002-04-10 01:45:53 UTC
getVersion returns null
Comment 1 J.Pietschmann 2002-06-03 09:07:41 UTC
This means the configuration hasn't been read or someone deleted the version
key/value from the config.xml file.
Comment 2 Oleg Tkachenko 2002-11-14 16:58:41 UTC
Looks like invalid. But Jonathan, feel free to reopen the bug.
Comment 3 J.Pietschmann 2003-03-10 09:28:46 UTC
*** Bug 17817 has been marked as a duplicate of this bug. ***
Comment 4 M.H. 2003-03-10 11:16:14 UTC
So, is this a bug? I looked into config.xml, there is:

  <entry>
    <key>version</key>
    <value>FOP @version@</value>
  </entry>

??? But then, why does getVersion() return null?
Comment 5 J.Pietschmann 2003-03-10 13:11:46 UTC
The <value>FOP @version@</value> is in the source config.xml. This is filtered
to get the real version into the file during build and packaged into the FOP
jar. Therefore: look into the jar to see what really is in there.
Furthermore, Version.getVersion() returns null unless either the config.xml is
read or the version is explicitely set in the Configuration class (static
method).
The config.xml is loaded automatically from the jar during instanciation of an
an Options object. If FOP is embedded, the FOP core will not automatically
instanciate Options, the embedder must take care of this. Often an userconfig
is loaded through a 'new Options("userconfig.xml")' or such, this will also
load the config.xml from the jar. It's quirky but its supposed to work this way.
Comment 6 M.H. 2003-03-10 14:11:53 UTC
okay, thats FOP internal stuff - i'm just a user, so why do you set this bug 
to "Resolved Invalid"? as a user, i just call 
org.apache.fop.apps.Version.getVersion() that returns null ...
Comment 7 J.Pietschmann 2003-03-10 23:32:22 UTC
You are not supposed to call Version.getVersion() before you've instantiated
an Options object. In fact, the original intention was that you weren't supposed
to call Version.getVersion() at all. This is actually documented somewhere.
FOP wasn't originally designed with an API in mind. This will change in some
future release.
Comment 8 M.H. 2003-03-11 09:34:53 UTC
hm, okay but it's the same way like in apache Xerces: 

System.out.println("Version: "+org.apache.xerces.impl.Version.getVersion());

works flawlessly :-)
Comment 9 Glenn Adams 2012-04-01 13:48:29 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs