diff options
| author | Tobias Thierer <tobiast@google.com> | 2019-09-30 20:39:29 +0100 | 
|---|---|---|
| committer | Tobias Thierer <tobiast@google.com> | 2019-10-02 17:58:32 +0000 | 
| commit | 9cfcd97fb60025d6c1fa1e3c9ccb62669b5a4318 (patch) | |
| tree | 569154528b9a82b16274730cc4fc25516f9136d3 /annotations/generate_annotated_java_files.py | |
| parent | d50a6a32817994048dbe6be222cc750f351fd8ca (diff) | |
Enforce that a MimeMap's MIME types contain a '/' but extensions don't.
This guards against some kinds of programming errors in building
MimeMaps directly via MimeMap.Builder or indirectly through the
contents of the *mime.types data files:
 - Specifying a MIME type where an extension is expected, or
   vice versa.
 - Specifying a path where only a file extension is expected.
No such enforcement is done during lookups - specifying an
inappropriate key will just result in no result being found.
Stronger requirements (e.g. a MIME type should contain _exactly_
one '/' and it should not occur at either end, and an extension
should not start with a '.') that could catch additional errors
are possible, but beyond the scope of this CL.
Bug: 122831291
Bug: 139895945
Test: atest CtsMimeMapTestCases
Test: atest CtsLibcoreTestCases:libcore.libcore.net.MimeMapTest
Change-Id: Ida961de1dbe2a8ae23097f95b3638e7e0e3500d6
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions
