You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/02/08 21:41:55 UTC

[GitHub] [lucene-solr] epugh opened a new pull request #2326: LUCENE-9747: deal with NPE when package-info.java missing in the error messaging

epugh opened a new pull request #2326:
URL: https://github.com/apache/lucene-solr/pull/2326


   # Description
   
   _This is a replacement PR for https://github.com/apache/lucene-solr/pull/2325 that had extra files along.  (not quite up on force push and rebase!)_
   
   Missing `package-info.java` causes a NPE in the javadocs task and is not obvious what went wrong!
   
   # Solution
   
   Look for the very specific situation, and then don't include the `Element` in the `reporter.print()` method.  Maybe this should be a more generic test, but I wanted to be careful of not breaking other things.
   
   # Tests
   
   Delete a `package-info.java`, and then run javadocs and you'll see the error!
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [X ] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [X ] I have created a Jira issue and added the issue ID to my pull request title.
   - [ X] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [ X] I have developed this patch against the `master` branch.
   - [ X] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   - [ ] I have added documentation for the [Ref Guide](https://github.com/apache/lucene-solr/tree/master/solr/solr-ref-guide) (for Solr changes only).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] epugh commented on pull request #2326: LUCENE-9747: deal with NPE when package-info.java missing in the error messaging

Posted by GitBox <gi...@apache.org>.
epugh commented on pull request #2326:
URL: https://github.com/apache/lucene-solr/pull/2326#issuecomment-802403285


   Looking now, this bug is documented and there is a workaround documented, so going to close this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] muse-dev[bot] commented on a change in pull request #2326: LUCENE-9747: deal with NPE when package-info.java missing in the error messaging

Posted by GitBox <gi...@apache.org>.
muse-dev[bot] commented on a change in pull request #2326:
URL: https://github.com/apache/lucene-solr/pull/2326#discussion_r572446391



##########
File path: dev-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java
##########
@@ -430,6 +430,11 @@ private void error(Element element, String message) {
     fullMessage.append(element.getKind().toString().toLowerCase(Locale.ROOT));
     fullMessage.append("): ");
     fullMessage.append(message);
-    reporter.print(Diagnostic.Kind.ERROR, element, fullMessage.toString());
+    if (((element.getKind() == ElementKind.PACKAGE) && (fullMessage.toString().contains("javadocs are missing")))){

Review comment:
       *UnnecessaryParentheses:*  Unnecessary use of grouping parentheses




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #2326: LUCENE-9747: deal with NPE when package-info.java missing in the error messaging

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #2326:
URL: https://github.com/apache/lucene-solr/pull/2326#discussion_r572406190



##########
File path: dev-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java
##########
@@ -430,6 +430,11 @@ private void error(Element element, String message) {
     fullMessage.append(element.getKind().toString().toLowerCase(Locale.ROOT));
     fullMessage.append("): ");
     fullMessage.append(message);
-    reporter.print(Diagnostic.Kind.ERROR, element, fullMessage.toString());
+    if (((element.getKind() == ElementKind.PACKAGE) && (fullMessage.toString().contains("javadocs are missing")))){

Review comment:
       Shouldn't reporter.print(kind, String) be used for everything package-related? Why limit to "javadocs are missing"? I suspect other elements will also emit an NPE.
   
   Can you post the stack trace from that NPE to jira too? I'm sure jdk folks will be interested.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] epugh closed pull request #2326: LUCENE-9747: deal with NPE when package-info.java missing in the error messaging

Posted by GitBox <gi...@apache.org>.
epugh closed pull request #2326:
URL: https://github.com/apache/lucene-solr/pull/2326


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] epugh commented on a change in pull request #2326: LUCENE-9747: deal with NPE when package-info.java missing in the error messaging

Posted by GitBox <gi...@apache.org>.
epugh commented on a change in pull request #2326:
URL: https://github.com/apache/lucene-solr/pull/2326#discussion_r572426807



##########
File path: dev-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java
##########
@@ -430,6 +430,11 @@ private void error(Element element, String message) {
     fullMessage.append(element.getKind().toString().toLowerCase(Locale.ROOT));
     fullMessage.append("): ");
     fullMessage.append(message);
-    reporter.print(Diagnostic.Kind.ERROR, element, fullMessage.toString());
+    if (((element.getKind() == ElementKind.PACKAGE) && (fullMessage.toString().contains("javadocs are missing")))){

Review comment:
       I am all for making this change, I just didn't have much familiarity with this code base, so was trying to only change it to get my specific issue fixed.   
   
   I have added to the JIRA the stack trace.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org