You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2016/08/10 00:27:21 UTC

logging-log4j2 git commit: Use "with" as the Builder setter method prefix.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master f95a85b8d -> e9cec779d


Use "with" as the Builder setter method prefix.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e9cec779
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e9cec779
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e9cec779

Branch: refs/heads/master
Commit: e9cec779d2f6722f97c6e403502a5789ebcaeaa8
Parents: f95a85b
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Aug 9 17:27:19 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Tue Aug 9 17:27:19 2016 -0700

----------------------------------------------------------------------
 .../log4j/core/config/plugins/validation/ValidatingPlugin.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e9cec779/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/validation/ValidatingPlugin.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/validation/ValidatingPlugin.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/validation/ValidatingPlugin.java
index 95a4209..6068f46 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/validation/ValidatingPlugin.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/validation/ValidatingPlugin.java
@@ -57,7 +57,7 @@ public class ValidatingPlugin {
         @Required(message = "The name given by the builder is null")
         private String name;
 
-        public Builder setName(final String name) {
+        public Builder withName(final String name) {
             this.name = name;
             return this;
         }


Re: logging-log4j2 git commit: Use "with" as the Builder setter method prefix.

Posted by Gary Gregory <ga...@gmail.com>.
This particular case is in test code but I've seen "with" on the main side,
so I used that. I did not do an exhaustive search. We should use the same
prefix all over IMO, it does not look very pro otherwise (IMO again). I do
not care if it is "set" or "with", I care more that it is consistent.

Gary

On Tue, Aug 9, 2016 at 10:10 PM, Matt Sicker <bo...@gmail.com> wrote:

> I brought this topic up a while back on using with or set, and I don't
> recall which one we agreed on. It would be nice to be consistent, though,
> as both styles are currently in use (and I've written at least one of each
> unfortunately).
>
> ---------- Forwarded message ----------
> From: <gg...@apache.org>
> Date: 9 August 2016 at 19:27
> Subject: logging-log4j2 git commit: Use "with" as the Builder setter
> method prefix.
> To: commits@logging.apache.org
>
>
> Repository: logging-log4j2
> Updated Branches:
>   refs/heads/master f95a85b8d -> e9cec779d
>
>
> Use "with" as the Builder setter method prefix.
>
> Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
> Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit
> /e9cec779
> Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e9cec779
> Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e9cec779
>
> Branch: refs/heads/master
> Commit: e9cec779d2f6722f97c6e403502a5789ebcaeaa8
> Parents: f95a85b
> Author: Gary Gregory <gg...@apache.org>
> Authored: Tue Aug 9 17:27:19 2016 -0700
> Committer: Gary Gregory <gg...@apache.org>
> Committed: Tue Aug 9 17:27:19 2016 -0700
>
> ----------------------------------------------------------------------
>  .../log4j/core/config/plugins/validation/ValidatingPlugin.java     | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e
> 9cec779/log4j-core/src/test/java/org/apache/logging/log4j/co
> re/config/plugins/validation/ValidatingPlugin.java
> ----------------------------------------------------------------------
> diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/con
> fig/plugins/validation/ValidatingPlugin.java
> b/log4j-core/src/test/java/org/apache/logging/log4j/core/con
> fig/plugins/validation/ValidatingPlugin.java
> index 95a4209..6068f46 100644
> --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/con
> fig/plugins/validation/ValidatingPlugin.java
> +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/con
> fig/plugins/validation/ValidatingPlugin.java
> @@ -57,7 +57,7 @@ public class ValidatingPlugin {
>          @Required(message = "The name given by the builder is null")
>          private String name;
>
> -        public Builder setName(final String name) {
> +        public Builder withName(final String name) {
>              this.name = name;
>              return this;
>          }
>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Fwd: logging-log4j2 git commit: Use "with" as the Builder setter method prefix.

Posted by Matt Sicker <bo...@gmail.com>.
I brought this topic up a while back on using with or set, and I don't
recall which one we agreed on. It would be nice to be consistent, though,
as both styles are currently in use (and I've written at least one of each
unfortunately).

---------- Forwarded message ----------
From: <gg...@apache.org>
Date: 9 August 2016 at 19:27
Subject: logging-log4j2 git commit: Use "with" as the Builder setter method
prefix.
To: commits@logging.apache.org


Repository: logging-log4j2
Updated Branches:
  refs/heads/master f95a85b8d -> e9cec779d


Use "with" as the Builder setter method prefix.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/
commit/e9cec779
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e9cec779
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e9cec779

Branch: refs/heads/master
Commit: e9cec779d2f6722f97c6e403502a5789ebcaeaa8
Parents: f95a85b
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Aug 9 17:27:19 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Tue Aug 9 17:27:19 2016 -0700

----------------------------------------------------------------------
 .../log4j/core/config/plugins/validation/ValidatingPlugin.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/
e9cec779/log4j-core/src/test/java/org/apache/logging/log4j/
core/config/plugins/validation/ValidatingPlugin.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/
config/plugins/validation/ValidatingPlugin.java b/log4j-core/src/test/java/
org/apache/logging/log4j/core/config/plugins/validation/
ValidatingPlugin.java
index 95a4209..6068f46 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/
config/plugins/validation/ValidatingPlugin.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/
config/plugins/validation/ValidatingPlugin.java
@@ -57,7 +57,7 @@ public class ValidatingPlugin {
         @Required(message = "The name given by the builder is null")
         private String name;

-        public Builder setName(final String name) {
+        public Builder withName(final String name) {
             this.name = name;
             return this;
         }




-- 
Matt Sicker <bo...@gmail.com>