[jira] [Commented] (LOG4J2-1477) @NonNull support (for @NonNullByDefault or similar)

2016-07-26 Thread Ralph Goers (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15393943#comment-15393943
 ] 

Ralph Goers commented on LOG4J2-1477:
-

Yeah, I got confused by 
https://blogs.oracle.com/java-platform-group/entry/java_8_s_new_type. With a 
heading of "Java's new type annotations", but it is only showing Checker as an 
example.

> @NonNull support (for @NonNullByDefault or similar)
> ---
>
> Key: LOG4J2-1477
> URL: https://issues.apache.org/jira/browse/LOG4J2-1477
> Project: Log4j 2
>  Issue Type: Wish
>  Components: API
>Affects Versions: 2.6.2
> Environment: any
>Reporter: Bojan Antonović
> Fix For: 2.7
>
>
> Eclipse (and other tools) offer non-null checks by annotation processing.
> One of the possibilities to enable this is to add the annotation 
> @org.eclipse.jdt.annotation.NonNullByDefault in your package-info.java file.
> Example:
> @org.eclipse.jdt.annotation.NonNullByDefault
> package foo;
> A frequent problem is reported when using a logger:
> private static final Logger LOGGER = LogManager.getLogger(Bla.class);
> for which Eclipse says:
> Null type safety (type annotations): The expression of type 'Logger' needs 
> unchecked conversion to conform to '@NonNull Logger' Bla.java  (...)
> This can by bypassed by putting a @SuppressWarnings("null") over the 
> expression, but this has to be done in every class, and may be the *only* 
> line of code with this workaround.
> Problems:
> - There are other annotations for non-null (javax.annotation.Nonnull) and 
> many other frameworks, like the Checker Framework.
> - I don't want to be a judge which one to choose.
> - Deeper support may require a dependency on Java 8.
> - If you want to do it framework wide, this can be a huge task.
> - As some tools are not mature (IMHO), it will need experiments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1477) @NonNull support (for @NonNullByDefault or similar)

2016-07-26 Thread Matt Sicker (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15393861#comment-15393861
 ] 

Matt Sicker commented on LOG4J2-1477:
-

I don't see any NonNull annotation in the JDK, either. There's only JSR 305 as 
you pointed out above. All other NonNull annotations are either part of 3rd 
party libraries (e.g., FindBugs, Eclipse, IntelliJ) or the one from bean 
validation (@NotNull).

> @NonNull support (for @NonNullByDefault or similar)
> ---
>
> Key: LOG4J2-1477
> URL: https://issues.apache.org/jira/browse/LOG4J2-1477
> Project: Log4j 2
>  Issue Type: Wish
>  Components: API
>Affects Versions: 2.6.2
> Environment: any
>Reporter: Bojan Antonović
> Fix For: 2.7
>
>
> Eclipse (and other tools) offer non-null checks by annotation processing.
> One of the possibilities to enable this is to add the annotation 
> @org.eclipse.jdt.annotation.NonNullByDefault in your package-info.java file.
> Example:
> @org.eclipse.jdt.annotation.NonNullByDefault
> package foo;
> A frequent problem is reported when using a logger:
> private static final Logger LOGGER = LogManager.getLogger(Bla.class);
> for which Eclipse says:
> Null type safety (type annotations): The expression of type 'Logger' needs 
> unchecked conversion to conform to '@NonNull Logger' Bla.java  (...)
> This can by bypassed by putting a @SuppressWarnings("null") over the 
> expression, but this has to be done in every class, and may be the *only* 
> line of code with this workaround.
> Problems:
> - There are other annotations for non-null (javax.annotation.Nonnull) and 
> many other frameworks, like the Checker Framework.
> - I don't want to be a judge which one to choose.
> - Deeper support may require a dependency on Java 8.
> - If you want to do it framework wide, this can be a huge task.
> - As some tools are not mature (IMHO), it will need experiments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1477) @NonNull support (for @NonNullByDefault or similar)

2016-07-26 Thread Greg Thomas (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15393396#comment-15393396
 ] 

Greg Thomas commented on LOG4J2-1477:
-

