Home
last modified time | relevance | path

Searched refs:object (Results 1 – 25 of 64) sorted by relevance

123

/libcore/json/src/test/java/libcore/org/json/
DJSONObjectTest.java46 JSONObject object = new JSONObject(); in testEmptyObject() local
47 assertEquals(0, object.length()); in testEmptyObject()
50 assertNull(object.names()); in testEmptyObject()
53 assertNull(object.toJSONArray(new JSONArray())); in testEmptyObject()
54 assertEquals("{}", object.toString()); in testEmptyObject()
55 assertEquals("{}", object.toString(5)); in testEmptyObject()
57 object.get("foo"); in testEmptyObject()
62 object.getBoolean("foo"); in testEmptyObject()
67 object.getDouble("foo"); in testEmptyObject()
72 object.getInt("foo"); in testEmptyObject()
[all …]
DJSONStringerTest.java46 stringer.object(); in testEmptyObject()
82 stringer.object(); in testKeyValue()
161 new JSONStringer().object().endArray(); in testMismatchedScopes()
166 new JSONStringer().object().key("a").key("a"); in testMismatchedScopes()
171 new JSONStringer().object().value(false); in testMismatchedScopes()
179 new JSONStringer().object().key(null); in testNullKey()
187 stringer.object(); in testRepeatedKey()
197 stringer.object(); in testEmptyKey()
227 new JSONStringer().object().key(original).value(false).endObject().toString()); in assertEscapedAllWays()
229 new JSONStringer().object().key("a").value(original).endObject().toString()); in assertEscapedAllWays()
[all …]
DParsingTest.java169 assertParsed(object("foo", 5), "{\"foo\": 5}"); in testParsingObjects()
170 assertParsed(object("foo", 5), "{foo: 5}"); in testParsingObjects()
171 assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\": 5, \"bar\": \"baz\"}"); in testParsingObjects()
172 assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\": 5; \"bar\": \"baz\"}"); in testParsingObjects()
173 assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\"= 5; \"bar\"= \"baz\"}"); in testParsingObjects()
174 assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\"=> 5; \"bar\"=> \"baz\"}"); in testParsingObjects()
175 assertParsed(object("foo", object(), "bar", array()), "{\"foo\"=> {}; \"bar\"=> []}"); in testParsingObjects()
176 assertParsed(object("foo", object("foo", array(5, 6))), "{\"foo\": {\"foo\": [5, 6]}}"); in testParsingObjects()
177 … assertParsed(object("foo", object("foo", array(5, 6))), "{\"foo\":\n\t{\t \"foo\":[5,\r6]}}"); in testParsingObjects()
229 private JSONObject object(Object... keyValuePairs) throws JSONException { in object() method in ParsingTest
[all …]
DSelfUseTest.java47 private final JSONObject object = new JSONObject() { field in SelfUseTest
130 object.putOpt("foo", "bar"); in testObjectPut()
135 object.accumulate("foo", "bar"); in testObjectAccumulate()
140 object.put("foo", "true"); in testObjectGetBoolean()
141 object.getBoolean("foo"); in testObjectGetBoolean()
146 object.optBoolean("foo"); in testObjectOptType()
149 object.optDouble("foo"); in testObjectOptType()
152 object.optInt("foo"); in testObjectOptType()
155 object.optLong("foo"); in testObjectOptType()
158 object.optString("foo"); in testObjectOptType()
[all …]
DJSONArrayTest.java338 JSONObject object = values.toJSONObject(keys); in testToJSONObject() local
339 assertEquals(5.5d, object.get("a")); in testToJSONObject()
340 assertEquals(false, object.get("b")); in testToJSONObject()
344 assertEquals(5.5d, object.get("a")); in testToJSONObject()
357 JSONObject object = values.toJSONObject(keys); in testToJSONObjectWithNulls() local
358 assertEquals(1, object.length()); in testToJSONObjectWithNulls()
359 assertFalse(object.has("b")); in testToJSONObjectWithNulls()
360 assertEquals("{\"a\":5.5}", object.toString()); in testToJSONObjectWithNulls()
369 JSONObject object = values.toJSONObject(keys); in testToJSONObjectMoreNamesThanValues() local
370 assertEquals(1, object.length()); in testToJSONObjectMoreNamesThanValues()
[all …]
/libcore/ojluni/src/main/java/java/time/
DSer.java114 private Object object; field in Ser
128 Ser(byte type, Object object) { in Ser() argument
130 this.object = object; in Ser()
162 writeInternal(type, object, out); in writeExternal()
165 static void writeInternal(byte type, Object object, ObjectOutput out) throws IOException { in writeInternal() argument
169 ((Duration) object).writeExternal(out); in writeInternal()
172 ((Instant) object).writeExternal(out); in writeInternal()
175 ((LocalDate) object).writeExternal(out); in writeInternal()
178 ((LocalDateTime) object).writeExternal(out); in writeInternal()
181 ((LocalTime) object).writeExternal(out); in writeInternal()
[all …]
/libcore/json/src/main/java/org/json/
DJSONArray.java94 Object object = readFrom.nextValue(); in JSONArray() local
95 if (object instanceof JSONArray) { in JSONArray()
96 values = ((JSONArray) object).values; in JSONArray()
98 throw JSON.typeMismatch(object, "JSONArray"); in JSONArray()
329 Object object = get(index); in getBoolean() local
330 Boolean result = JSON.toBoolean(object); in getBoolean()
332 throw JSON.typeMismatch(index, object, "boolean"); in getBoolean()
350 Object object = opt(index); in optBoolean() local
351 Boolean result = JSON.toBoolean(object); in optBoolean()
363 Object object = get(index); in getDouble() local
[all …]
DJSONObject.java164 Object object = readFrom.nextValue(); in JSONObject() local
165 if (object instanceof JSONObject) { in JSONObject()
166 this.nameValuePairs = ((JSONObject) object).nameValuePairs; in JSONObject()
168 throw JSON.typeMismatch(object, "JSONObject"); in JSONObject()
420 Object object = get(name); in getBoolean() local
421 Boolean result = JSON.toBoolean(object); in getBoolean()
423 throw JSON.typeMismatch(name, object, "boolean"); in getBoolean()
441 Object object = opt(name); in optBoolean() local
442 Boolean result = JSON.toBoolean(object); in optBoolean()
454 Object object = get(name); in getDouble() local
[all …]
/libcore/ojluni/src/main/java/java/time/chrono/
DSer.java112 private Object object; field in Ser
126 Ser(byte type, Object object) { in Ser() argument
128 this.object = object; in Ser()
157 writeInternal(type, object, out); in writeExternal()
160 … private static void writeInternal(byte type, Object object, ObjectOutput out) throws IOException { in writeInternal() argument
164 ((AbstractChronology) object).writeExternal(out); in writeInternal()
167 ((ChronoLocalDateTimeImpl<?>) object).writeExternal(out); in writeInternal()
170 ((ChronoZonedDateTimeImpl<?>) object).writeExternal(out); in writeInternal()
173 ((JapaneseDate) object).writeExternal(out); in writeInternal()
176 ((JapaneseEra) object).writeExternal(out); in writeInternal()
[all …]
/libcore/ojluni/src/main/java/java/security/
DGuardedObject.java53 private Object object; // the object we are guarding field in GuardedObject
66 public GuardedObject(Object object, Guard guard) in GuardedObject() argument
69 this.object = object; in GuardedObject()
85 guard.checkGuard(object); in getObject()
87 return object; in getObject()
98 guard.checkGuard(object); in writeObject()
/libcore/ojluni/src/main/java/java/time/zone/
DSer.java100 private Object object; field in Ser
114 Ser(byte type, Object object) { in Ser() argument
116 this.object = object; in Ser()
137 writeInternal(type, object, out); in writeExternal()
140 static void write(Object object, DataOutput out) throws IOException { in write() argument
141 writeInternal(ZRULES, object, out); in write()
144 private static void writeInternal(byte type, Object object, DataOutput out) throws IOException { in writeInternal() argument
148 ((ZoneRules) object).writeExternal(out); in writeInternal()
151 ((ZoneOffsetTransition) object).writeExternal(out); in writeInternal()
154 ((ZoneOffsetTransitionRule) object).writeExternal(out); in writeInternal()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/
DAbstractTCKTest.java90 …protected static void assertSerializable(Object object) throws IOException, ClassNotFoundException… in assertSerializable() argument
91 assertEquals(object instanceof Serializable, true); in assertSerializable()
92 Object deserializedObject = writeThenRead(object); in assertSerializable()
93 assertEquals(deserializedObject, object); in assertSerializable()
96 …protected static void assertSerializableSame(Object object) throws IOException, ClassNotFoundExcep… in assertSerializableSame() argument
97 assertEquals(object instanceof Serializable, true); in assertSerializableSame()
98 Object deserializedObject = writeThenRead(object); in assertSerializableSame()
99 assertSame(deserializedObject, object); in assertSerializableSame()
102 private static Object writeThenRead(Object object) throws IOException, ClassNotFoundException { in writeThenRead() argument
105 oos.writeObject(object); in writeThenRead()
[all …]
/libcore/support/src/test/java/org/apache/harmony/testframework/serialization/
DSerializationTest.java269 public static SerializableAssert defineComparator(Object test, Object object) in defineComparator() argument
276 Method m = object.getClass().getMethod("equals", new Class[] { Object.class }); in defineComparator()
285 if (object instanceof Throwable) { in defineComparator()
288 if (object instanceof PermissionCollection) { in defineComparator()
303 public static void verifyGolden(Object test, Object object) throws Exception { in verifyGolden() argument
304 verifyGolden(test, object, defineComparator(test, object)); in verifyGolden()
319 public static void verifyGolden(Object test, Object object, SerializableAssert comparator) in verifyGolden() argument
323 comparator.assertDeserialized((Serializable) object, deserialized); in verifyGolden()
373 public static void verifySelf(Object object) throws Exception { in verifySelf() argument
374 verifySelf(object, defineComparator(null, object)); in verifySelf()
[all …]
/libcore/luni/src/test/java/libcore/java/io/
DOldObjectInputStreamGetFieldTest.java71 Support_GetPutFields object = (Support_GetPutFields) ois.readObject(); in test_get() local
77 object.equals(newObject)); in test_get()
99 Support_GetPutFields object = (Support_GetPutFields) ois.readObject(); in test_defaultedLjava_lang_String() local
100 ObjectInputStream.GetField fields = object.getField; in test_defaultedLjava_lang_String()
123 Support_GetPutFields object = (Support_GetPutFields) ois.readObject(); in test_getException() local
124 ObjectInputStream.GetField fields = object.getField; in test_getException()
239 Support_GetPutFields object = (Support_GetPutFields) ois.readObject(); in test_getObjectStreamClass() local
241 object.getField.getObjectStreamClass()); in test_getObjectStreamClass()
DObjectOutputStreamTest.java81 CallsCloseInWriteObjectMethod object = new CallsCloseInWriteObjectMethod(hello); in testCloseInWriteObject() local
89 List<Serializable> input = Arrays.asList(object, hello, hello); in testCloseInWriteObject()
97 private Serializable roundTrip(Object object) in roundTrip() argument
101 oos.writeObject(object); in roundTrip()
/libcore/luni/src/test/java/libcore/libcore/util/
DSerializationTester.java84 public static byte[] serialize(Object object) throws IOException { in serialize() argument
86 new ObjectOutputStream(out).writeObject(object); in serialize()
100 public static Object reserialize(Object object) throws IOException, ClassNotFoundException { in reserialize() argument
101 return deserialize(serialize(object)); in reserialize()
104 public static String serializeHex(Object object) throws IOException { in serializeHex() argument
105 return HexEncoding.encodeToString(serialize(object)); in serializeHex()
/libcore/luni/src/main/java/libcore/icu/
DCollationKeyICU.java43 public boolean equals(Object object) { in equals() argument
44 if (object == this) { in equals()
47 if (!(object instanceof CollationKey)) { in equals()
50 return compareTo((CollationKey) object) == 0; in equals()
/libcore/benchmarks/src/benchmarks/regression/
DSerializationBenchmark.java46 ArrayList<Integer> object = new ArrayList<Integer>(); in timeReadArrayListInteger() local
48 object.add(i); in timeReadArrayListInteger()
50 readSingleObject(reps, object); in timeReadArrayListInteger()
54 ArrayList<Integer> object = new ArrayList<Integer>(); in timeWriteArrayListInteger() local
56 object.add(i); in timeWriteArrayListInteger()
58 writeSingleObject(reps, object); in timeWriteArrayListInteger()
95 private void readSingleObject(int reps, Object object) throws Exception { in readSingleObject() argument
96 byte[] bytes = bytes(object); in readSingleObject()
/libcore/benchmarks/src/benchmarks/
DReferenceBenchmark.java30 private Object object; field in ReferenceBenchmark
36 new PhantomReference(object, queue); in timeAlloc()
44 (new PhantomReference<Object>(object, queue)).enqueue(); in timeAllocAndEnqueue()
52 (new PhantomReference<Object>(object, queue)).enqueue(); in timeAllocEnqueueAndPoll()
63 (new PhantomReference<Object>(object, queue)).enqueue(); in timeAllocEnqueueAndRemove()
/libcore/luni/src/main/native/
Dorg_apache_harmony_xml_ExpatParser.cpp107 explicit ParsingContext(jobject object) in ParsingContext()
108 : env(NULL), object(object), buffer(NULL), bufferSize(-1) { in ParsingContext()
173 jobject object; member
470 jobject javaParser = parsingContext->object; in bufferAndInvoke()
627 jobject javaParser = parsingContext->object; in startElement()
660 jobject javaParser = parsingContext->object; in endElement()
721 jobject javaParser = parsingContext->object; in startNamespace()
741 jobject javaParser = parsingContext->object; in endNamespace()
757 jobject javaParser = parsingContext->object; in startCdata()
773 jobject javaParser = parsingContext->object; in endCdata()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DParseExceptionTest.java57 Object object = ois.readObject(); in test_serialize() local
58 assertTrue("Not a ParseException", object instanceof ParseException); in test_serialize()
59 ParseException parseException = (ParseException) object; in test_serialize()
DSupport_Format.java37 protected void t_FormatWithField(int count, Format format, Object object, in t_FormatWithField() argument
41 format.format(object, buffer, pos); in t_FormatWithField()
58 …protected void t_Format(int count, Object object, Format format, Vector<FieldContainer> expectedRe… in t_Format() argument
59 Vector<FieldContainer> results = findFields(format.formatToCharacterIterator(object)); in t_Format()
61 format.format(object) + "\n" + in t_Format()
/libcore/support/src/test/java/tests/support/
DSupport_Format.java36 protected void t_FormatWithField(int count, Format format, Object object, in t_FormatWithField() argument
40 format.format(object, buffer, pos); in t_FormatWithField()
59 protected void t_Format(int count, Object object, Format format, in t_Format() argument
62 Vector<FieldContainer> results = findFields(format.formatToCharacterIterator(object)); in t_Format()
65 + format.format(object), compare(results, expectedResults)); in t_Format()
/libcore/ojluni/src/main/native/
Djni_util.h204 JNU_IsInstanceOfByName(JNIEnv *env, jobject object, char *classname);
265 JNU_MonitorWait(JNIEnv *env, jobject object, jlong timeout);
268 JNU_Notify(JNIEnv *env, jobject object);
271 JNU_NotifyAll(JNIEnv *env, jobject object);
309 JNU_PrintClass(JNIEnv *env, char *hdr, jobject object);
312 JNU_ToString(JNIEnv *env, jobject object);
Djni_util.c937 JNU_IsInstanceOfByName(JNIEnv *env, jobject object, char* classname) in JNU_IsInstanceOfByName() argument
944 jint result = (*env)->IsInstanceOf(env, object, cls); in JNU_IsInstanceOfByName()
972 JNU_MonitorWait(JNIEnv *env, jobject object, jlong timeout) in JNU_MonitorWait() argument
974 if (object == NULL) { in JNU_MonitorWait()
988 (*env)->CallVoidMethod(env, object, Object_waitMID, timeout); in JNU_MonitorWait()
992 JNU_Notify(JNIEnv *env, jobject object) in JNU_Notify() argument
994 if (object == NULL) { in JNU_Notify()
1008 (*env)->CallVoidMethod(env, object, Object_notifyMID); in JNU_Notify()
1012 JNU_NotifyAll(JNIEnv *env, jobject object) in JNU_NotifyAll() argument
1014 if (object == NULL) { in JNU_NotifyAll()
[all …]

123