New issue
Advanced search Search tips

Issue 657847 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

GENERATED_JAVA_ENUM_PACKAGE doesn't support single line enums

Project Member Reported by awdf@chromium.org, Oct 20 2016

Issue description

If you try to compile a one-line enum such as the following:
```
// A Java counterpart will be generated for this enum.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.notifications
enum NotificationActionType { BUTTON, TEXT };
```
..it fails and asks if you forgot to add the "// GENERATED_JAVA_ENUM_PACKAGE:" annotation. But it compiles just fine when symbols are placed on separate lines.

It is particularly annoying because `git cl format` will turn a multiline enum into a single line one if it fits on one line.

Relevant script is in 
build/android/gyp/java_cpp_enum.py

A new test should be added in
build/android/gyp/java_cpp_enum_tests.py
 

Comment 1 by awdf@chromium.org, Oct 20 2016

Labels: Build-Tools
Owner: estevenson@chromium.org
Status: Assigned (was: Untriaged)
I'll take a look at this sometime this week since I've been looking at these files already!
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 16 2016

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

commit 4fdbbc3aeeb41eed8b6a65f29662ebb7865b0af0
Author: estevenson <estevenson@chromium.org>
Date: Wed Nov 16 23:36:50 2016

Add support for single line enums to java_cpp_enum.py.

This CL changes java_cpp_enum.py to handle single line enums. E.g.

// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.notifications
enum NotificationActionType { BUTTON, TEXT };

BUG= 657847 

Review-Url: https://codereview.chromium.org/2511533002
Cr-Commit-Position: refs/heads/master@{#432661}

[modify] https://crrev.com/4fdbbc3aeeb41eed8b6a65f29662ebb7865b0af0/build/android/gyp/java_cpp_enum.py
[modify] https://crrev.com/4fdbbc3aeeb41eed8b6a65f29662ebb7865b0af0/build/android/gyp/java_cpp_enum_tests.py

Status: Fixed (was: Assigned)

Comment 5 by awdf@chromium.org, Nov 17 2016

yay, thanks :-)

Sign in to add a comment