pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: mblakley-casana (@mblakley-casana) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] PR #4069: Avoid direct java.lang.management dependency in maxResultBuffer parser
Date: Mon, 18 May 2026 12:16:20 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
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!
view thread (3+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] PR #4069: Avoid direct java.lang.management dependency in maxResultBuffer parser
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox