eagle-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asdf2014 <...@git.apache.org>
Subject [GitHub] eagle pull request #925: [EAGLE-1012] Some language level problems in `eagle...
Date Tue, 02 May 2017 06:22:08 GMT
Github user asdf2014 commented on a diff in the pull request:

    https://github.com/apache/eagle/pull/925#discussion_r114254748
  
    --- Diff: eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
---
    @@ -199,7 +194,7 @@ private void closePlugins(List<AlertPublishPlugin> toBeClosed)
{
                 try {
                     p.close();
                 } catch (Exception e) {
    -                LOG.error(String.format("Error when close publish plugin {}!", p.getClass().getCanonicalName()),
e);
    +                LOG.error(String.format("Error when close publish plugin %s!", p.getClass().getCanonicalName()),
e);
    --- End diff --
    
    `String.format` should use `%s` rather than `{}`
    
    ```java
    @Test
    public void testFormat() {
        assertEquals("a{}c", String.format("a{}c", "b"));
        assertEquals("abc", String.format("a%sc", "b"));
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message