Skip to content

Commit

Permalink
Merge pull request #213 from tomohiron/fix_dump_memory
Browse files Browse the repository at this point in the history
fix dump memory problem
  • Loading branch information
twall committed Apr 8, 2013
2 parents 638135f + 18cd75b commit 900a68e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Features

Bug Fixes
---------

* [PR#213](https://github.com/twall/jna/pull/213): Fix `Structure.toString()` not to dump memory when `jna.dump_memory` is false. - [@tomohiron](https://github.com/tomohiron).

Release 3.5.2
=============
Expand Down
2 changes: 1 addition & 1 deletion src/com/sun/jna/Structure.java
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ public String toString() {
}

public String toString(boolean debug) {
return toString(0, true, true);
return toString(0, true, debug);
}

private String format(Class type) {
Expand Down
4 changes: 4 additions & 0 deletions test/com/sun/jna/StructureTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,10 @@ protected List getFieldOrder() {
assertTrue("Improperly formatted toString(): expected "
+ EXPECTED + "\n" + actual,
actual.matches(EXPECTED));

System.setProperty("jna.dump_memory", "false");
assertFalse("Doesn't dump memory when jna.dump_memory is false",
s.toString().contains("memory dump"));
}

public void testNativeMappedWrite() {
Expand Down

0 comments on commit 900a68e

Please sign in to comment.