Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improv: type alias handling in TypeInfoCache #1986

Merged
merged 1 commit into from Dec 30, 2020

Conversation

bokken
Copy link
Member

@bokken bokken commented Dec 15, 2020

populate the "real" types into the map to avoid case conversions to
check for alternate representations.
populate new mappings to optimize future use

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Does ./gradlew autostyleCheck checkstyleAll pass ?
  3. Have you added your new test classes to an existing test suite in alphabetical order?

Changes to Existing Features:

  • Does this break existing behaviour? If so please explain.
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

populate the "real" types into the map to avoid case conversions to
check for alternate representations.
populate new mappings to optimize future use
@davecramer
Copy link
Member

Much prefer using CAPITAL letters for static identifiers

@davecramer davecramer added this to the 42.3.0 milestone Dec 29, 2020
@bokken bokken merged commit 0b27e26 into pgjdbc:master Dec 30, 2020
@bokken bokken deleted the array_alias branch December 30, 2020 19:11
@@ -666,17 +679,17 @@ public synchronized String getJavaClass(int oid) throws SQLException {
}

public String getTypeForAlias(String alias) {

Choose a reason for hiding this comment

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

Please check for input alias. If it is NPE it will result in NPE.

assertEquals("bool", ti.getTypeForAlias("Boolean"));
assertEquals("bool", ti.getTypeForAlias("Bool"));
assertEquals("bogus", ti.getTypeForAlias("bogus"));
}

Choose a reason for hiding this comment

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

You may want to add null as testcase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants