Upgrade from Java 7 to Java 8: modernize codebase with lambdas, streams, java.time API - #33
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…ms, java.time API - Update jackson-datatype dependency from jdk7 to jdk8 in BulkDownloader - Replace java.util.Date/Calendar with java.time.LocalDate in DocumentDate - Apply lambda expressions and method references across core classes - Use streams API for collection processing (Patent, Description, ClaimTreeBuilder) - Apply diamond operator throughout (UspcClassification, BulkData, Corpus) - Convert anonymous inner classes to lambdas (Corpus OptionParser) - Use removeIf() with lambdas for collection filtering - Fix pre-existing regex bug in OrgSynonymGenerator (non-capturing group) - Fix figref ID generation in FormattedText for list items - Handle lenient date parsing for patent dates with zero month/day - Update README with Java 8 requirements and build instructions - Update .gitignore to exclude build artifacts and IDE metadata Co-Authored-By: Sam Fertig <sam.huntfertig@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Upgrade from Java 7 to Java 8: lambdas, streams, java.time API
Summary
Modernizes the codebase from Java 7 patterns to Java 8, including:
jackson-datatype-jdk7→jackson-datatype-jdk8in BulkDownloaderjava.timemigration: RewroteDocumentDatefromFastDateFormat/java.util.Datetojava.time.LocalDate, with lenient handling for patent dates with zero month/day (e.g."20101100")<>throughoutPatent,UspcClassification,Corpus,BulkData, etc.for-each loops withforEach/method references inPatent.javasetters,UspcClassification.toSet(), and othersstream(),filter(),flatMap(),collect()inPatentClassification,UspcClassification,ClaimTreeBuilder,DescriptionOptionParserdouble-brace init blocks to fluent API calls inBulkDataandCorpusOrgSynonymGenerator:(:?sh|hs)→(?:sh|hs)(non-capturing group)Corpus:"filename"→"files"to match registered optionFormattedTextfor list items: removedReferenceTagger.createFigId()call that returned empty strings, now directly uses"FIG-" + containedTxt.gitignore: Added Eclipse settings and build artifact patternsTest results: 121/122 tests pass. One pre-existing failure (
FormattedTextCustomizeTest.MathML_html) was not introduced by this PR.Review & Testing Checklist for Human
DownloadJobconstructor exception handling (lines ~56-64 in diff): Previously threwIOException, now wraps it inRuntimeException. Verify callers aren't expectingIOException(breaking change).DocumentDatelenient parsing behavior (lines ~41-72 in diff): Zero month/day dates (e.g."20101100") now resolve to the 1st of that month (2010-11-01). OldFastDateFormatbehavior may have differed. Verify downstream consumers handle this correctly by testing with sample patent dates.OrgSynonymGeneratorregex fix (line ~41 in diff): Changed(:?sh|hs)to(?:sh|hs). This fixes group numbering (was 3 groups, now 2). Verify the testOrgSynonymGeneratorTest.CompanySynonymspasses and Toshiba synonym is generated correctly.FormattedTextfigref ID generation (line ~385 in diff): Now hardcodes"FIG-" + containedTxtinstead of callingReferenceTagger.createFigId(). Verify this produces correct IDs forFormattedTextTest.tailingFigrefstest case.options.has("filename")→options.has("files"). Was this intentional? Verify the--filesCLI arg now works correctly.Test Plan
Notes
Link to Devin Session: https://app.devin.ai/sessions/59f12d85c5f64c06b89c9d346234bee6
Requested by: @samfert