/libcore/json/src/test/java/libcore/org/json/ |
D | JSONObjectTest.java | 46 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 …]
|
D | JSONStringerTest.java | 46 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 …]
|
D | ParsingTest.java | 169 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 …]
|
D | SelfUseTest.java | 47 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 …]
|
D | JSONArrayTest.java | 338 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/json/src/main/java/org/json/ |
D | JSONArray.java | 94 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 …]
|
D | JSONObject.java | 168 Object object = readFrom.nextValue(); in JSONObject() local 169 if (object instanceof JSONObject) { in JSONObject() 170 this.nameValuePairs = ((JSONObject) object).nameValuePairs; in JSONObject() 172 throw JSON.typeMismatch(object, "JSONObject"); in JSONObject() 419 Object object = get(name); in getBoolean() local 420 Boolean result = JSON.toBoolean(object); in getBoolean() 422 throw JSON.typeMismatch(name, object, "boolean"); in getBoolean() 440 Object object = opt(name); in optBoolean() local 441 Boolean result = JSON.toBoolean(object); in optBoolean() 453 Object object = get(name); in getDouble() local [all …]
|
/libcore/ojluni/src/main/java/java/time/ |
D | Ser.java | 116 private Serializable object; field in Ser 130 Ser(byte type, Serializable object) { in Ser() argument 132 this.object = object; in Ser() 164 writeInternal(type, object, out); in writeExternal() 167 static void writeInternal(byte type, Object object, ObjectOutput out) throws IOException { in writeInternal() argument 171 ((Duration) object).writeExternal(out); in writeInternal() 174 ((Instant) object).writeExternal(out); in writeInternal() 177 ((LocalDate) object).writeExternal(out); in writeInternal() 180 ((LocalDateTime) object).writeExternal(out); in writeInternal() 183 ((LocalTime) object).writeExternal(out); in writeInternal() [all …]
|
/libcore/ojluni/src/main/java/java/time/chrono/ |
D | Ser.java | 114 private Serializable object; field in Ser 128 Ser(byte type, Serializable object) { in Ser() argument 130 this.object = object; in Ser() 159 writeInternal(type, object, out); in writeExternal() 162 … private static void writeInternal(byte type, Object object, ObjectOutput out) throws IOException { in writeInternal() argument 166 ((AbstractChronology) object).writeExternal(out); in writeInternal() 169 ((ChronoLocalDateTimeImpl<?>) object).writeExternal(out); in writeInternal() 172 ((ChronoZonedDateTimeImpl<?>) object).writeExternal(out); in writeInternal() 175 ((JapaneseDate) object).writeExternal(out); in writeInternal() 178 ((JapaneseEra) object).writeExternal(out); in writeInternal() [all …]
|
/libcore/ojluni/src/main/java/java/security/ |
D | GuardedObject.java | 54 private Object object; // the object we are guarding field in GuardedObject 67 public GuardedObject(Object object, Guard guard) in GuardedObject() argument 70 this.object = object; in GuardedObject() 86 guard.checkGuard(object); in getObject() 88 return object; in getObject() 99 guard.checkGuard(object); in writeObject()
|
/libcore/ojluni/src/main/java/java/time/zone/ |
D | Ser.java | 101 private Serializable object; field in Ser 115 Ser(byte type, Serializable object) { in Ser() argument 117 this.object = object; in Ser() 138 writeInternal(type, object, out); in writeExternal() 141 static void write(Object object, DataOutput out) throws IOException { in write() argument 142 writeInternal(ZRULES, object, out); in write() 145 private static void writeInternal(byte type, Object object, DataOutput out) throws IOException { in writeInternal() argument 149 ((ZoneRules) object).writeExternal(out); in writeInternal() 152 ((ZoneOffsetTransition) object).writeExternal(out); in writeInternal() 155 ((ZoneOffsetTransitionRule) object).writeExternal(out); in writeInternal() [all …]
|
/libcore/ojluni/src/test/java/time/tck/java/time/ |
D | AbstractTCKTest.java | 111 …protected static void assertSerializable(Object object) throws IOException, ClassNotFoundException… in assertSerializable() argument 112 assertEquals(object instanceof Serializable, true); in assertSerializable() 113 Object deserializedObject = writeThenRead(object); in assertSerializable() 114 assertEquals(deserializedObject, object); in assertSerializable() 117 …protected static void assertSerializableSame(Object object) throws IOException, ClassNotFoundExcep… in assertSerializableSame() argument 118 assertEquals(object instanceof Serializable, true); in assertSerializableSame() 119 Object deserializedObject = writeThenRead(object); in assertSerializableSame() 120 assertSame(deserializedObject, object); in assertSerializableSame() 123 private static Object writeThenRead(Object object) throws IOException, ClassNotFoundException { in writeThenRead() argument 126 oos.writeObject(object); in writeThenRead() [all …]
|
/libcore/luni/src/main/native/ |
D | ScopedBytes.h | 32 ScopedBytes(JNIEnv* env, jobject object) in ScopedBytes() argument 33 : mEnv(env), mObject(object), mByteArray(nullptr), mPtr(nullptr) in ScopedBytes() 72 ScopedBytesRO(JNIEnv* env, jobject object) : ScopedBytes<true>(env, object) {} in ScopedBytesRO() argument 80 ScopedBytesRW(JNIEnv* env, jobject object) : ScopedBytes<false>(env, object) {} in ScopedBytesRW() argument
|
D | org_apache_harmony_xml_ExpatParser.cpp | 109 explicit ParsingContext(jobject object) in ParsingContext() 110 : env(NULL), object(object), buffer(NULL), bufferSize(-1) { in ParsingContext() 175 jobject object; member 483 jobject javaParser = parsingContext->object; in bufferAndInvoke() 640 jobject javaParser = parsingContext->object; in startElement() 673 jobject javaParser = parsingContext->object; in endElement() 734 jobject javaParser = parsingContext->object; in startNamespace() 754 jobject javaParser = parsingContext->object; in endNamespace() 770 jobject javaParser = parsingContext->object; in startCdata() 786 jobject javaParser = parsingContext->object; in endCdata() [all …]
|
/libcore/support/src/test/java/org/apache/harmony/testframework/serialization/ |
D | SerializationTest.java | 269 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/ |
D | OldObjectInputStreamGetFieldTest.java | 71 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()
|
D | ObjectOutputStreamTest.java | 81 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/ |
D | SerializationTester.java | 84 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/ |
D | CollationKeyICU.java | 43 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/luni/src/test/java/libcore/java/lang/ |
D | ThreadTestHelper.smali | 59 move-result-object v0 63 move-result-object v0 65 return-object v0 75 move-result-object v0 77 return-object v0 93 move-result-object v0 95 return-object v0
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | SerializationBenchmark.java | 46 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/ |
D | ReferenceBenchmark.java | 30 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/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ |
D | ParseExceptionTest.java | 57 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()
|
D | Support_Format.java | 37 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/ |
D | Support_Format.java | 36 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()
|