You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by GitBox <gi...@apache.org> on 2022/01/09 15:04:46 UTC

[GitHub] [avro] opwvhk opened a new pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

opwvhk opened a new pull request #1447:
URL: https://github.com/apache/avro/pull/1447


   Also resolve IDE warnings for idl.jj, which was previously impossible.
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [X] My PR addresses the following [Avro Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them in the PR title. For example, "AVRO-1234: My Avro PR"
     - https://issues.apache.org/jira/browse/AVRO-3285
     - In case you are adding a dependency, check if the license complies with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   
   ### Tests
   
   - [X] My PR ~adds the following unit tests __OR__~ does not need testing for this extremely good reason:  
     Upgrading plugins and libraries does not add functionality; existing tests must pass though
   
   ### Commits
   
   - [X] My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](https://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [X] In case of new functionality, my PR adds documentation that describes how to use it.
     - All the public functions and the classes in the PR contain Javadoc that explain what it does
   


-- 
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: dev-unsubscribe@avro.apache.org

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



[GitHub] [avro] opwvhk commented on pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
opwvhk commented on pull request #1447:
URL: https://github.com/apache/avro/pull/1447#issuecomment-1012323919


   Correct @martin-g: it's an improvement, not a fix for a bug, so there's no need. 


-- 
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: issues-unsubscribe@avro.apache.org

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



[GitHub] [avro] opwvhk commented on a change in pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
opwvhk commented on a change in pull request #1447:
URL: https://github.com/apache/avro/pull/1447#discussion_r780793226



##########
File path: lang/java/compiler/pom.xml
##########
@@ -133,11 +133,11 @@
               <classpathScope>test</classpathScope>
               <arguments>
                 <argument>-classpath</argument>
-                <classpath></classpath>
+                <classpath/>
                 <argument>org.apache.avro.compiler.specific.SchemaTask</argument>
                 <argument>${project.basedir}/src/test/resources/full_record_v1.avsc</argument>
                 <argument>${project.basedir}/src/test/resources/full_record_v2.avsc</argument>
-                <argument>${project.basedir}/target/generated-test-sources</argument>
+                <argument>${project.basedir}/target/generated-test-sources/javacc</argument>

Review comment:
       Generated code should be placed in a subdirectory per tool. I copied the directory name from line 178.




-- 
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: issues-unsubscribe@avro.apache.org

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



[GitHub] [avro] martin-g commented on pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
martin-g commented on pull request #1447:
URL: https://github.com/apache/avro/pull/1447#issuecomment-1012147270


   I think this should not be backported to branch-1.11.
   If I'm wrong then please let me know and I will cherry-pick 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: issues-unsubscribe@avro.apache.org

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



[GitHub] [avro] opwvhk commented on a change in pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
opwvhk commented on a change in pull request #1447:
URL: https://github.com/apache/avro/pull/1447#discussion_r780793637



##########
File path: lang/java/pom.xml
##########
@@ -210,9 +211,16 @@
           </configuration>
         </plugin>
         <plugin>
-          <groupId>org.codehaus.mojo</groupId>
+          <groupId>org.javacc.plugin</groupId>
           <artifactId>javacc-maven-plugin</artifactId>
           <version>${javacc-plugin.version}</version>
+          <dependencies>

Review comment:
       The new plugin treats JavaCC as a provided dependency, so we need to add it explicitly.




-- 
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: issues-unsubscribe@avro.apache.org

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



[GitHub] [avro] opwvhk commented on a change in pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
opwvhk commented on a change in pull request #1447:
URL: https://github.com/apache/avro/pull/1447#discussion_r780793097



##########
File path: lang/java/compiler/pom.xml
##########
@@ -24,7 +24,7 @@
     <artifactId>avro-parent</artifactId>
     <groupId>org.apache.avro</groupId>
     <version>1.12.0-SNAPSHOT</version>
-    <relativePath>../</relativePath>
+    <relativePath>../pom.xml</relativePath>

Review comment:
       Minor really, but the relative path should point to a pom.




-- 
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: issues-unsubscribe@avro.apache.org

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



[GitHub] [avro] opwvhk commented on a change in pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
opwvhk commented on a change in pull request #1447:
URL: https://github.com/apache/avro/pull/1447#discussion_r783955387



##########
File path: lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj
##########
@@ -1589,7 +1568,7 @@ Schema PrimitiveType():
 | "time_ms" { return LogicalTypes.timeMillis().addToSchema(Schema.create(Type.INT)); }
 | "timestamp_ms" { return LogicalTypes.timestampMillis().addToSchema(Schema.create(Type.LONG)); }
 | "local_timestamp_ms" { return LogicalTypes.localTimestampMillis().addToSchema(Schema.create(Type.LONG)); }
-| "decimal" { return DecimalTypeProperties(); }
+| "decimal" s = DecimalTypeProperties() { return s; }

Review comment:
       Nothing directly, but the rule DecimalTypeProperties no longer shows up as 'unused in IntelliJ.




-- 
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: issues-unsubscribe@avro.apache.org

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



[GitHub] [avro] martin-g commented on pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
martin-g commented on pull request #1447:
URL: https://github.com/apache/avro/pull/1447#issuecomment-1012145981


   Thank you for the contribution, @opwvhk !


-- 
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: issues-unsubscribe@avro.apache.org

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



[GitHub] [avro] martin-g commented on a change in pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
martin-g commented on a change in pull request #1447:
URL: https://github.com/apache/avro/pull/1447#discussion_r783883848



##########
File path: lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj
##########
@@ -1589,7 +1568,7 @@ Schema PrimitiveType():
 | "time_ms" { return LogicalTypes.timeMillis().addToSchema(Schema.create(Type.INT)); }
 | "timestamp_ms" { return LogicalTypes.timestampMillis().addToSchema(Schema.create(Type.LONG)); }
 | "local_timestamp_ms" { return LogicalTypes.localTimestampMillis().addToSchema(Schema.create(Type.LONG)); }
-| "decimal" { return DecimalTypeProperties(); }
+| "decimal" s = DecimalTypeProperties() { return s; }

Review comment:
       @opwvhk Ping!




-- 
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: issues-unsubscribe@avro.apache.org

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



[GitHub] [avro] opwvhk commented on a change in pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
opwvhk commented on a change in pull request #1447:
URL: https://github.com/apache/avro/pull/1447#discussion_r780793504



##########
File path: lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj
##########
@@ -137,6 +137,7 @@ public class Idl implements Closeable {
     this.resourceLoader = parent.resourceLoader;
   }
 
+  @SuppressWarnings("RedundantThrows")

Review comment:
       A bit silly, but this is the one thing I cannot fix.




-- 
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: issues-unsubscribe@avro.apache.org

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



[GitHub] [avro] martin-g merged pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
martin-g merged pull request #1447:
URL: https://github.com/apache/avro/pull/1447


   


-- 
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: dev-unsubscribe@avro.apache.org

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



[GitHub] [avro] opwvhk commented on a change in pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
opwvhk commented on a change in pull request #1447:
URL: https://github.com/apache/avro/pull/1447#discussion_r780793285



##########
File path: lang/java/compiler/pom.xml
##########
@@ -161,16 +159,14 @@
             </goals>
             <configuration>
               <sources>
-                <source>${project.basedir}/target/generated-test-sources</source>
+                <source>${project.basedir}/target/generated-test-sources/javacc</source>

Review comment:
       Mirror the change in line 140 to maintain a working build.




-- 
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: issues-unsubscribe@avro.apache.org

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



[GitHub] [avro] martin-g commented on a change in pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
martin-g commented on a change in pull request #1447:
URL: https://github.com/apache/avro/pull/1447#discussion_r781026969



##########
File path: lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj
##########
@@ -1589,7 +1568,7 @@ Schema PrimitiveType():
 | "time_ms" { return LogicalTypes.timeMillis().addToSchema(Schema.create(Type.INT)); }
 | "timestamp_ms" { return LogicalTypes.timestampMillis().addToSchema(Schema.create(Type.LONG)); }
 | "local_timestamp_ms" { return LogicalTypes.localTimestampMillis().addToSchema(Schema.create(Type.LONG)); }
-| "decimal" { return DecimalTypeProperties(); }
+| "decimal" s = DecimalTypeProperties() { return s; }

Review comment:
       what is the benefit of this change ?




-- 
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: issues-unsubscribe@avro.apache.org

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



[GitHub] [avro] opwvhk commented on a change in pull request #1447: AVRO-3285: Upgrade JavaCC plugin and library

Posted by GitBox <gi...@apache.org>.
opwvhk commented on a change in pull request #1447:
URL: https://github.com/apache/avro/pull/1447#discussion_r780793395



##########
File path: lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj
##########
@@ -81,7 +81,7 @@ import org.apache.avro.util.internal.Accessor;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.*;
 
-import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.text.StringEscapeUtils;

Review comment:
       `org.apache.commons.lang3.StringEscapeUtils` is deprecated in favor of `org.apache.commons.text.StringEscapeUtils`.




-- 
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: issues-unsubscribe@avro.apache.org

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