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

multi-catch fixed for source release compatibility 1.6 #181

Closed
wants to merge 1 commit into from
Closed

multi-catch fixed for source release compatibility 1.6 #181

wants to merge 1 commit into from

Conversation

jinahya
Copy link

@jinahya jinahya commented Dec 9, 2015

Two lines in each file fixed for source code compatible 1.6.
I believe these changes don't affect any functionalities and API changes.
Note that sticking source release 1.6 doesn't mean target class version should be 1.6.

$ javac -source 1.6 -target 1.6 -d target *.java
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
$ javac -source 1.6 -target 1.7 -d target *.java
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
$ javac -source 1.6 -target 1.8 -d target *.java
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
$

Note, also, that even Java 9 might support 1.6.

@stleary
Copy link
Owner

stleary commented Dec 9, 2015

Additional discussion of this code change can be found at the bottom of #156

@stleary
Copy link
Owner

stleary commented Dec 10, 2015

Progress will be posted here.
Suggestions welcome!
Install Android Development Studio
Made these changes:
File > Project Structure > Project Settings > Project

Setting Value
JDK 1.7.0_80 (errors when I tried using 1.6.0_45)

Form factors: Phone and tablet

Setting Value
Minimum SDK 8: Android 2.2 (Froyo)

Confirmed that the only 1.6 incompatibilities in JSON-java are the multi-catches in JSONObject and JSONArray

To an Android HelloWorld project, I imported jar package original v1.7 JSON-java, and created a JSONObject. Ran it on a 4.0.3 Ice Cream Sandwich Android phone. No errors.

@johnjaylward
Copy link
Contributor

Some links for ease of not switching between issues:

  • Android Market Share: API 19 and above can use Java1.7 features. At this time it's about 66% of android devices. About 33% require Java1.6 or lower.
  • Oracle Java EOL: Java 1.7 and lower have been EOL by Oracle. Only java8+ runtimes will receive security and bug fixes.
  • json-retrotranslated: a project that forks this one to support older STBs and PCBs that run java 1.3. Since these are hardware devices, they can not have their runtimes updated (or it would require a custom flash mod if the runtime is in the flashable area)

@stleary
Copy link
Owner

stleary commented Dec 12, 2015

Agreed that the only code preventing 1. 6 compatibility are the multi-catches, which were a recent enhancement. However, I have been unable to make the case that the existing JSON-java code fails to compile in Android Studio, and deploy/execute on an Android device (see my comment, above). What exactly is your use case for making this change?

@jinahya
Copy link
Author

jinahya commented Dec 12, 2015

I officially withdraw this PR. You can ignore/decline this pull request. Thanks.

@jinahya jinahya closed this Dec 12, 2015
@stleary
Copy link
Owner

stleary commented Dec 12, 2015

@jinahya feel free to reopen if you come across any situation where reverting to 1.6 compatibility would provide a benefit to users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants