Source Code Cross Referenced for Version.java in  » Code-Analyzer » findbugs » edu » umd » cs » findbugs » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » findbugs » edu.umd.cs.findbugs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * FindBugs - Find bugs in Java programs
003:         * Copyright (C) 2003-2005 University of Maryland
004:         * 
005:         * This library is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU Lesser General Public
007:         * License as published by the Free Software Foundation; either
008:         * version 2.1 of the License, or (at your option) any later version.
009:         * 
010:         * This library is distributed in the hope that it will be useful,
011:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:         * Lesser General Public License for more details.
014:         * 
015:         * You should have received a copy of the GNU Lesser General Public
016:         * License along with this library; if not, write to the Free Software
017:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
018:         */
019:
020:        package edu.umd.cs.findbugs;
021:
022:        import java.io.IOException;
023:        import java.io.InputStream;
024:        import java.text.SimpleDateFormat;
025:        import java.util.Date;
026:        import java.util.Properties;
027:
028:        /**
029:         * Version number and release date information.
030:         */
031:        public class Version {
032:            /**
033:             * Major version number.
034:             */
035:            public static final int MAJOR = 1;
036:
037:            /**
038:             * Minor version number.
039:             */
040:            public static final int MINOR = 3;
041:
042:            /**
043:             * Patch level.
044:             */
045:            public static final int PATCHLEVEL = 2;
046:
047:            /**
048:             * Development version or release candidate?
049:             */
050:            public static final boolean IS_DEVELOPMENT = false;
051:
052:            /**
053:             * Release candidate number.
054:             * "0" indicates that the version is not a release candidate.
055:             */
056:            public static final int RELEASE_CANDIDATE = 0;
057:
058:            /**
059:             * Release date.
060:             */
061:            public static final String COMPUTED_DATE;
062:            public static final String DATE;
063:            public static final String COMPUTED_ECLIPSE_DATE;
064:            public static final String ECLIPSE_DATE;
065:
066:            static {
067:                SimpleDateFormat dateFormat = new SimpleDateFormat(
068:                        "HH:mm:ss z, dd MMMM, yyyy");
069:                SimpleDateFormat eclipseDateFormat = new SimpleDateFormat(
070:                        "yyyyMMdd");
071:
072:                COMPUTED_DATE = dateFormat.format(new Date());
073:                COMPUTED_ECLIPSE_DATE = eclipseDateFormat.format(new Date());
074:            }
075:
076:            /**
077:             * Preview release number.
078:             * "0" indicates that the version is not a preview release.
079:             */
080:            public static final int PREVIEW = 0;
081:
082:            private static final String RELEASE_SUFFIX_WORD = (RELEASE_CANDIDATE > 0 ? "rc"
083:                    + RELEASE_CANDIDATE
084:                    : (PREVIEW > 0 ? "preview" + PREVIEW : "dev-"
085:                            + COMPUTED_ECLIPSE_DATE));
086:
087:            public static final String RELEASE_BASE = MAJOR + "." + MINOR + "."
088:                    + PATCHLEVEL;
089:            /**
090:             * Release version string.
091:             */
092:            public static final String COMPUTED_RELEASE = RELEASE_BASE
093:                    + (IS_DEVELOPMENT ? "-" + RELEASE_SUFFIX_WORD : "");
094:
095:            /**
096:             * Release version string.
097:             */
098:            public static final String RELEASE;
099:
100:            /**
101:             * Version of Eclipse plugin.
102:             */
103:            public static final String COMPUTED_ECLIPSE_UI_VERSION = MAJOR
104:                    + "." + MINOR + "." + PATCHLEVEL + "."
105:                    + COMPUTED_ECLIPSE_DATE;
106:            public static final String ECLIPSE_UI_VERSION;
107:
108:            static {
109:                InputStream in = null;
110:                String release, eclipse_ui_version, date, eclipseDate;
111:                try {
112:                    Properties versionProperties = new Properties();
113:                    in = Version.class
114:                            .getResourceAsStream("/version.properties");
115:                    versionProperties.load(in);
116:                    release = (String) versionProperties.get("release.number");
117:                    eclipse_ui_version = (String) versionProperties
118:                            .get("eclipse.ui.version");
119:                    date = (String) versionProperties.get("release.date");
120:                    eclipseDate = (String) versionProperties
121:                            .get("eclipse.date");
122:                } catch (RuntimeException e) {
123:                    release = COMPUTED_RELEASE;
124:                    eclipse_ui_version = COMPUTED_ECLIPSE_UI_VERSION;
125:                    date = COMPUTED_DATE;
126:                    eclipseDate = COMPUTED_ECLIPSE_DATE;
127:                } catch (IOException e) {
128:                    release = COMPUTED_RELEASE;
129:                    eclipse_ui_version = COMPUTED_ECLIPSE_UI_VERSION;
130:                    date = COMPUTED_DATE;
131:                    eclipseDate = COMPUTED_ECLIPSE_DATE;
132:                } finally {
133:                    try {
134:                        if (in != null)
135:                            in.close();
136:                    } catch (IOException e) {
137:                        assert true; // nothing to do here
138:                    }
139:                }
140:                RELEASE = release;
141:                ECLIPSE_UI_VERSION = eclipse_ui_version;
142:                DATE = date;
143:                ECLIPSE_DATE = eclipseDate;
144:            }
145:
146:            /**
147:             * FindBugs website.
148:             */
149:            public static final String WEBSITE = "http://findbugs.sourceforge.net";
150:
151:            /**
152:             * Downloads website.
153:             */
154:            public static final String DOWNLOADS_WEBSITE = "http://prdownloads.sourceforge.net/findbugs";
155:
156:            /**
157:             * Support email.
158:             */
159:            public static final String SUPPORT_EMAIL = "http://findbugs.sourceforge.net/reportingBugs.html";
160:
161:            public static void main(String[] argv) {
162:                if (argv.length != 1)
163:                    usage();
164:
165:                String arg = argv[0];
166:                if (!IS_DEVELOPMENT && RELEASE_CANDIDATE != 0) {
167:                    throw new IllegalStateException(
168:                            "Non developmental version, but is release candidate "
169:                                    + RELEASE_CANDIDATE);
170:                }
171:                if (arg.equals("-release"))
172:                    System.out.println(RELEASE);
173:                else if (arg.equals("-date"))
174:                    System.out.println(DATE);
175:                else if (arg.equals("-props")) {
176:                    System.out.println("release.number=" + COMPUTED_RELEASE);
177:                    System.out.println("release.date=" + COMPUTED_DATE);
178:                    System.out.println("eclipse.date=" + COMPUTED_ECLIPSE_DATE);
179:                    System.out.println("eclipse.ui.version="
180:                            + COMPUTED_ECLIPSE_UI_VERSION);
181:                    System.out.println("findbugs.website=" + WEBSITE);
182:                    System.out.println("findbugs.downloads.website="
183:                            + DOWNLOADS_WEBSITE);
184:                } else {
185:                    usage();
186:                    System.exit(1);
187:                }
188:            }
189:
190:            private static void usage() {
191:                System.err.println("Usage: " + Version.class.getName()
192:                        + "  (-release|-date|-props)");
193:            }
194:        }
195:
196:        // vim:ts=4
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.