Automated cleanup refactoring#436
Open
nbauma109 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
317
to
+321
| try (PreparedStatement link = conn.prepareStatement(""" | ||
| INSERT INTO jar_locations(root_handle, path, last_modified, file_length, jar_id) | ||
| VALUES(?, ?, ?, ?, ?) | ||
| VALUES(?, ?, ?, ?, ?) | ||
| ON CONFLICT(root_handle, path) DO UPDATE SET | ||
| last_modified = excluded.last_modified, | ||
| file_length = excluded.file_length, | ||
| jar_id = excluded.jar_id""")) { //$NON-NLS-1$ | ||
| link.setString(1, rootHandle); | ||
| link.setString(2, path); | ||
| link.setLong(3, lastModified); | ||
| link.setLong(4, fileLength); | ||
| link.setInt(5, jarId); | ||
| link.executeUpdate(); | ||
| } | ||
| return new JarRegistration(jarId, needsIndexing); | ||
| last_modified = excluded.last_modified, |
Comment on lines
+334
to
+338
| int jarId() { | ||
| return jarId; | ||
| } | ||
|
|
||
| boolean ownsConnection() { | ||
| return ownsConnection; | ||
| } | ||
| boolean ownsConnection() { |
Comment on lines
112
to
+116
| stmt.executeUpdate(""" | ||
| INSERT INTO jars(id, root_handle, path, last_modified, file_length, runtime_version, file_crc, | ||
| content_hash) | ||
| VALUES(1, '=canonical', '/tmp/test.jar', 1, 1, 21, 1, 'fixture-hash')"""); //$NON-NLS-1$ | ||
| stmt.executeUpdate(""" | ||
| INSERT INTO jar_locations(root_handle, path, last_modified, file_length, jar_id) | ||
| VALUES('=canonical', '/tmp/test.jar', 1, 1, 1)"""); //$NON-NLS-1$ | ||
| stmt.executeUpdate(""" | ||
| INSERT INTO strings(id, value) VALUES | ||
| (1, 'alpha'), (2, 'beta'), (3, 'pkg.beta'), (4, 'pkg.Gamma'), | ||
| (5, '=canonical/pkg/Type.class')"""); //$NON-NLS-1$ | ||
| stmt.executeUpdate(""" | ||
| INSERT INTO entries(jar_id, kind, declaration, access_flags, type_category, | ||
| element_handle_id, name_id, qualified_name_id) VALUES | ||
| (1, 1, 0, 0, 0, 5, 1, 1), | ||
| (1, 1, 0, 0, 0, 0, 2, 3), | ||
| (1, 1, 0, 0, 0, 0, 1, 3), | ||
| (1, 1, 0, 0, 0, 0, 4, 4)"""); //$NON-NLS-1$ | ||
| stmt.executeUpdate(""" |
Comment on lines
+150
to
+154
| // entries uses integer ids into strings instead of storing text inline, | ||
| // cutting per-row size from ~280 bytes (7 text columns) to ~56 bytes (7 ints). | ||
| stmt.execute(""" | ||
| CREATE INDEX IF NOT EXISTS idx_entries_name | ||
| ON entries(jar_id, kind, name_id)"""); //$NON-NLS-1$ | ||
| // Most member entries use the same value for name and | ||
| // qualified_name. Their qualified-name lookup is already | ||
| // covered by idx_entries_name, so do not duplicate those rows | ||
| // in a second, often very large, index. Dropping the old index | ||
| // also migrates existing databases on first startup. | ||
| stmt.execute("DROP INDEX IF EXISTS idx_entries_qname"); //$NON-NLS-1$ | ||
| CREATE TABLE IF NOT EXISTS entries ( | ||
| id INTEGER PRIMARY KEY, |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #436 +/- ##
=========================================
Coverage 69.48% 69.48%
Complexity 941 941
=========================================
Files 151 151
Lines 17307 17307
Branches 2392 2392
=========================================
Hits 12025 12025
Misses 3999 3999
Partials 1283 1283 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ea6b815 to
6284826
Compare
6284826 to
22b3015
Compare
|
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.



This pull request contains cleanup changes generated by Eclipse headless cleanup action.