Message-ID: From: "mblakley-casana (@mblakley-casana)" To: "pgjdbc/pgjdbc" Date: Mon, 18 May 2026 12:16:20 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #4069: Avoid direct java.lang.management dependency in maxResultBuffer parser In-Reply-To: References: List-Id: X-GitHub-Author-Login: mblakley-casana X-GitHub-Comment-Id: 4477556441 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 4069 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/4069#issuecomment-4477556441 Content-Type: text/plain; charset=utf-8 Tested two layers: JVM (simulated) — re-ran the existing JUnit tests against your commit: ``` ./gradlew :postgresql:test \ --tests org.postgresql.test.util.PGPropertyMaxResultBufferParserTest \ --tests org.postgresql.util.PGPropertyMaxResultBufferParserRuntimeTest PGPropertyMaxResultBufferParserRuntimeTest: 3 tests, 0 failures (your refactored LongSupplier-based reproducer) PGPropertyMaxResultBufferParserTest: 11 tests, 0 failures ``` Real Android (API 34, AVD Medium_Phone_API_34) — built your commit locally as 42.7.12-SNAPSHOT, consumed from mavenLocal in an Android instrumentation test: ``` @RunWith(AndroidJUnit4::class) class PgjdbcAndroidSmokeTest { @Test fun pgjdbcDriverLoadsAndParsesMaxResultBuffer() { Class.forName("org.postgresql.Driver") assertEquals(1000L, PGPropertyMaxResultBufferParser.parseProperty("1K")) assertThrows(PSQLException::class.java) { PGPropertyMaxResultBufferParser.parseProperty("10pct") } } } ``` `tests=1 failures=0 errors=0 in 12 ms.` Driver class graph resolves cleanly on ART — keeping JvmHeapAccess referenced from PGPropertyMaxResultBufferParser does not trigger eager verification of java.lang.management.ManagementFactory. The byte path (1K) never touches the holder. The percent path (10pct) loads JvmHeapAccess, ART fails to link it (no ManagementFactory), the catch (LinkageError) returns -1, and the parser raises PSQLException. I like your solution, and verified that it will work on Android. Thank you!