Change DecimalFormat.setRoundingMode() behavior to stay in spec

The serialization tests revealed that some DecimalFormat instances
could not be round-tripped. The reason is that the setRoundingMode()
method was setting a non-zero rounding increment, which cannot
be persisted, and also creates patterns that are outside of the
DecimalFormat spec.

Addressed the fact that ICU4C appears to support
RoundingMode.UNNECESSARY now by deleting special-case code.

Changed SerializationStressTest to use canonical DecimalFormat
patterns:

The ones chosen had a couple things that were not ideal:
1) Putting '-' in quotes causes ICU (for non-obvious reasons)
treat the negative pattern prefix as not being default. Default
in this case means "the positive prefix with a preceding '-'.
Removing the quotes meant it would recognize the pattern as
not needing everything after ;., so the pattern would be shrunk.
2) The positive pattern was also not one ICU could deal with
fully. ICU changed "#.#" to "#0.#" at parse time (which can be
corrected with a setMinimumIntegerDigits(0)). It's not clear why
ICU cannot deal with parsing "#.#" when it can produce it, but
there is a long comment in decimfmt.cc suggesting it is
intentional and to avoid format producing empty strings.

The pattern has been changed to one that ICU can handle and would
choose when the various serialized fields are read back. This is
necessary because NativeDecimalFormat compares the patterns and
not just the serialized fields. Leaving the pattern check part of
equals() means that two non-spec patterns will not be considered
equal(), which is important while Android allows non-spec patterns.
Restricting support in DecimalFormat to the documented subset of
characters is not worth the effort and may cause problems
elsewhere.

Change-Id: I2de588458b86619733c0dc1692d526f179059910
Bug: 11668227

Conflicts:
	expectations/knownfailures.txt
	harmony-tests/src/test/java/org/apache/harmony/tests/java/io/SerializationStressTest.java
	luni/src/main/java/java/text/DecimalFormat.java
Change result order of getDeclaredFields

ART reports declared fields in another order than Dalvik.
The method is java.lang.class.getDeclaredFields(). Its javadoc allows
any order but Dalvik reports static fields first followed by instance ones.

This patch makes ART to be compatible with Dalvik's order.

Change-Id: Id43acb8aca7ec264b2808f5ec773c930be93b030
Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>
Disallow explicit signs in java.sql.Date#valueOf()

Bug: 5239391
Change-Id: I52bd621bd6ed46d1ae01abf1be25d1ac3c76d7e0
Fix UUID#parseString in the presence of explicit + signs.

Bug: 5239391

Change-Id: Iaa0bbd3a7f8a13c3e48abb1a7e7508e48615b11c
Disallow explicit signs in SocketHandler port parsing.

Bug: 5239391
Change-Id: Ifa6bc6b352c283e8f6913b4905a9541df7355915
Disallow explicit signs in java.sql.Timestamp#valueOf()

I also simplified the implementation.

Bug: 5239391
Change-Id: I51ea2ba848b0c2d2d2f26807a1c56e7e015ef9f4
Add parsePositiveInt for internal use.

It will help fix issues caused by allowing explicit '+' sign in
numerical strings.

Bug: 5239391
Change-Id: I95b4db1a06a35d5ef72b28c4764a0190f10c55c8

Conflicts:
	luni/src/test/java/libcore/java/lang/IntegerTest.java
Improve the performance of Annotation checks

In the circumstance where the annotated element (field/
method/constructor/class) was loaded from a different Dex file
than the annotation:

The previous code would perform a binary
search to determine the type ID of the annotation in the Dex
file of the annotated element. That type ID would then be
compared against the type IDs of annotations present on the
annotated element. The binary search was quite expensive: it
involved various indirections, many small native method calls
and temporary String creation.

Instead, the code now compares the names of the
annotations on the annotated element with the name of the
annotation being searched for. The name of the annotation
is known and cached on the class and is therefore cheap to
get. The name was previously being used to binary search for
the type ID so this appears to be no less correct.

Also removed some unused methods in order to delete the
getFieldIndex() method.

Change-Id: Ib8fb021ddf1221e3eac983aa87e7aea8174720ef
1.7 interoperability changes for FileLock

Adding acquiredBy(). This method is effectively a synonym for
channel().

Change-Id: Ifa0b89debb42a7181f1f5f188ae7175970286adb
Remove '.' from the System classpath for Android apps

When the Zygote is used, the java.class.path system property is
missing and so the System ClassLoader was being given the
default classpath of '.'. The meaning of '.' recently changed
from the app dir to '/'. Since any apps depending on this will
have broken with the '.' change, the System ClassLoader can be
changed to have an empty classpath, which is a more reasonable
choice.

Added documentation of this change inline. Fixed up some
long-standing commented code and removed a misleading JavaDoc
comment.

Change-Id: I64ac5a1edee118a6285df894d21f2ae3dc333408
Bug: 12491655