New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 751776 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: ----



Sign in to add a comment

Support Java try-with-resources with Desugar

Project Member Reported by zpeng@chromium.org, Aug 2 2017

Issue description

Currently Desugar cannot support try-with-resources without additional support classes. If we allow Desugar to liberally add those classes, the build fails at Proguard due to multiple same classes.

To support try-with-resources, we need to tell Desugar to not add the support classes and add the support classes to the final target ourselves. Unfortunately that would render all intermediate libraries unusable, and might break non-Chrome targets. As a result, we do not intend to add such support in the near future.
 

Comment 1 by zpeng@chromium.org, Aug 2 2017

Labels: -Restrict-View-Google

Comment 2 by zpeng@chromium.org, Aug 8 2017

Cc: agrieve@chromium.org
Also we need to update lint to not fail on try-with-resources with NewAPI error
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c20eeee528d703316ee8e88c790c4ab6ff04f0ae

commit c20eeee528d703316ee8e88c790c4ab6ff04f0ae
Author: Andrew Grieve <agrieve@chromium.org>
Date: Fri Aug 11 16:00:44 2017

Android: Add support for Java's try-with-resources via Desugar.

Bug:  751776 
Change-Id: Ibb33dc5dae89d3f0eb9b44145c0aabbae2e3c21f
Reviewed-on: https://chromium-review.googlesource.com/610980
Reviewed-by: Biao She <bshe@chromium.org>
Reviewed-by: Felix <zpeng@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493759}
[modify] https://crrev.com/c20eeee528d703316ee8e88c790c4ab6ff04f0ae/base/android/java/src/org/chromium/base/ContentUriUtils.java
[modify] https://crrev.com/c20eeee528d703316ee8e88c790c4ab6ff04f0ae/base/android/java/src/org/chromium/base/SecureRandomInitializer.java
[modify] https://crrev.com/c20eeee528d703316ee8e88c790c4ab6ff04f0ae/build/android/BUILD.gn
[modify] https://crrev.com/c20eeee528d703316ee8e88c790c4ab6ff04f0ae/build/android/gyp/desugar.py
[modify] https://crrev.com/c20eeee528d703316ee8e88c790c4ab6ff04f0ae/build/android/lint/suppressions.xml
[modify] https://crrev.com/c20eeee528d703316ee8e88c790c4ab6ff04f0ae/third_party/.gitignore
[add] https://crrev.com/c20eeee528d703316ee8e88c790c4ab6ff04f0ae/third_party/bazel/desugar/BUILD.gn
[add] https://crrev.com/c20eeee528d703316ee8e88c790c4ab6ff04f0ae/third_party/bazel/desugar/Desugar-runtime.jar
[modify] https://crrev.com/c20eeee528d703316ee8e88c790c4ab6ff04f0ae/third_party/bazel/desugar/README.chromium
[modify] https://crrev.com/c20eeee528d703316ee8e88c790c4ab6ff04f0ae/third_party/gvr-android-sdk/BUILD.gn

Comment 4 by zpeng@chromium.org, Aug 16 2017

Cc: zpeng@chromium.org
Owner: agrieve@chromium.org
Status: Fixed (was: Available)

Sign in to add a comment