Skip to content

Conversation

@opwvhk
Copy link
Contributor

@opwvhk opwvhk commented Jan 9, 2022

Also resolve IDE warnings for idl.jj, which was previously impossible.

Make sure you have checked all steps below.

Jira

Tests

  • 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

  • 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":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • 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

Also resolve IDE warnings for idl.jj, which was previously impossible.
@github-actions github-actions bot added build Java Pull Requests for Java binding labels Jan 9, 2022
<groupId>org.apache.avro</groupId>
<version>1.12.0-SNAPSHOT</version>
<relativePath>../</relativePath>
<relativePath>../pom.xml</relativePath>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

<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>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

<configuration>
<sources>
<source>${project.basedir}/target/generated-test-sources</source>
<source>${project.basedir}/target/generated-test-sources/javacc</source>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

import com.fasterxml.jackson.databind.node.*;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

org.apache.commons.lang3.StringEscapeUtils is deprecated in favor of org.apache.commons.text.StringEscapeUtils.

this.resourceLoader = parent.resourceLoader;
}

@SuppressWarnings("RedundantThrows")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

<groupId>org.javacc.plugin</groupId>
<artifactId>javacc-maven-plugin</artifactId>
<version>${javacc-plugin.version}</version>
<dependencies>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

| "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; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the benefit of this change ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@opwvhk Ping!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

@RyanSkraba RyanSkraba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM too!

@martin-g martin-g merged commit 6603e77 into apache:master Jan 13, 2022
@martin-g
Copy link
Member

Thank you for the contribution, @opwvhk !

@martin-g
Copy link
Member

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!

@opwvhk
Copy link
Contributor Author

opwvhk commented Jan 13, 2022

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

@opwvhk opwvhk deleted the AVRO-3285-upgrade-javacc branch January 13, 2022 16:56
RyanSkraba pushed a commit that referenced this pull request Feb 7, 2022
Also resolve IDE warnings for idl.jj, which was previously impossible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Java Pull Requests for Java binding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants