Merge pull request #4336 from Akarshit/bugifx-accessModifier

Changed the access modifier of get()
This commit is contained in:
Ben Fry
2016-10-29 11:06:12 -04:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -263,7 +263,7 @@ public class JSONArray {
* @return An object value.
* @throws RuntimeException If there is no value for the index.
*/
private Object get(int index) {
public Object get(int index) {
Object object = opt(index);
if (object == null) {
throw new RuntimeException("JSONArray[" + index + "] not found.");

View File

@@ -537,7 +537,7 @@ public class JSONObject {
* @return The object associated with the key.
* @throws RuntimeException if the key is not found.
*/
private Object get(String key) {
public Object get(String key) {
if (key == null) {
throw new RuntimeException("Null key.");
}
@@ -1300,7 +1300,7 @@ public class JSONObject {
* @throws RuntimeException If the value is non-finite number
* or if the key is null.
*/
private JSONObject put(String key, Object value) {
public JSONObject put(String key, Object value) {
String pooled;
if (key == null) {
throw new RuntimeException("Null key.");
@@ -1334,7 +1334,7 @@ public class JSONObject {
* @throws RuntimeException if the key is a duplicate, or if
* {@link #put(String,Object)} throws.
*/
private JSONObject putOnce(String key, Object value) {
public JSONObject putOnce(String key, Object value) {
if (key != null && value != null) {
if (this.opt(key) != null) {
throw new RuntimeException("Duplicate key \"" + key + "\"");