Limit to API version 510. Document the FDB.warnOnUnclosed function.

This commit is contained in:
A.J. Beamon 2017-12-12 09:57:58 -08:00
parent b354c7fc00
commit 84a428972e
1 changed files with 8 additions and 6 deletions

View File

@ -156,21 +156,23 @@ public class FDB {
} }
return singleton; return singleton;
} }
if(version < 500) if(version < 510)
throw new IllegalArgumentException("API version not supported (minimum 500)"); throw new IllegalArgumentException("API version not supported (minimum 510)");
if(version > 510) if(version > 510)
throw new IllegalArgumentException("API version not supported (maximum 510)"); throw new IllegalArgumentException("API version not supported (maximum 510)");
Select_API_version(version); Select_API_version(version);
FDB fdb = new FDB(version); FDB fdb = new FDB(version);
if(version < 510) {
fdb.warnOnUnclosed = false;
}
return singleton = fdb; return singleton = fdb;
} }
/**
* Enables or disables the stderr warning that is printed whenever an object with FoundationDB
* native resources is garbage collected without being closed. By default, this feature is enabled.
*
* @param warnOnUnclosed Whether the warning should be printed for unclosed objects
*/
public void setUnclosedWarning(boolean warnOnUnclosed) { public void setUnclosedWarning(boolean warnOnUnclosed) {
this.warnOnUnclosed = warnOnUnclosed; this.warnOnUnclosed = warnOnUnclosed;
} }