summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2019-05-15 19:39:30 +0100
committerTobias Thierer <tobiast@google.com>2019-05-21 11:42:35 +0100
commit972eeb1b64cc5e75398237ccce330482786ac6af (patch)
treeb8e84b1f83f36b94fe5fa5d3eb8de1e864daa77e /annotations/generate_annotated_java_files.py
parentbc052d6af19c2108ac703854f77af490a4ecc077 (diff)
android.mime.types: Allow one-way mime -> ext only override.
Lines in android.mime.types define mappings between MIME types and extensions; before this CL, MIME -> extension would override earlier mappings if and only if the first extension was marked with the suffix '!', as in: mime ext1! ext2 ext3 extension -> MIME mappings would always override earlier lines (in the above example, each of {ext1, ext2, ext3} would be mapped to mime); there was no opt-out. After this CL, it's possible to choose between override (put() semantics) vs. keeping existing mappings (putIfAbsent() semantics) in both directions. This is now expressed by putting a '?' in front of the value _from_ which one maps. For example, the line: mime ?ext1 ?ext2 ext3 will put a mapping ext3 -> mime that overrides any earlier mapping, but it will putIfAbsent the mappings: ext1 -> mime ext2 -> mime (leaving any mapping untouched that was added earlier). This CL rewrites android.mime.types to express the same semantics as before in the new syntax. Therefore, this CL is a pure refactoring and doesn't change the mapping. Follow-up CLs will make use of the new ability to express one-way mime -> ext overrides (e.g. for b/131913690). Note that each MIME type occurs at most once in the file mime.types, so the change in semantics (putIfAbsent vs. put) of mime ext1 ext2 ext3 does not affect the semantics of that file. Test: Checked that behavior didn't change by running the test logic attached to http://b/122831291#comment14 Change-Id: Ie813ca46b4690f7e0e01bb399416f56654ef08ef
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions