Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed NumberFormatException crash of the Parser #132

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .classpath

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target/
.settings
.classpath
.project
17 changes: 0 additions & 17 deletions .project

This file was deleted.

3 changes: 0 additions & 3 deletions .settings/org.eclipse.core.resources.prefs

This file was deleted.

2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Please visit:
http://code.google.com/p/json-simple/
https://github.com/fangyidong/json-simple
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.1
1.1.2
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<project name="json-simple" default="main" basedir=".">
<property name="current-version" value="1.1.1"/>
<property name="current-version" value="1.1.2"/>
<property name="targetDir" value="target"/>
<property name="javaSourceDir" value="src/main/java"/>
<property name="javaTargetDir" value="target/classes"/>
Expand Down
36 changes: 30 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<project>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<packaging>bundle</packaging>
<name>JSON.simple</name>
<version>1.1.1</version>
<version>1.1.2</version>
<description>A simple Java toolkit for JSON</description>
<url>http://code.google.com/p/json-simple/</url>
<licenses>
Expand Down Expand Up @@ -38,7 +39,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -48,13 +49,13 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.6</version>
<version>2.5.4</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>2.5.1</version>
<configuration>
<source>1.2</source>
<target>1.2</target>
Expand All @@ -63,7 +64,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -74,6 +75,19 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -105,6 +119,16 @@
</plugins>
</build>
</profile>
<!-- To allow jdoc creation under jdk8-->
<profile>
<id>disable-java8-doclint</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<additionalparam>-Xdoclint:none</additionalparam>
</properties>
</profile>
</profiles>

</project>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/json/simple/ItemList.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public List getItems(){
}

public String[] getArray(){
return (String[])this.items.toArray();
return (String[])this.items.toArray(new String[this.items.size()]);
}

public void split(String s,String sp,List append,boolean isMultiToken){
Expand Down Expand Up @@ -107,7 +107,7 @@ public void addAll(String s,String sp,boolean isMultiToken){

/**
* @param i 0-based
* @return
* @return String
*/
public String get(int i){
return (String)items.get(i);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/json/simple/JSONObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static String toString(String key,Object value){
* @see org.json.simple.JSONValue#escape(String)
*
* @param s
* @return
* @return String which is escaped
*/
public static String escape(String s){
return JSONValue.escape(s);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/json/simple/JSONValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public static String toJSONString(Object value){
/**
* Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
* @param s
* @return
* @return String which is escaped
*/
public static String escape(String s){
if(s==null)
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/org/json/simple/parser/Yylex.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.