AFAICT, there is no @NonNull in the JDK; you still need to have a dependency on 
an annotations library. The checker-framework, which does static analysis, uses 
the JSR305 library in their tutorial. 
https://github.com/glts/safer-spring-petclinic/wiki/Setup

> @NonNull support (for @NonNullByDefault or similar)
> ---
>
> Key: LOG4J2-1477
> URL: https://issues.apache.org/jira/browse/LOG4J2-1477
> Project: Log4j 2
>  Issue Type: Wish
>  Components: API
>Affects Versions: 2.6.2
> Environment: any
>Reporter: Bojan Antonović
> Fix For: 2.7
>
>
> Eclipse (and other tools) offer non-null checks by annotation processing.
> One of the possibilities to enable this is to add the annotation 
> @org.eclipse.jdt.annotation.NonNullByDefault in your package-info.java file.
> Example:
> @org.eclipse.jdt.annotation.NonNullByDefault
> package foo;
> A frequent problem is reported when using a logger:
> private static final Logger LOGGER = LogManager.getLogger(Bla.class);
> for which Eclipse says:
> Null type safety (type annotations): The expression of type 'Logger' needs 
> unchecked conversion to conform to '@NonNull Logger' Bla.java  (...)
> This can by bypassed by putting a @SuppressWarnings("null") over the 
> expression, but this has to be done in every class, and may be the *only* 
> line of code with this workaround.
> Problems:
> - There are other annotations for non-null (javax.annotation.Nonnull) and 
> many other frameworks, like the Checker Framework.
> - I don't want to be a judge which one to choose.
> - Deeper support may require a dependency on Java 8.
> - If you want to do it framework wide, this can be a huge task.
> - As some tools are not mature (IMHO), it will need experiments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1477) @NonNull support (for @NonNullByDefault or similar)

2016-07-25 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15393206#comment-15393206
 ] 

Gary Gregory commented on LOG4J2-1477:
--

+1

> @NonNull support (for @NonNullByDefault or similar)
> ---
>
> Key: LOG4J2-1477
> URL: https://issues.apache.org/jira/browse/LOG4J2-1477
> Project: Log4j 2
>  Issue Type: Wish
>  Components: API
>Affects Versions: 2.6.2
> Environment: any
>Reporter: Bojan Antonović
> Fix For: 2.7
>
>
> Eclipse (and other tools) offer non-null checks by annotation processing.
> One of the possibilities to enable this is to add the annotation 
> @org.eclipse.jdt.annotation.NonNullByDefault in your package-info.java file.
> Example:
> @org.eclipse.jdt.annotation.NonNullByDefault
> package foo;
> A frequent problem is reported when using a logger:
> private static final Logger LOGGER = LogManager.getLogger(Bla.class);
> for which Eclipse says:
> Null type safety (type annotations): The expression of type 'Logger' needs 
> unchecked conversion to conform to '@NonNull Logger' Bla.java  (...)
> This can by bypassed by putting a @SuppressWarnings("null") over the 
> expression, but this has to be done in every class, and may be the *only* 
> line of code with this workaround.
> Problems:
> - There are other annotations for non-null (javax.annotation.Nonnull) and 
> many other frameworks, like the Checker Framework.
> - I don't want to be a judge which one to choose.
> - Deeper support may require a dependency on Java 8.
> - If you want to do it framework wide, this can be a huge task.
> - As some tools are not mature (IMHO), it will need experiments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1477) @NonNull support (for @NonNullByDefault or similar)

2016-07-25 Thread Ralph Goers (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15393134#comment-15393134
 ] 

Ralph Goers commented on LOG4J2-1477:
-

I would suggest this issue be deferred until the minimum version is Java 8, at 
which point we can use @NonNull from the JDK.

