Skip to content

Commit 3dc8174

Browse files
author
Simone Pierazzini
committed
No need for jdk 1.8 except for a couple of multi catch exception that I reverted.
Minimum requirement is jdk 1.5.
1 parent b0191a6 commit 3dc8174

18 files changed

Lines changed: 130 additions & 2 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target

pom.xml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>org.json</groupId>
6+
<artifactId>json</artifactId>
7+
<version>20141113-jdk15</version>
8+
<packaging>jar</packaging>
9+
10+
<name>JSON in Java</name>
11+
<description>
12+
JSON is a light-weight, language independent, data interchange format.
13+
See http://www.JSON.org/
14+
15+
The files in this package implement JSON encoders/decoders in Java.
16+
It also includes the capability to convert between JSON and XML, HTTP
17+
headers, Cookies, and CDL.
18+
19+
This is a reference implementation. There is a large number of JSON packages
20+
in Java. Perhaps someday the Java community will standardize on one. Until
21+
then, choose carefully.
22+
23+
The license includes this restriction: "The software shall be used for good,
24+
not evil." If your conscience cannot live with that, then choose a different
25+
package.
26+
27+
The package compiles on Java 1.2 thru Java 1.4.
28+
</description>
29+
<url>https://github.com/douglascrockford/JSON-java</url>
30+
31+
32+
<scm>
33+
<url>https://github.com/douglascrockford/JSON-java.git</url>
34+
<connection>scm:git:git://github.com/douglascrockford/JSON-java.git</connection>
35+
<developerConnection>scm:git:[email protected]:douglascrockford/JSON-java.git</developerConnection>
36+
</scm>
37+
38+
<licenses>
39+
<license>
40+
<name>The JSON License</name>
41+
<url>http://json.org/license.html</url>
42+
<distribution>repo</distribution>
43+
<comments>Copyright (c) 2002 JSON.org
44+
45+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
46+
associated documentation files (the "Software"), to deal in the Software without restriction, including
47+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
49+
following conditions:
50+
51+
The above copyright notice and this permission notice shall be included in all copies or substantial
52+
portions of the Software.
53+
54+
The Software shall be used for Good, not Evil.
55+
56+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
57+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
58+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
59+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
60+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
61+
</comments>
62+
</license>
63+
</licenses>
64+
65+
<developers>
66+
<developer>
67+
<name>Douglas Crockford</name>
68+
<email>[email protected]</email>
69+
</developer>
70+
</developers>
71+
72+
<properties>
73+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
74+
</properties>
75+
76+
77+
<dependencies>
78+
</dependencies>
79+
80+
<build>
81+
<plugins>
82+
<plugin>
83+
<groupId>org.apache.maven.plugins</groupId>
84+
<artifactId>maven-compiler-plugin</artifactId>
85+
<version>2.3.2</version>
86+
<configuration>
87+
<source>1.5</source>
88+
<target>1.5</target>
89+
</configuration>
90+
</plugin>
91+
<plugin>
92+
<groupId>org.apache.maven.plugins</groupId>
93+
<artifactId>maven-source-plugin</artifactId>
94+
<version>2.1.2</version>
95+
<executions>
96+
<execution>
97+
<id>attach-sources</id>
98+
<goals>
99+
<goal>jar-no-fork</goal>
100+
</goals>
101+
</execution>
102+
</executions>
103+
</plugin>
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-javadoc-plugin</artifactId>
107+
<version>2.7</version>
108+
<executions>
109+
<execution>
110+
<id>attach-javadocs</id>
111+
<goals>
112+
<goal>jar</goal>
113+
</goals>
114+
<configuration>
115+
<additionalparam>-Xdoclint:none</additionalparam>
116+
</configuration>
117+
</execution>
118+
</executions>
119+
</plugin>
120+
</plugins>
121+
</build>
122+
123+
</project>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,9 @@ public <E extends Enum<E>> E optEnum(Class<E> clazz, int index, E defaultValue)
594594
return myE;
595595
}
596596
return Enum.valueOf(clazz, val.toString());
597-
} catch (IllegalArgumentException | NullPointerException e) {
597+
} catch (IllegalArgumentException e) {
598+
return defaultValue;
599+
} catch (NullPointerException e) {
598600
return defaultValue;
599601
}
600602
}

0 commit comments

Comments
 (0)