Repository navigation
refactor(jdbc): extract DeclaredType parsing - #222
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Collapse declared-type parsing into one package-private value object.
DeclaredType.of(Col)owns the declared-type-or-cast-fallback lookup.typeName(),precision(),scale(), andisDeclared()hold the moved matcher blocks.LibsqlResultSetMetaData.getPrecision,getScale,getColumnTypeName, andisSigneddelegate.columnName(Col)stays in the metadata class.No regex, throw type, message, or locale changed. No test assertion edited. Only moves plus the named delegations.
Fixes #204
Moved logic (normalized diff)
Bodies compared against
HEADwith indentation, blank lines, and now-field-initializer lines normalized away. The pattern block and three of the four bodies are identical; only the factory's return wraps the unchanged body.Probe
Trimmed the returned type name in
DeclaredType.typeName()(matcher.group(1).trim().toUpperCase(...)):Reverted the probe.
git status --shortafterwards shows only the two intended source changes, and the full lane is green again.Line counts
LibsqlResultSetMetaData.javaDeclaredType.javaLanes
./mvnw -pl libsql-jdbc -am test→ 392 tests, 0 failures, 0 errors, 0 skipped. BUILD SUCCESS../mvnw spotless:applythen./mvnw spotless:check→ BUILD SUCCESS../mvnw -pl libsql-conformance -am verify→ 272 tests, 0 failures, 0 errors, 7 skipped. BUILD SUCCESS.