> @NonNull support (for @NonNullByDefault or similar)
> ---
>
> Key: LOG4J2-1477
> URL: https://issues.apache.org/jira/browse/LOG4J2-1477
> Project: Log4j 2
>  Issue Type: Wish
>  Components: API
>Affects Versions: 2.6.2
> Environment: any
>Reporter: Bojan Antonović
> Fix For: 2.7
>
>
> Eclipse (and other tools) offer non-null checks by annotation processing.
> One of the possibilities to enable this is to add the annotation 
> @org.eclipse.jdt.annotation.NonNullByDefault in your package-info.java file.
> Example:
> @org.eclipse.jdt.annotation.NonNullByDefault
> package foo;
> A frequent problem is reported when using a logger:
> private static final Logger LOGGER = LogManager.getLogger(Bla.class);
> for which Eclipse says:
> Null type safety (type annotations): The expression of type 'Logger' needs 
> unchecked conversion to conform to '@NonNull Logger' Bla.java  (...)
> This can by bypassed by putting a @SuppressWarnings("null") over the 
> expression, but this has to be done in every class, and may be the *only* 
> line of code with this workaround.
> Problems:
> - There are other annotations for non-null (javax.annotation.Nonnull) and 
> many other frameworks, like the Checker Framework.
> - I don't want to be a judge which one to choose.
> - Deeper support may require a dependency on Java 8.
> - If you want to do it framework wide, this can be a huge task.
> - As some tools are not mature (IMHO), it will need experiments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1477) @NonNull support (for @NonNullByDefault or similar)

2016-07-25 Thread Matt Sicker (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15392289#comment-15392289
 ] 

Matt Sicker commented on LOG4J2-1477:
-

You can configure IntelliJ to specify which annotation means "not null", and 
which annotation means "nullable". Then you can run the tool to insert the 
annotations everywhere it can figure out statically.

> @NonNull support (for @NonNullByDefault or similar)
> ---
>
> Key: LOG4J2-1477
> URL: https://issues.apache.org/jira/browse/LOG4J2-1477
> Project: Log4j 2
>  Issue Type: Wish
>  Components: API
>Affects Versions: 2.6.2
> Environment: any
>Reporter: Bojan Antonović
> Fix For: 2.7
>
>
> Eclipse (and other tools) offer non-null checks by annotation processing.
> One of the possibilities to enable this is to add the annotation 
> @org.eclipse.jdt.annotation.NonNullByDefault in your package-info.java file.
> Example:
> @org.eclipse.jdt.annotation.NonNullByDefault
> package foo;
> A frequent problem is reported when using a logger:
> private static final Logger LOGGER = LogManager.getLogger(Bla.class);
> for which Eclipse says:
> Null type safety (type annotations): The expression of type 'Logger' needs 
> unchecked conversion to conform to '@NonNull Logger' Bla.java  (...)
> This can by bypassed by putting a @SuppressWarnings("null") over the 
> expression, but this has to be done in every class, and may be the *only* 
> line of code with this workaround.
> Problems:
> - There are other annotations for non-null (javax.annotation.Nonnull) and 
> many other frameworks, like the Checker Framework.
> - I don't want to be a judge which one to choose.
> - Deeper support may require a dependency on Java 8.
> - If you want to do it framework wide, this can be a huge task.
> - As some tools are not mature (IMHO), it will need experiments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1477) @NonNull support (for @NonNullByDefault or similar)

2016-07-25 Thread Greg Thomas (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15392153#comment-15392153
 ] 

Greg Thomas commented on LOG4J2-1477:
-

Agreed; the best I've found seems to be 
https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305 which was an 
early implementation of what was originally going in to Java 7 but never made 
it. AIUI now maintained by the team at http://findbugs.sourceforge.net/ 

> @NonNull support (for @NonNullByDefault or similar)
> ---
>
> Key: LOG4J2-1477
> URL: https://issues.apache.org/jira/browse/LOG4J2-1477
> Project: Log4j 2
>  Issue Type: Wish
>  Components: API
>Affects Versions: 2.6.2
> Environment: any
>Reporter: Bojan Antonović
> Fix For: 2.7
>
>
> Eclipse (and other tools) offer non-null checks by annotation processing.
> One of the possibilities to enable this is to add the annotation 
> @org.eclipse.jdt.annotation.NonNullByDefault in your package-info.java file.
> Example:
> @org.eclipse.jdt.annotation.NonNullByDefault
> package foo;
> A frequent problem is reported when using a logger:
> private static final Logger LOGGER = LogManager.getLogger(Bla.class);
> for which Eclipse says:
> Null type safety (type annotations): The expression of type 'Logger' needs 
> unchecked conversion to conform to '@NonNull Logger' Bla.java  (...)
> This can by bypassed by putting a @SuppressWarnings("null") over the 
> expression, but this has to be done in every class, and may be the *only* 
> line of code with this workaround.
> Problems:
> - There are other annotations for non-null (javax.annotation.Nonnull) and 
> many other frameworks, like the Checker Framework.
> - I don't want to be a judge which one to choose.
> - Deeper support may require a dependency on Java 8.
> - If you want to do it framework wide, this can be a huge task.
> - As some tools are not mature (IMHO), it will need experiments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1477) @NonNull support (for @NonNullByDefault or similar)

