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

Issue 650688 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: ----
Type: Bug

Blocked on:
issue 768586



Sign in to add a comment

clang-format quality problem - bad linewrap

Project Member Reported by awdf@chromium.org, Sep 27 2016

Issue description

clang-format produced code that (choose all that apply): 
- No sane human would ever choose

Here's the code before formatting:

        Notification notification = new CustomNotificationBuilder(context)
                                            .setSmallIcon(R.drawable.ic_chrome)
                                            .setLargeIcon(largeIcon)
                                            .setTitle("title")
                                            .setBody("body")
                                            .setOrigin("origin")
                                            .setTicker("ticker")
                                            .setDefaults(Notification.DEFAULT_ALL)
                                            .setVibrate(new long[] {100L})
                                            .setContentIntent(contentIntent)
                                            .setDeleteIntent(deleteIntent)
                                            .addButtonAction(actionIcon, "button",
                                                    createIntent(context, "ActionButtonOne"))
                                            .addButtonAction(actionIcon, "button",
                                                    createIntent(context, "ActionButtonTwo"))
                                            .addSettingsAction(0 /* iconId */, "settings",
                                                    createIntent(context, "SettingsButton"))
                                            .build();


Here's the code after formatting:

        Notification notification = new CustomNotificationBuilder(
                context).setSmallIcon(R.drawable.ic_chrome)
                                            .setLargeIcon(largeIcon)
                                            .setTitle("title")
                                            .setBody("body")
                                            .setOrigin("origin")
                                            .setTicker("ticker")
                                            .setDefaults(Notification.DEFAULT_ALL)
                                            .setVibrate(new long[] {100L})
                                            .setContentIntent(contentIntent)
                                            .setDeleteIntent(deleteIntent)
                                            .addButtonAction(actionIcon, "button",
                                                    createIntent(context, "ActionButtonOne"))
                                            .addButtonAction(actionIcon, "button",
                                                    createIntent(context, "ActionButtonTwo"))
                                            .addSettingsAction(0 /* iconId */, "settings",
                                                    createIntent(context, "SettingsButton"))
                                            .build();
Here's how it ought to look:

As it was before formatting, or potentially:

        Notification notification =
                new CustomNotificationBuilder(context)
                        .setSmallIcon(R.drawable.ic_chrome)
                        .setLargeIcon(largeIcon)
                        .setTitle("title")
                        .setBody("body")
                        .setOrigin("origin")
                        .setTicker("ticker")
                        .setDefaults(Notification.DEFAULT_ALL)
                        .setVibrate(new long[] {100L})
                        .setContentIntent(contentIntent)
                        .setDeleteIntent(deleteIntent)
                        .addButtonAction(actionIcon, "button",
                                createIntent(context, "ActionButtonOne"))
                        .addButtonAction(actionIcon, "button",
                                createIntent(context, "ActionButtonTwo"))
                        .addSettingsAction(0 /* iconId */, "settings",
                                createIntent(context, "SettingsButton"))
                        .build();

Code review link for full files/context:

https://codereview.chromium.org/2337963003/diff/120001/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java
 
Components: Tools
Status: Assigned (was: Untriaged)
Blockedon: 768586
Labels: clang-format
Status: Fixed (was: Assigned)
        Notification notification = new CustomNotificationBuilder(context)
                                            .setSmallIcon(R.drawable.ic_chrome)
                                            .setLargeIcon(largeIcon)
                                            .setTitle("title")
                                            .setBody("body")
                                            .setOrigin("origin")
                                            .setTicker("ticker")
                                            .setDefaults(Notification.DEFAULT_ALL)
                                            .setVibrate(new long[] {100L})
                                            .setContentIntent(contentIntent)
                                            .setDeleteIntent(deleteIntent)
                                            .addButtonAction(actionIcon, "button",
                                                    createIntent(context, "ActionButtonOne"))
                                            .addButtonAction(actionIcon, "button",
                                                    createIntent(context, "ActionButtonTwo"))
                                            .addSettingsAction(0 /* iconId */, "settings",
                                                    createIntent(context, "SettingsButton"))
                                            .build();

Sign in to add a comment