[
https://issues.apache.org/jira/browse/AVRO-3239?focusedWorklogId=691181&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-691181
]
ASF GitHub Bot logged work on AVRO-3239:
----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Dec/21 16:28
Start Date: 06/Dec/21 16:28
Worklog Time Spent: 10m
Work Description: opwvhk commented on a change in pull request #1377:
URL: https://github.com/apache/avro/pull/1377#discussion_r763167700
##########
File path:
lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj
##########
@@ -1020,13 +1020,17 @@ TOKEN :
Protocol CompilationUnit():
{
Protocol p;
+ DocCommentHelper.getAndClearWarnings(); // Throw away previous results.
}
{
p = ProtocolDeclaration()
( < "\u001a" > )?
( <STUFF_TO_IGNORE: ~[]> )?
<EOF>
- { return SchemaResolver.resolve(p); }
+ {
+ parserWarnings = DocCommentHelper.getAndClearWarnings();
Review comment:
Lines 1023 and 1031 are executed in the same method, and hence always on
the same thread. This guarantees that between these lines, the use of
`ThreadLocal` fields in the class `DocCommentHelper` works the same way as
instance fields.
(note: we need to use `ThreadLocal` fields, because the generated class
`IdlTokenManager` needs to store documentation somewhere (due to the leniency
of the parser), and we cannot we cannot add instance fields to it)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 691181)
Time Spent: 1.5h (was: 1h 20m)
> IDL parsing silently ignores dangling documentation comments
> ------------------------------------------------------------
>
> Key: AVRO-3239
> URL: https://issues.apache.org/jira/browse/AVRO-3239
> Project: Apache Avro
> Issue Type: Improvement
> Components: java, spec, tools
> Affects Versions: 1.8.2, 1.9.2, 1.10.2
> Reporter: Oscar Westra van Holthe - Kind
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.11.1
>
> Attachments: comments.avdl, comments.avpr
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> When parsing IDL, only the last documentation comment for a declaration is
> used.
> Any previous documentation comments are silently ignored.
> Proposed fix: while keeping the exact same parsing results, emit warnings for
> each documentation comment that is ignored.
> Additional suggestion: mention that a common cause for such a warning is
> using a documentation comment instead of a multiline comment.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)