2016-07-25 Thread JIRA

[ 
https://issues.apache.org/jira/browse/LOG4J2-1477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15392139#comment-15392139
 ] 

Mikael Ståldal commented on LOG4J2-1477:


I don't think we should use any Eclipse (or IntelliJ) specific annotations for 
this in Log4j.

> @NonNull support (for @NonNullByDefault or similar)
> ---
>
> Key: LOG4J2-1477
> URL: https://issues.apache.org/jira/browse/LOG4J2-1477
> Project: Log4j 2
>  Issue Type: Wish
>  Components: API
>Affects Versions: 2.6.2
> Environment: any
>Reporter: Bojan Antonović
> Fix For: 2.7
>
>
> Eclipse (and other tools) offer non-null checks by annotation processing.
> One of the possibilities to enable this is to add the annotation 
> @org.eclipse.jdt.annotation.NonNullByDefault in your package-info.java file.
> Example:
> @org.eclipse.jdt.annotation.NonNullByDefault
> package foo;
> A frequent problem is reported when using a logger:
> private static final Logger LOGGER = LogManager.getLogger(Bla.class);
> for which Eclipse says:
> Null type safety (type annotations): The expression of type 'Logger' needs 
> unchecked conversion to conform to '@NonNull Logger' Bla.java  (...)
> This can by bypassed by putting a @SuppressWarnings("null") over the 
> expression, but this has to be done in every class, and may be the *only* 
> line of code with this workaround.
> Problems:
> - There are other annotations for non-null (javax.annotation.Nonnull) and 
> many other frameworks, like the Checker Framework.
> - I don't want to be a judge which one to choose.
> - Deeper support may require a dependency on Java 8.
> - If you want to do it framework wide, this can be a huge task.
> - As some tools are not mature (IMHO), it will need experiments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1477) @NonNull support (for @NonNullByDefault or similar)

2016-07-25 Thread Matt Sicker (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15392022#comment-15392022
 ] 

Matt Sicker commented on LOG4J2-1477:
-

I'm pretty sure IntelliJ has a feature to auto-add `@NonNull` annotations where 
it can statically determine that it's not null. Ideally, this would be 
implemented with an annotation in log4j-api (probably the util package) and not 
as an external dependency.

> @NonNull support (for @NonNullByDefault or similar)
> ---
>
> Key: LOG4J2-1477
> URL: https://issues.apache.org/jira/browse/LOG4J2-1477
> Project: Log4j 2
>  Issue Type: Wish
>  Components: API
>Affects Versions: 2.6.2
> Environment: any
>Reporter: Bojan Antonović
> Fix For: 2.7
>
>
> Eclipse (and other tools) offer non-null checks by annotation processing.
> One of the possibilities to enable this is to add the annotation 
> @org.eclipse.jdt.annotation.NonNullByDefault in your package-info.java file.
> Example:
> @org.eclipse.jdt.annotation.NonNullByDefault
> package foo;
> A frequent problem is reported when using a logger:
> private static final Logger LOGGER = LogManager.getLogger(Bla.class);
> for which Eclipse says:
> Null type safety (type annotations): The expression of type 'Logger' needs 
> unchecked conversion to conform to '@NonNull Logger' Bla.java  (...)
> This can by bypassed by putting a @SuppressWarnings("null") over the 
> expression, but this has to be done in every class, and may be the *only* 
> line of code with this workaround.
> Problems:
> - There are other annotations for non-null (javax.annotation.Nonnull) and 
> many other frameworks, like the Checker Framework.
> - I don't want to be a judge which one to choose.
> - Deeper support may require a dependency on Java 8.
> - If you want to do it framework wide, this can be a huge task.
> - As some tools are not mature (IMHO), it will need experiments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org