Fix the OOME in ScannerParseLargeFileBenchmarkTest

Scanner had no mechanism for recovering buffer space it didn't
need.

Now, if the buffer is more than 50% full of ignorable characters
the remaining characters are shuffled to the beginning to recover
space. For most expected usecases this means that the buffer will
stay 1k and contain up to 512 characters of useful data. A
growable, circular character buffer could have been introduced
to avoid the copy but is not worth the effort.

Previously the buffer would double in size until the data or memory
was exhausted, and each read would also double in size to fill the
empty half of the buffer. This was fine providing the input
could fit in memory.

On top of that the 1k, 2k, 4k, etc. buffer was repeatedly turned
into a String and passed to the (native) matcher, and then the
matcher was told to ignore more than half of it.

As a consequence of keeping the buffer a fixed size (and only
filling 50% of it at a time), this change may cause a performance
regression: for most usecases where delimiters are closer together
than 512 bytes, reads after the first will now usually be 512 bytes
and not the 1k, 2k, 4k, etc. it was previously.

Having fixed the test so it doesn't OOM, the test now
takes 6 minutes to pass on host and so is unsuitable for inclusion
in CTS tests and so is being suppressed.

This change also includes so tidy up changes to the test and the
Scanner class.

The implementation could no doubt be improved but the API makes
it inherently slow. It would be surprising if anybody uses the
Scanner class on Android with so many better alternatives.

Bug: 14865710
Change-Id: I40a7fc0c2bfaf6db4e42108efe417303e76bde24
Merge "Fix the OOME in ScannerParseLargeFileBenchmarkTest"
Make some DateFormatSymbols fields private

locale and zoneStrings are not accessed outside of
DateFormatSymbols.

Bug: 16502916
Change-Id: I67907cf6b0ebc2e6a2dd0bfe8728ba6d0487d5a3
Merge "Make some DateFormatSymbols fields private"
Fix SimpleDateFormatTest when run outside California

If the device was set to a timezone besides America/Los_Angeles
the test would fail. Under cts-tradefed the SimpleDateFormat
was being created at class load time (using the device default)
and then the timezone default was being set to
America/Los_Angeles during setUp().

Contains refactoring to remove nested test case and
reformatting.

Change-Id: I26a7a2c6ce0d6205cf6d20c9b4cbebf550da19ce
Merge "Fix SimpleDateFormatTest when run outside California"
Add ICU.addLikelySubtags(Locale).

We don't need a replacement for ICU.getScript(String),
Locale.getScript() can be used instead. The old definition
of the function has been left public for the support library
to use (though we could remove it if we modify the support lib).

Note that addLikelySubtag returns a String that's language tag
like, but uses underscores instead of hyphens to separate
subtags.

bug: 15876704
Change-Id: I6c7d289c4b725a83900e38dd5bbed026afd9ac4e
Merge "Add ICU.addLikelySubtags(Locale)."
Fix LocaleInternalsTest.

- After the new Java forLanguageTag implementation, bogus
  locales really do result in "und".
- Fix a regression in unicode extension parsing, where we
  would always add a "null" to the keyword set.
- Improve test assertions so that the reason for failure
  is obvious.

bug: 15849709
Change-Id: I26fb348b872badb7844587cf290429e15dbb0f0e
Merge "Fix LocaleInternalsTest."
Don't account buffer.arrayOffset() twice.

data[OUTPUT_OFFSET] from the perspective of native
code must always be the offset from the start of the
buffer passed in to it.

Change-Id: I4a5c9595aebd105c57ce2239dc95cf85d5bd6256
Merge "Don't account buffer.arrayOffset() twice."
Remove knownfailures for "host"

These all appear to work on host now given the correct classpath.

Bug: 3041920
Bug: 2931959
Bug: 3032875
Change-Id: Id1687652803df925d529ee4f3250b54d023c3f8f
Merge "Remove knownfailures for "host""
Workaround doclava leaking ArtMethod

Bug: 16828157

(cherry picked from commit fe51ef7c7974e33b2ee20457aa16d6aef6cf3485)

Change-Id: I271571a7501b9bce03ad1c09e09b5bfe4ffc422b
Merge "Workaround doclava leaking ArtMethod"
Use absolute path when opening dex files.

The device always sees absolute paths so this will be no-op but on host
this enables testing with relative paths (which is much more
convenient).

Bug: 16644204
Change-Id: Ife8d231a8127ff97f8fd97c745c64b435cdddf02
Merge "Use absolute path when opening dex files."
Implement equals and hashCode in ParameterizedTypeImpl

and GenericArrayTypeImpl.

Bug: 14590652
Bug: https://code.google.com/p/android/issues/detail?id=74060
Change-Id: Ib9a30b741a8d5f82d21f37ca8959bf5b2893f8db
Merge "Implement equals and hashCode in ParameterizedTypeImpl"