diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md
index bd769f4ef44..870d38983f5 100644
--- a/doc/news/_preparation_next_release.md
+++ b/doc/news/_preparation_next_release.md
@@ -184,9 +184,9 @@ you up to date with the multi-language support provided by Elektra.
Until internal `KeySet` iterator support has been dropped form native library, `Elektra::ksRewind` is being retained while also being annotated as 'deprecated for removal'. The reason is, that we still need to rewind a `KeySet` before passing it to a native plugin via `NativePlugin::set`, `NativePlugin::get` or `NativePlugin::error`. _(@tucek)_
Furthermore `Elektra::ksPop` and `KeySet::pop` have been removed and `KeySet::remove` has been introduced as replacment.
- Until internal `KeySet` iterator support has been dropped form native library, `Elektra::ksRewind` is being retained while also being annotated as 'depricated for removal'. The reason is, that we still need to rewind a `KeySet` before passing it to a native plugin via `NativePlugin::set`, `NativePlugin::get` or `NativePlugin::error`. _(@tucek)_
+Until internal `KeySet` iterator support has been dropped form native library, `Elektra::ksRewind` is being retained while also being annotated as 'depricated for removal'. The reason is, that we still need to rewind a `KeySet` before passing it to a native plugin via `NativePlugin::set`, `NativePlugin::get` or `NativePlugin::error`. _(@tucek)_
- Further more `Elektra::ksPop` and `KeySet::pop` have been removed and `KeySet::remove` has been introduced as replacment. _(Michael Tucek)_
+Further more `Elektra::ksPop` and `KeySet::pop` have been removed and `KeySet::remove` has been introduced as replacment. _(Michael Tucek)_
- Migrated to Gradle project _(Michael Tucek)_
diff --git a/src/bindings/jna/java-shared.gradle b/src/bindings/jna/java-shared.gradle
index ac2f5d886fd..546238ebd35 100644
--- a/src/bindings/jna/java-shared.gradle
+++ b/src/bindings/jna/java-shared.gradle
@@ -57,7 +57,10 @@ tasks.named('javadoc').configure {
}
// TODO #3754 reactivate: fail on warnings and warn about non-compliant javadoc syntax
- //options.addStringOption('Xwerror', '-Xdoclint:all')
+ //options.addStringOption('Xwerror', '-quiet')
+ //options.addStringOption('Xdoclint:all', '-quiet')
+ options.addStringOption('Xdoclint:-missing', '-quiet')
+ options.addStringOption('Xdoclint:all', '-quiet')
}
javadoc {
diff --git a/src/bindings/jna/libelektra/src/main/java/org/libelektra/Elektra.java b/src/bindings/jna/libelektra/src/main/java/org/libelektra/Elektra.java
index cb112bcfafd..65a0d220ca7 100644
--- a/src/bindings/jna/libelektra/src/main/java/org/libelektra/Elektra.java
+++ b/src/bindings/jna/libelektra/src/main/java/org/libelektra/Elektra.java
@@ -14,7 +14,7 @@ public interface Elektra extends Library {
/**
* Singleton instance of the native library proxy.
*/
- Elektra INSTANCE = Native.loadLibrary("elektra-kdb", Elektra.class);
+ Elektra INSTANCE = Native.loadLibrary ("elektra-kdb", Elektra.class);
// KDB methods --------------------------------------------------------------
@@ -47,8 +47,7 @@ public interface Elektra extends Library {
*
{@code null} on failure
*
*/
- @Nullable
- Pointer kdbOpen(@Nullable Pointer contractKeySet, Pointer errorKey);
+ @Nullable Pointer kdbOpen (@Nullable Pointer contractKeySet, Pointer errorKey);
/**
* Closes the session with the Key database.
@@ -71,7 +70,7 @@ public interface Elektra extends Library {
* {@code -1} on {@code null} pointer passed
*
*/
- int kdbClose(Pointer handle, Pointer errorKey);
+ int kdbClose (Pointer handle, Pointer errorKey);
/**
* Retrieve keys in an atomic and universal way.
@@ -136,7 +135,7 @@ public interface Elektra extends Library {
* information in the {@code parentKey} and {@code returnKeySet} left
* unchanged.
*/
- int kdbGet(Pointer handle, Pointer returnKeySet, Pointer parentKey);
+ int kdbGet (Pointer handle, Pointer returnKeySet, Pointer parentKey);
/**
* Set keys in an atomic and universal way.
@@ -192,12 +191,12 @@ public interface Elektra extends Library {
* in KDB, an error will be set on {@code parentKey} if possible
*
*/
- int kdbSet(Pointer handle, Pointer keySet, Pointer parentKey);
+ int kdbSet (Pointer handle, Pointer keySet, Pointer parentKey);
/**
* Sets up a contract for use with {@link #kdbOpen(Pointer, Pointer) kdbOpen()}
* that configures the {@code gopts} plugin.
- *
+ *
* @param contractKeySet {@link Pointer} to a valid {@code KeySet} into which
* the contract will be written.
* @param argsSize Size of the {@code args} data.
@@ -222,64 +221,66 @@ public interface Elektra extends Library {
* {@code -1} on {@code null} pointer passed
*
*/
- int elektraGOptsContractFromStrings(Pointer contractKeySet, long argsSize, String args, long envSize, String env,
- Pointer parentKey, @Nullable Pointer goptsConfigKeySet);
+ int elektraGOptsContractFromStrings (Pointer contractKeySet, long argsSize, String args, long envSize, String env,
+ Pointer parentKey, @Nullable Pointer goptsConfigKeySet);
// Key methods --------------------------------------------------------------
/**
* Enumeration of argument flags for {@link Elektra#keyNew(String, Object...)}.
*/
- enum KeyNewArgumentFlags {
+ enum KeyNewArgumentFlags
+ {
/**
* Used as a parameter terminator to {@link Elektra#keyNew(String, Object...)}
*/
- KEY_END(0),
+ KEY_END (0),
/**
* Flag for the key name
*/
- KEY_NAME(1),
+ KEY_NAME (1),
/**
* Flag for the key data
*/
- KEY_VALUE(1 << 1),
+ KEY_VALUE (1 << 1),
/**
* Flag for the key comment
*/
- KEY_COMMENT(1 << 3),
+ KEY_COMMENT (1 << 3),
/**
* Flag if the key is binary
*/
- KEY_BINARY(1 << 4),
+ KEY_BINARY (1 << 4),
/**
* Flag for maximum size to limit value
*/
- KEY_SIZE(1 << 11),
+ KEY_SIZE (1 << 11),
/**
* Flag for metadata
*/
- KEY_META(1 << 15);
+ KEY_META (1 << 15);
private final Integer value;
/**
* @return Integer value recognized by the native library.
- */
- public Integer getValue() {
+ */
+ public Integer getValue ()
+ {
return value;
}
- private KeyNewArgumentFlags(int value) {
- this.value = Integer.valueOf(value);
+ private KeyNewArgumentFlags (int value)
+ {
+ this.value = Integer.valueOf (value);
}
-
}
/**
@@ -287,145 +288,148 @@ private KeyNewArgumentFlags(int value) {
*
* For examples and further particularities, please see the documentation of the
* native library: TODO #3754 link to C API documentation
- *
+ *
* @see #keyDel(Pointer) keyDel()
* @see KeyNewArgumentFlags
- *
+ *
* @param name A valid name to the key, or {@code null} to get a simple
* initialized, but really empty, object.
- * @param args Argument flags, each followed by a corresponding value, if appropriate.
- * @return
- * - A {@link Pointer} to a newly allocated and initialized {@code Key} object on success
- * - {@code null} on allocation error or if an invalid {@code name} was passed (see {@link #keySetName(Pointer, String) keySetName()
+ * @param args Argument flags, each followed by a corresponding value, if
+ * appropriate.
+ * @return
+ *
+ * - A {@link Pointer} to a newly allocated and initialized
+ * {@code Key} object on success
+ * - {@code null} on allocation error or if an invalid {@code name}
+ * was passed (see {@link #keySetName(Pointer, String)
+ * keySetName()}
*
*/
- @Nullable
- Pointer keyNew(@Nullable String name, @Nullable Object... args);
+ @Nullable Pointer keyNew (@Nullable String name, @Nullable Object... args);
- Pointer keyDup(Pointer source, int flags);
+ Pointer keyDup (Pointer source, int flags);
- int keyCopy(Pointer dest, Pointer source, int flags);
+ int keyCopy (Pointer dest, Pointer source, int flags);
- int keyClear(Pointer key); // not needed
+ int keyClear (Pointer key); // not needed
- int keyDel(Pointer key);
+ int keyDel (Pointer key);
- int keyIncRef(Pointer key);
+ int keyIncRef (Pointer key);
- int keyDecRef(Pointer key);
+ int keyDecRef (Pointer key);
- int keyGetRef(Pointer key);
+ int keyGetRef (Pointer key);
/* Meta Info */
- int keyRewindMeta(Pointer key);
+ int keyRewindMeta (Pointer key);
- Pointer keyNextMeta(Pointer key);
+ Pointer keyNextMeta (Pointer key);
- Pointer keyCurrentMeta(Pointer key);
+ Pointer keyCurrentMeta (Pointer key);
- int keyCopyMeta(Pointer dest, Pointer source, String metaName);
+ int keyCopyMeta (Pointer dest, Pointer source, String metaName);
- int keyCopyAllMeta(Pointer dest, Pointer source);
+ int keyCopyAllMeta (Pointer dest, Pointer source);
- Pointer keyGetMeta(Pointer key, String metaName);
+ Pointer keyGetMeta (Pointer key, String metaName);
- int keySetMeta(Pointer key, String metaName, String newMetaString);
+ int keySetMeta (Pointer key, String metaName, String newMetaString);
/* Methods for Making Tests */
- int keyCmp(Pointer k1, Pointer k2);
+ int keyCmp (Pointer k1, Pointer k2);
- int keyNeedSync(Pointer key);
+ int keyNeedSync (Pointer key);
- int keyIsBelow(Pointer key, Pointer check);
+ int keyIsBelow (Pointer key, Pointer check);
- int keyIsBelowOrSame(Pointer key, Pointer check);
+ int keyIsBelowOrSame (Pointer key, Pointer check);
- int keyIsDirectlyBelow(Pointer key, Pointer check);
+ int keyIsDirectlyBelow (Pointer key, Pointer check);
- int keyIsBinary(Pointer key);
+ int keyIsBinary (Pointer key);
- int keyIsString(Pointer key);
+ int keyIsString (Pointer key);
/* Name Manipulation Methods */
- String keyName(Pointer key);
+ String keyName (Pointer key);
- int keyGetNameSize(Pointer key);
+ int keyGetNameSize (Pointer key);
- int keyGetName(Pointer key, String returnedName, int maxSize); // not needed
+ int keyGetName (Pointer key, String returnedName, int maxSize); // not needed
- int keySetName(Pointer key, String newname);
+ int keySetName (Pointer key, String newname);
- Pointer keyUnescapedName(Pointer key);
+ Pointer keyUnescapedName (Pointer key);
- int keyGetUnescapedNameSize(Pointer key);
+ int keyGetUnescapedNameSize (Pointer key);
- String keyBaseName(Pointer key); // not implemented
+ String keyBaseName (Pointer key); // not implemented
- int keyGetBaseNameSize(Pointer key); // not implemented
+ int keyGetBaseNameSize (Pointer key); // not implemented
- int keyGetBaseName(Pointer key, String returned, int maxSize); // not needed
+ int keyGetBaseName (Pointer key, String returned, int maxSize); // not needed
- int keySetBaseName(Pointer key, String baseName);
+ int keySetBaseName (Pointer key, String baseName);
- int keyAddBaseName(Pointer key, String baseName);
+ int keyAddBaseName (Pointer key, String baseName);
/* Value Manipulation Methods */
// byte[] keyValue(Pointer key);
- int keyGetValueSize(Pointer key);
+ int keyGetValueSize (Pointer key);
- String keyString(Pointer key);
+ String keyString (Pointer key);
- int keyGetString(Pointer key, String returnedString, int maxSize); // not needed
+ int keyGetString (Pointer key, String returnedString, int maxSize); // not needed
- int keySetString(Pointer key, String newString);
+ int keySetString (Pointer key, String newString);
// int keyGetBinary(Pointer key, byte[] returnedBinary, int maxSize);
// int keySetBinary(Pointer key, byte[] newBinary, int dataSize);
// KeySet methods -----------------------------------------------------------
- Pointer ksNew(int alloc, Object... args);
+ Pointer ksNew (int alloc, Object... args);
- Pointer ksDup(Pointer source);
+ Pointer ksDup (Pointer source);
- int ksCopy(Pointer dest, Pointer source);
+ int ksCopy (Pointer dest, Pointer source);
- int ksClear(Pointer ks); // not needed
+ int ksClear (Pointer ks); // not needed
- int ksDel(Pointer ks);
+ int ksDel (Pointer ks);
- int ksNeedSync(Pointer ks);
+ int ksNeedSync (Pointer ks);
- int ksGetSize(Pointer ks);
+ int ksGetSize (Pointer ks);
- int ksAppendKey(Pointer ks, Pointer toAppend);
+ int ksAppendKey (Pointer ks, Pointer toAppend);
- int ksAppend(Pointer ks, Pointer toAppend);
+ int ksAppend (Pointer ks, Pointer toAppend);
- Pointer ksCut(Pointer ks, Pointer cutpoint);
+ Pointer ksCut (Pointer ks, Pointer cutpoint);
// TODO #3137 Also elektraKsPopAtCursor should replace the current ksPop. See
// also #3189.
- Pointer ksPop(Pointer ks);
+ Pointer ksPop (Pointer ks);
- Pointer elektraKsPopAtCursor(Pointer ks, int cursor);
+ Pointer elektraKsPopAtCursor (Pointer ks, int cursor);
// deprecated for removal - (forRemoval = true) not set since not all build
// server are using JDK >=9 yet
- @Deprecated
- int ksRewind(Pointer ks);
+ @Deprecated int ksRewind (Pointer ks);
- Pointer ksHead(Pointer ks);
+ Pointer ksHead (Pointer ks);
- Pointer ksTail(Pointer ks);
+ Pointer ksTail (Pointer ks);
- Pointer ksAtCursor(Pointer ks, int cursor);
+ Pointer ksAtCursor (Pointer ks, int cursor);
- Pointer ksLookup(Pointer ks, Pointer key, int options);
+ Pointer ksLookup (Pointer ks, Pointer key, int options);
- Pointer ksLookupByName(Pointer ks, String name, int options);
+ Pointer ksLookupByName (Pointer ks, String name, int options);
- NativePlugin.ElektraPlugin elektraPluginOpen(String pluginName, Pointer modules, Pointer config, Pointer errorKey);
+ NativePlugin.ElektraPlugin elektraPluginOpen (String pluginName, Pointer modules, Pointer config, Pointer errorKey);
- NativePlugin.ElektraPlugin elektraPluginClose(String pluginName, Pointer errorKey);
+ NativePlugin.ElektraPlugin elektraPluginClose (String pluginName, Pointer errorKey);
}
diff --git a/src/bindings/jna/libelektra/src/main/java/org/libelektra/Key.java b/src/bindings/jna/libelektra/src/main/java/org/libelektra/Key.java
index 8cec4c8cbc4..6cda875981e 100644
--- a/src/bindings/jna/libelektra/src/main/java/org/libelektra/Key.java
+++ b/src/bindings/jna/libelektra/src/main/java/org/libelektra/Key.java
@@ -1,20 +1,19 @@
package org.libelektra;
-import com.sun.jna.Pointer;
-
import static org.libelektra.Elektra.KeyNewArgumentFlags.KEY_END;
import static org.libelektra.Elektra.KeyNewArgumentFlags.KEY_META;
import static org.libelektra.Elektra.KeyNewArgumentFlags.KEY_VALUE;
+import com.sun.jna.Pointer;
import java.util.Arrays;
-
import org.libelektra.Elektra.KeyNewArgumentFlags;
import org.libelektra.exception.PluginMisbehaviorException;
/**
* Key is an essential class that encapsulates key name , value and metainfo.
*/
-public class Key implements Iterable {
+public class Key implements Iterable
+{
private static final String WARNINGS = "warnings";
// constants
@@ -28,7 +27,8 @@ public class Key implements Iterable {
/**
* Indicates a generic key exception occurred.
*/
- public static class KeyException extends RuntimeException {
+ public static class KeyException extends RuntimeException
+ {
private static final long serialVersionUID = 637936674538102511L;
}
@@ -36,7 +36,8 @@ public static class KeyException extends RuntimeException {
/**
* Indicates an invalid key name has been used.
*/
- public static class InvalidNameException extends KeyException {
+ public static class InvalidNameException extends KeyException
+ {
private static final long serialVersionUID = -7659317176138893895L;
}
@@ -44,7 +45,8 @@ public static class InvalidNameException extends KeyException {
/**
* Indicates a key's type conversion failed.
*/
- public static class TypeConversionException extends KeyException {
+ public static class TypeConversionException extends KeyException
+ {
private static final long serialVersionUID = -8648296754188373810L;
}
@@ -52,7 +54,8 @@ public static class TypeConversionException extends KeyException {
/**
* Indicates a key's type does not match its value.
*/
- public static class TypeMismatchException extends KeyException {
+ public static class TypeMismatchException extends KeyException
+ {
private static final long serialVersionUID = 8035874860117969698L;
}
@@ -64,9 +67,10 @@ public static class TypeMismatchException extends KeyException {
*
* @param p Pointer in long format
*/
- protected Key(final long p) {
- key = new Pointer(p);
- incRef();
+ protected Key (final long p)
+ {
+ key = new Pointer (p);
+ incRef ();
}
/**
@@ -74,9 +78,10 @@ protected Key(final long p) {
*
* @param p Pointer as Pointer object
*/
- protected Key(final Pointer p) {
+ protected Key (final Pointer p)
+ {
key = p;
- incRef();
+ incRef ();
}
/**
@@ -88,9 +93,12 @@ protected Key(final Pointer p) {
* KeyNewArgumentFlags.KEY_END
* @return New key object
*/
- protected static Key create(final String name, final Object... args) {
- return new Key(Elektra.INSTANCE.keyNew(name, Arrays.stream(args)
- .map(o -> (o instanceof KeyNewArgumentFlags) ? ((KeyNewArgumentFlags) o).getValue() : o).toArray()));
+ protected static Key create (final String name, final Object... args)
+ {
+ return new Key (Elektra.INSTANCE.keyNew (
+ name, Arrays.stream (args)
+ .map (o -> (o instanceof KeyNewArgumentFlags) ? ((KeyNewArgumentFlags) o).getValue () : o)
+ .toArray ()));
}
/**
@@ -103,10 +111,13 @@ protected static Key create(final String name, final Object... args) {
* filtered away
* @return New key object
*/
- public static Key create(final String name, final Object value, final Key... meta) {
+ public static Key create (final String name, final Object value, final Key... meta)
+ {
int size = 0;
- for (final Key m : meta) {
- if (m != null) {
+ for (final Key m : meta)
+ {
+ if (m != null)
+ {
size++;
}
}
@@ -115,15 +126,17 @@ public static Key create(final String name, final Object value, final Key... met
final Object[] args = new Object[size];
int cur = 0;
args[cur++] = KEY_VALUE;
- args[cur++] = value != null ? value.toString() : null;
- if (size > 3) {
+ args[cur++] = value != null ? value.toString () : null;
+ if (size > 3)
+ {
args[cur++] = KEY_META;
- for (final Key m : meta) {
+ for (final Key m : meta)
+ {
args[cur++] = m;
}
}
args[cur] = KEY_END;
- return create(name, args);
+ return create (name, args);
}
/**
@@ -134,19 +147,23 @@ public static Key create(final String name, final Object value, final Key... met
* values.
* @return New key object
*/
- public static Key create(final String name, final Key... meta) {
- return create(name, null, meta);
+ public static Key create (final String name, final Key... meta)
+ {
+ return create (name, null, meta);
}
/**
* Clean-up method to release key reference
*/
- public void release() {
+ public void release ()
+ {
- if (key != null) {
- decRef();
- if (getRef() == 0) {
- Elektra.INSTANCE.keyDel(key);
+ if (key != null)
+ {
+ decRef ();
+ if (getRef () == 0)
+ {
+ Elektra.INSTANCE.keyDel (key);
}
}
key = null;
@@ -156,9 +173,9 @@ public void release() {
* Clean-up method to inform underlying c-library about the release of the key
* reference in jna-binding
*/
- @Override
- protected void finalize() throws Throwable {
- release();
+ @Override protected void finalize () throws Throwable
+ {
+ release ();
}
/**
@@ -166,7 +183,8 @@ protected void finalize() throws Throwable {
*
* @return Boolean if key is null
*/
- public boolean isNull() {
+ public boolean isNull ()
+ {
return key == null;
}
@@ -176,9 +194,9 @@ public boolean isNull() {
*
* @return Key name in String format
*/
- @Override
- public String toString() {
- return getName();
+ @Override public String toString ()
+ {
+ return getName ();
}
/**
@@ -186,9 +204,9 @@ public String toString() {
*
* @return Custom KeyNameIterator
*/
- @Override
- public java.util.Iterator iterator() {
- return new KeyNameIterator(this);
+ @Override public java.util.Iterator iterator ()
+ {
+ return new KeyNameIterator (this);
}
/**
@@ -196,8 +214,9 @@ public java.util.Iterator iterator() {
*
* @return Key value in boolean format
*/
- public boolean getBoolean() {
- return Boolean.parseBoolean(getString());
+ public boolean getBoolean ()
+ {
+ return Boolean.parseBoolean (getString ());
}
/**
@@ -205,8 +224,9 @@ public boolean getBoolean() {
*
* @return Key value in byte format
*/
- public byte getByte() {
- return Byte.parseByte(getString());
+ public byte getByte ()
+ {
+ return Byte.parseByte (getString ());
}
/**
@@ -214,8 +234,9 @@ public byte getByte() {
*
* @return Key value in short integer format
*/
- public short getShort() {
- return Short.parseShort(getString());
+ public short getShort ()
+ {
+ return Short.parseShort (getString ());
}
/**
@@ -223,8 +244,9 @@ public short getShort() {
*
* @return Key value in integer format
*/
- public int getInteger() {
- return Integer.parseInt(getString());
+ public int getInteger ()
+ {
+ return Integer.parseInt (getString ());
}
/**
@@ -232,8 +254,9 @@ public int getInteger() {
*
* @return Key value in long integer format
*/
- public long getLong() {
- return Long.parseLong(getString());
+ public long getLong ()
+ {
+ return Long.parseLong (getString ());
}
/**
@@ -241,8 +264,9 @@ public long getLong() {
*
* @return Key value in float format
*/
- public float getFloat() {
- return Float.parseFloat(getString());
+ public float getFloat ()
+ {
+ return Float.parseFloat (getString ());
}
/**
@@ -250,8 +274,9 @@ public float getFloat() {
*
* @return Key value in double format
*/
- public double getDouble() {
- return Double.parseDouble(getString());
+ public double getDouble ()
+ {
+ return Double.parseDouble (getString ());
}
/**
@@ -259,8 +284,9 @@ public double getDouble() {
*
* @param v Boolean value to set
*/
- public void setBoolean(final boolean v) {
- setString(Boolean.toString(v));
+ public void setBoolean (final boolean v)
+ {
+ setString (Boolean.toString (v));
}
/**
@@ -268,8 +294,9 @@ public void setBoolean(final boolean v) {
*
* @param v Byte value to set
*/
- public void setByte(final byte v) {
- setString(Byte.toString(v));
+ public void setByte (final byte v)
+ {
+ setString (Byte.toString (v));
}
/**
@@ -277,8 +304,9 @@ public void setByte(final byte v) {
*
* @param v Short integer value to set
*/
- public void setShort(final short v) {
- setString(Short.toString(v));
+ public void setShort (final short v)
+ {
+ setString (Short.toString (v));
}
/**
@@ -286,8 +314,9 @@ public void setShort(final short v) {
*
* @param v Integer value to set
*/
- public void setInteger(final int v) {
- setString(Integer.toString(v));
+ public void setInteger (final int v)
+ {
+ setString (Integer.toString (v));
}
/**
@@ -295,8 +324,9 @@ public void setInteger(final int v) {
*
* @param v Long integer value to set
*/
- public void setLong(final long v) {
- setString(Long.toString(v));
+ public void setLong (final long v)
+ {
+ setString (Long.toString (v));
}
/**
@@ -304,8 +334,9 @@ public void setLong(final long v) {
*
* @param v Float value to set
*/
- public void setFloat(final float v) {
- setString(Float.toString(v));
+ public void setFloat (final float v)
+ {
+ setString (Float.toString (v));
}
/**
@@ -313,8 +344,9 @@ public void setFloat(final float v) {
*
* @param v Double value to set
*/
- public void setDouble(final double v) {
- setString(Double.toString(v));
+ public void setDouble (final double v)
+ {
+ setString (Double.toString (v));
}
/**
@@ -323,17 +355,18 @@ public void setDouble(final double v) {
* @param text Reason for the error
* @param args Custom arguments
*/
- public void setError(final String text, final Object... args) {
- final StackTraceElement[] e = Thread.currentThread().getStackTrace();
- setMeta("error", "number description module file line function reason");
- setMeta("error/number", PluginMisbehaviorException.errorNumber());
- setMeta("error/description", "jni/java error");
- setMeta("error/module", e[1].getClassName() + " " + e[1].getMethodName());
- setMeta("error/file", e[1].getFileName());
- setMeta("error/line", Integer.toString(e[1].getLineNumber()));
- setMeta("error/mountpoint", getName());
- setMeta("error/configfile", getString());
- setMeta("error/reason", String.format(text, args));
+ public void setError (final String text, final Object... args)
+ {
+ final StackTraceElement[] e = Thread.currentThread ().getStackTrace ();
+ setMeta ("error", "number description module file line function reason");
+ setMeta ("error/number", PluginMisbehaviorException.errorNumber ());
+ setMeta ("error/description", "jni/java error");
+ setMeta ("error/module", e[1].getClassName () + " " + e[1].getMethodName ());
+ setMeta ("error/file", e[1].getFileName ());
+ setMeta ("error/line", Integer.toString (e[1].getLineNumber ()));
+ setMeta ("error/mountpoint", getName ());
+ setMeta ("error/configfile", getString ());
+ setMeta ("error/reason", String.format (text, args));
}
/**
@@ -342,34 +375,40 @@ public void setError(final String text, final Object... args) {
* @param text Reason for the warning
* @param args Custom arguments
*/
- public void addWarning(final String text, final Object... args) {
- final StackTraceElement[] e = Thread.currentThread().getStackTrace();
- final Key k = getMeta(WARNINGS);
- final StringBuilder builder = new StringBuilder(WARNINGS + "/#");
- if (!k.isNull()) {
- builder.append(k.getString());
- builder.setCharAt(11, (char) (builder.charAt(11) + 1));
- if (builder.charAt(11) > '9') {
- builder.setCharAt(11, '0');
- builder.setCharAt(10, (char) (builder.charAt(10) + 1));
- if (builder.charAt(10) > '9') {
- builder.setCharAt(10, '0');
+ public void addWarning (final String text, final Object... args)
+ {
+ final StackTraceElement[] e = Thread.currentThread ().getStackTrace ();
+ final Key k = getMeta (WARNINGS);
+ final StringBuilder builder = new StringBuilder (WARNINGS + "/#");
+ if (!k.isNull ())
+ {
+ builder.append (k.getString ());
+ builder.setCharAt (11, (char) (builder.charAt (11) + 1));
+ if (builder.charAt (11) > '9')
+ {
+ builder.setCharAt (11, '0');
+ builder.setCharAt (10, (char) (builder.charAt (10) + 1));
+ if (builder.charAt (10) > '9')
+ {
+ builder.setCharAt (10, '0');
}
}
- setMeta(Key.WARNINGS, builder.substring(10));
- } else {
- builder.append("00");
- setMeta(Key.WARNINGS, "00");
+ setMeta (Key.WARNINGS, builder.substring (10));
+ }
+ else
+ {
+ builder.append ("00");
+ setMeta (Key.WARNINGS, "00");
}
- setMeta(builder + "", "number description module file line function reason");
- setMeta(builder + "/number", PluginMisbehaviorException.errorNumber());
- setMeta(builder + "/description", "jni/java warning");
- setMeta(builder + "/module", e[1].getClassName() + " " + e[1].getMethodName());
- setMeta(builder + "/file", e[1].getFileName());
- setMeta(builder + "/line", Integer.toString(e[1].getLineNumber()));
- setMeta(builder + "/mountpoint", getName());
- setMeta(builder + "/configfile", getString());
- setMeta(builder + "/reason", String.format(text, args));
+ setMeta (builder + "", "number description module file line function reason");
+ setMeta (builder + "/number", PluginMisbehaviorException.errorNumber ());
+ setMeta (builder + "/description", "jni/java warning");
+ setMeta (builder + "/module", e[1].getClassName () + " " + e[1].getMethodName ());
+ setMeta (builder + "/file", e[1].getFileName ());
+ setMeta (builder + "/line", Integer.toString (e[1].getLineNumber ()));
+ setMeta (builder + "/mountpoint", getName ());
+ setMeta (builder + "/configfile", getString ());
+ setMeta (builder + "/reason", String.format (text, args));
}
/*
@@ -381,8 +420,9 @@ public void addWarning(final String text, final Object... args) {
*
* @return New Key object containing the same information as this key
*/
- public Key dup() {
- return dup(KEY_CP_ALL);
+ public Key dup ()
+ {
+ return dup (KEY_CP_ALL);
}
/**
@@ -392,8 +432,9 @@ public Key dup() {
*
* @return New Key object containing the same information as this key
*/
- public Key dup(final int flags) {
- return new Key(Elektra.INSTANCE.keyDup(get(), flags));
+ public Key dup (final int flags)
+ {
+ return new Key (Elektra.INSTANCE.keyDup (get (), flags));
}
/**
@@ -403,24 +444,28 @@ public Key dup(final int flags) {
* @param source Source Key object containing the information to copy
* @param flags what parts of the key to copy (a combination of KEY_CP_* flags)
*/
- public void copy(final Key source, final int flags) {
- if (source != null) {
- Elektra.INSTANCE.keyCopy(get(), source.get(), flags);
+ public void copy (final Key source, final int flags)
+ {
+ if (source != null)
+ {
+ Elektra.INSTANCE.keyCopy (get (), source.get (), flags);
}
}
/**
* Increments the reference counter for this key
*/
- protected void incRef() {
- Elektra.INSTANCE.keyIncRef(key);
+ protected void incRef ()
+ {
+ Elektra.INSTANCE.keyIncRef (key);
}
/**
* Decrements the reference counter for this key
*/
- protected void decRef() {
- Elektra.INSTANCE.keyDecRef(key);
+ protected void decRef ()
+ {
+ Elektra.INSTANCE.keyDecRef (key);
}
/**
@@ -428,8 +473,9 @@ protected void decRef() {
*
* @return Reference counter as integer
*/
- public int getRef() {
- return Elektra.INSTANCE.keyGetRef(get());
+ public int getRef ()
+ {
+ return Elektra.INSTANCE.keyGetRef (get ());
}
/**
@@ -438,8 +484,9 @@ public int getRef() {
* @return 0 in case of no errors; 1 if key is not found; 2 if metakey is not
* found
*/
- public int rewindMeta() {
- return Elektra.INSTANCE.keyRewindMeta(get());
+ public int rewindMeta ()
+ {
+ return Elektra.INSTANCE.keyRewindMeta (get ());
}
/**
@@ -447,8 +494,9 @@ public int rewindMeta() {
*
* @return new Key object containing the next meta information
*/
- public Key nextMeta() {
- return new Key(Elektra.INSTANCE.keyNextMeta(get()));
+ public Key nextMeta ()
+ {
+ return new Key (Elektra.INSTANCE.keyNextMeta (get ()));
}
/**
@@ -456,8 +504,9 @@ public Key nextMeta() {
*
* @return new Key object containing the current meta information
*/
- public Key currentMeta() {
- return new Key(Elektra.INSTANCE.keyNextMeta(get()));
+ public Key currentMeta ()
+ {
+ return new Key (Elektra.INSTANCE.keyNextMeta (get ()));
}
/**
@@ -469,11 +518,13 @@ public Key currentMeta() {
* required meta and nothing had to be done, -1 in case of an error or
* if the source parameter was null
*/
- public int copyMeta(final Key source, final String metaName) {
- if (source == null) {
+ public int copyMeta (final Key source, final String metaName)
+ {
+ if (source == null)
+ {
return -1;
}
- return Elektra.INSTANCE.keyCopyMeta(get(), source.get(), metaName);
+ return Elektra.INSTANCE.keyCopyMeta (get (), source.get (), metaName);
}
/**
@@ -484,11 +535,13 @@ public int copyMeta(final Key source, final String metaName) {
* meta and nothing had to be done, -1 in case of an error or if the
* source parameter was null
*/
- public int copyAllMeta(final Key source) {
- if (source == null) {
+ public int copyAllMeta (final Key source)
+ {
+ if (source == null)
+ {
return -1;
}
- return Elektra.INSTANCE.keyCopyAllMeta(get(), source.get());
+ return Elektra.INSTANCE.keyCopyAllMeta (get (), source.get ());
}
/**
@@ -497,8 +550,9 @@ public int copyAllMeta(final Key source) {
* @param metaName Key name of meta information to be fetched
* @return New Key object containing the requested meta information
*/
- public Key getMeta(final String metaName) {
- return new Key(Elektra.INSTANCE.keyGetMeta(get(), metaName));
+ public Key getMeta (final String metaName)
+ {
+ return new Key (Elektra.INSTANCE.keyGetMeta (get (), metaName));
}
/**
@@ -510,8 +564,9 @@ public Key getMeta(final String metaName) {
* the key and value > 0 representing the size of newMetaString if
* update successful
*/
- public int setMeta(final String metaName, final String newMetaString) {
- return Elektra.INSTANCE.keySetMeta(get(), metaName, newMetaString);
+ public int setMeta (final String metaName, final String newMetaString)
+ {
+ return Elektra.INSTANCE.keySetMeta (get (), metaName, newMetaString);
}
/**
@@ -522,11 +577,13 @@ public int setMeta(final String metaName, final String newMetaString) {
* @return 0 if key name is equal; -1 if this key name has lower alphabetical
* order than the other key; 1 if this key has higher alphabetical order
*/
- public int cmp(final Key other) {
- if (other == null) {
- throw new IllegalArgumentException("other should be a key, not null");
+ public int cmp (final Key other)
+ {
+ if (other == null)
+ {
+ throw new IllegalArgumentException ("other should be a key, not null");
}
- return Integer.signum(Elektra.INSTANCE.keyCmp(get(), other.get()));
+ return Integer.signum (Elektra.INSTANCE.keyCmp (get (), other.get ()));
}
/**
@@ -534,8 +591,9 @@ public int cmp(final Key other) {
*
* @return 1 if needs sync, 0 if no change done and -1 in case of a null pointer
*/
- public int needsSync() {
- return Elektra.INSTANCE.keyNeedSync(get());
+ public int needsSync ()
+ {
+ return Elektra.INSTANCE.keyNeedSync (get ());
}
/**
@@ -544,11 +602,13 @@ public int needsSync() {
* @param other Key that is used in check as parent key
* @return Boolean if this key is (non-direct) sub-key of other-key
*/
- public boolean isBelow(final Key other) {
- if (other == null) {
- throw new IllegalArgumentException("other should be a key, not null");
+ public boolean isBelow (final Key other)
+ {
+ if (other == null)
+ {
+ throw new IllegalArgumentException ("other should be a key, not null");
}
- return Elektra.INSTANCE.keyIsBelow(other.get(), get()) == 1;
+ return Elektra.INSTANCE.keyIsBelow (other.get (), get ()) == 1;
}
/**
@@ -557,11 +617,13 @@ public boolean isBelow(final Key other) {
* @param other Key that is used in check as parent key
* @return Boolean if this key is other key or (non-direct) sub-key of other-key
*/
- public boolean isBelowOrSame(final Key other) {
- if (other == null) {
- throw new IllegalArgumentException("other should be a key, not null");
+ public boolean isBelowOrSame (final Key other)
+ {
+ if (other == null)
+ {
+ throw new IllegalArgumentException ("other should be a key, not null");
}
- return Elektra.INSTANCE.keyIsBelowOrSame(other.get(), get()) == 1;
+ return Elektra.INSTANCE.keyIsBelowOrSame (other.get (), get ()) == 1;
}
/**
@@ -570,11 +632,13 @@ public boolean isBelowOrSame(final Key other) {
* @param other Key that is used in check as parent key
* @return Boolean if this key is direct sub-key of other key ("child")
*/
- public boolean isDirectBelow(final Key other) {
- if (other == null) {
- throw new IllegalArgumentException("other should be a key, not null");
+ public boolean isDirectBelow (final Key other)
+ {
+ if (other == null)
+ {
+ throw new IllegalArgumentException ("other should be a key, not null");
}
- return Elektra.INSTANCE.keyIsDirectlyBelow(other.get(), get()) == 1;
+ return Elektra.INSTANCE.keyIsDirectlyBelow (other.get (), get ()) == 1;
}
/**
@@ -582,8 +646,9 @@ public boolean isDirectBelow(final Key other) {
*
* @return Boolean if this key is a binary key
*/
- public boolean isBinary() {
- return Elektra.INSTANCE.keyIsBinary(get()) == 1;
+ public boolean isBinary ()
+ {
+ return Elektra.INSTANCE.keyIsBinary (get ()) == 1;
}
/**
@@ -591,8 +656,9 @@ public boolean isBinary() {
*
* @return Boolean if this key is a string key
*/
- public boolean isString() {
- return Elektra.INSTANCE.keyIsString(get()) == 1;
+ public boolean isString ()
+ {
+ return Elektra.INSTANCE.keyIsString (get ()) == 1;
}
/**
@@ -600,8 +666,9 @@ public boolean isString() {
*
* @return Key name as String
*/
- public String getName() {
- return Elektra.INSTANCE.keyName(key);
+ public String getName ()
+ {
+ return Elektra.INSTANCE.keyName (key);
}
/**
@@ -609,8 +676,9 @@ public String getName() {
*
* @return Length of key name
*/
- public int getNameSize() {
- return Elektra.INSTANCE.keyGetNameSize(get());
+ public int getNameSize ()
+ {
+ return Elektra.INSTANCE.keyGetNameSize (get ());
}
/**
@@ -619,9 +687,11 @@ public int getNameSize() {
* @param name New key name to use
* @throws InvalidNameException TODO #3713 detailed exception description
*/
- public void setName(final String name) throws InvalidNameException {
- if (Elektra.INSTANCE.keySetName(get(), name) == -1) {
- throw new InvalidNameException();
+ public void setName (final String name) throws InvalidNameException
+ {
+ if (Elektra.INSTANCE.keySetName (get (), name) == -1)
+ {
+ throw new InvalidNameException ();
}
}
@@ -630,8 +700,9 @@ public void setName(final String name) throws InvalidNameException {
*
* @return Key base name as String
*/
- public String getBaseName() {
- return Elektra.INSTANCE.keyBaseName(get());
+ public String getBaseName ()
+ {
+ return Elektra.INSTANCE.keyBaseName (get ());
}
/**
@@ -639,8 +710,9 @@ public String getBaseName() {
*
* @return Length of key base name
*/
- public int getBaseNameSize() {
- return Elektra.INSTANCE.keyGetBaseNameSize(get());
+ public int getBaseNameSize ()
+ {
+ return Elektra.INSTANCE.keyGetBaseNameSize (get ());
}
/**
@@ -650,9 +722,11 @@ public int getBaseNameSize() {
* @param baseName New key base name to use
* @throws InvalidNameException TODO #3713 detailed exception description
*/
- public void setBaseName(final String baseName) throws InvalidNameException {
- if (Elektra.INSTANCE.keySetBaseName(get(), baseName) == -1) {
- throw new InvalidNameException();
+ public void setBaseName (final String baseName) throws InvalidNameException
+ {
+ if (Elektra.INSTANCE.keySetBaseName (get (), baseName) == -1)
+ {
+ throw new InvalidNameException ();
}
}
@@ -663,9 +737,11 @@ public void setBaseName(final String baseName) throws InvalidNameException {
* @param baseName New key base name to add
* @throws InvalidNameException TODO #3713 detailed exception description
*/
- public void addBaseName(final String baseName) throws InvalidNameException {
- if (Elektra.INSTANCE.keyAddBaseName(get(), baseName) == -1) {
- throw new InvalidNameException();
+ public void addBaseName (final String baseName) throws InvalidNameException
+ {
+ if (Elektra.INSTANCE.keyAddBaseName (get (), baseName) == -1)
+ {
+ throw new InvalidNameException ();
}
}
@@ -674,8 +750,9 @@ public void addBaseName(final String baseName) throws InvalidNameException {
*
* @return Length of key value
*/
- public int getValueSize() {
- return Elektra.INSTANCE.keyGetValueSize(get());
+ public int getValueSize ()
+ {
+ return Elektra.INSTANCE.keyGetValueSize (get ());
}
/**
@@ -684,11 +761,13 @@ public int getValueSize() {
* @return Key value in String format
* @throws TypeMismatchException TODO #3713 detailed exception description
*/
- public String getString() throws TypeMismatchException {
- if (isBinary()) {
- throw new TypeMismatchException();
+ public String getString () throws TypeMismatchException
+ {
+ if (isBinary ())
+ {
+ throw new TypeMismatchException ();
}
- return Elektra.INSTANCE.keyString(key);
+ return Elektra.INSTANCE.keyString (key);
}
/**
@@ -698,8 +777,9 @@ public String getString() throws TypeMismatchException {
* @return value > 0 representing saved bytes (+null byte), -1 in case of an
* error (null key)
*/
- public int setString(final String newString) {
- return Elektra.INSTANCE.keySetString(get(), newString);
+ public int setString (final String newString)
+ {
+ return Elektra.INSTANCE.keySetString (get (), newString);
}
/**
@@ -707,7 +787,8 @@ public int setString(final String newString) {
*
* @return Native pointer object for this key
*/
- public Pointer get() {
+ public Pointer get ()
+ {
return key;
}
}
diff --git a/src/bindings/jna/libelektra/src/main/java/org/libelektra/plugin/PropertiesStorage.java b/src/bindings/jna/libelektra/src/main/java/org/libelektra/plugin/PropertiesStorage.java
index 5afccc3b40e..4d7854a3d6e 100644
--- a/src/bindings/jna/libelektra/src/main/java/org/libelektra/plugin/PropertiesStorage.java
+++ b/src/bindings/jna/libelektra/src/main/java/org/libelektra/plugin/PropertiesStorage.java
@@ -9,7 +9,6 @@
import java.io.IOException;
import java.util.Map;
import java.util.Properties;
-
import org.libelektra.Key;
import org.libelektra.KeySet;
import org.libelektra.Plugin;
diff --git a/src/bindings/jna/libelektra/src/test/java/org/libelektra/GOptsTest.java b/src/bindings/jna/libelektra/src/test/java/org/libelektra/GOptsTest.java
index 58a3fbb4b3d..d98705e6f6f 100644
--- a/src/bindings/jna/libelektra/src/test/java/org/libelektra/GOptsTest.java
+++ b/src/bindings/jna/libelektra/src/test/java/org/libelektra/GOptsTest.java
@@ -9,83 +9,87 @@
import org.junit.Test;
import org.libelektra.exception.KDBException;
-public class GOptsTest {
+public class GOptsTest
+{
private static final String BASE_KEY = "/tests/java/gopts";
private static final String SPEC_BASE_KEY = "spec:" + BASE_KEY;
- @Before
- public void setupSpec() throws KDBException {
- KeySet spec = KeySet.create(10, Key.create(SPEC_BASE_KEY, KEY_META, "command", ""),
- Key.create(SPEC_BASE_KEY + "/printversion", KEY_META, "description",
- "print version information and exit (ignoring all other options/commands/parameters)", KEY_META,
- "opt", "v", KEY_META, "opt/arg", "none", KEY_META, "opt/long", "version"),
- Key.create(SPEC_BASE_KEY + "/getter", KEY_META, "description", "get a key's value", KEY_META, "command",
- "get"),
- Key.create(SPEC_BASE_KEY + "/getter/verbose", KEY_META, "description",
- "print additional information about where the value comes from", KEY_META, "opt", "v", KEY_META,
- "opt/long", "verbose", KEY_META, "opt/arg", "none"),
- Key.create(SPEC_BASE_KEY + "/getter/keyname", KEY_META, "description", "name of the key to read",
- KEY_META, "args", "indexed", KEY_META, "args/index", "0"),
- Key.create(SPEC_BASE_KEY + "/setter", KEY_META, "description", "set a key's value", KEY_META, "command",
- "set"),
- Key.create(SPEC_BASE_KEY + "/setter/verbose", KEY_META, "description",
- "print additional information about where the value will be stored", KEY_META, "opt", "v",
- KEY_META, "opt/long", "verbose", KEY_META, "opt/arg", "none"),
- Key.create(SPEC_BASE_KEY + "/setter/keyname", KEY_META, "description", "name of the key to write",
- KEY_META, "args", "indexed", KEY_META, "args/index", "0"),
- Key.create(SPEC_BASE_KEY + "/setter/value", KEY_META, "description", "value to be written", KEY_META,
- "args", "indexed", KEY_META, "args/index", "1"),
- Key.create(SPEC_BASE_KEY + "/dynamic/#", KEY_META, "description",
- "dynamically call a user-supplied command", KEY_META, "args", "remaining"));
+ @Before public void setupSpec () throws KDBException
+ {
+ KeySet spec = KeySet.create (
+ 10, Key.create (SPEC_BASE_KEY, KEY_META, "command", ""),
+ Key.create (SPEC_BASE_KEY + "/printversion", KEY_META, "description",
+ "print version information and exit (ignoring all other options/commands/parameters)", KEY_META, "opt",
+ "v", KEY_META, "opt/arg", "none", KEY_META, "opt/long", "version"),
+ Key.create (SPEC_BASE_KEY + "/getter", KEY_META, "description", "get a key's value", KEY_META, "command", "get"),
+ Key.create (SPEC_BASE_KEY + "/getter/verbose", KEY_META, "description",
+ "print additional information about where the value comes from", KEY_META, "opt", "v", KEY_META,
+ "opt/long", "verbose", KEY_META, "opt/arg", "none"),
+ Key.create (SPEC_BASE_KEY + "/getter/keyname", KEY_META, "description", "name of the key to read", KEY_META, "args",
+ "indexed", KEY_META, "args/index", "0"),
+ Key.create (SPEC_BASE_KEY + "/setter", KEY_META, "description", "set a key's value", KEY_META, "command", "set"),
+ Key.create (SPEC_BASE_KEY + "/setter/verbose", KEY_META, "description",
+ "print additional information about where the value will be stored", KEY_META, "opt", "v", KEY_META,
+ "opt/long", "verbose", KEY_META, "opt/arg", "none"),
+ Key.create (SPEC_BASE_KEY + "/setter/keyname", KEY_META, "description", "name of the key to write", KEY_META,
+ "args", "indexed", KEY_META, "args/index", "0"),
+ Key.create (SPEC_BASE_KEY + "/setter/value", KEY_META, "description", "value to be written", KEY_META, "args",
+ "indexed", KEY_META, "args/index", "1"),
+ Key.create (SPEC_BASE_KEY + "/dynamic/#", KEY_META, "description", "dynamically call a user-supplied command",
+ KEY_META, "args", "remaining"));
- Key specParent = Key.create(SPEC_BASE_KEY);
- try (final KDB kdb = KDB.open(specParent)) {
- final KeySet ks = KeySet.create(10);
- kdb.get(ks, specParent);
+ Key specParent = Key.create (SPEC_BASE_KEY);
+ try (final KDB kdb = KDB.open (specParent))
+ {
+ final KeySet ks = KeySet.create (10);
+ kdb.get (ks, specParent);
- if (ks.cut(specParent).length() > 0) {
- throw new IllegalStateException("Couldn't set up spec, keys exist!");
+ if (ks.cut (specParent).length () > 0)
+ {
+ throw new IllegalStateException ("Couldn't set up spec, keys exist!");
}
- ks.append(spec);
- kdb.set(ks, specParent);
+ ks.append (spec);
+ kdb.set (ks, specParent);
}
}
- @Test
- public void test_gopts() throws KDBException {
+ @Test public void test_gopts () throws KDBException
+ {
String[] args = new String[] { "test", "get", "-v", "user:/" };
String[] env = new String[0];
- KeySet config = KeySet.create(10);
- KeySet contract = KeySet.create(10);
+ KeySet config = KeySet.create (10);
+ KeySet contract = KeySet.create (10);
- Key parentKey = Key.create(BASE_KEY);
- KDB.goptsContract(contract, args, env, parentKey, config);
+ Key parentKey = Key.create (BASE_KEY);
+ KDB.goptsContract (contract, args, env, parentKey, config);
- try (final KDB kdb = KDB.open(contract, parentKey)) {
- KeySet ks = KeySet.create(10);
+ try (final KDB kdb = KDB.open (contract, parentKey))
+ {
+ KeySet ks = KeySet.create (10);
- kdb.get(ks, parentKey);
+ kdb.get (ks, parentKey);
- assertFalse(ks.lookup(BASE_KEY).isNull());
- assertEquals(ks.lookup(BASE_KEY).getString(), "getter");
- assertFalse(ks.lookup(BASE_KEY + "/getter/keyname").isNull());
- assertEquals(ks.lookup(BASE_KEY + "/getter/keyname").getString(), "user:/");
- assertFalse(ks.lookup(BASE_KEY + "/getter/verbose").isNull());
- assertEquals(ks.lookup(BASE_KEY + "/getter/verbose").getString(), "1");
+ assertFalse (ks.lookup (BASE_KEY).isNull ());
+ assertEquals (ks.lookup (BASE_KEY).getString (), "getter");
+ assertFalse (ks.lookup (BASE_KEY + "/getter/keyname").isNull ());
+ assertEquals (ks.lookup (BASE_KEY + "/getter/keyname").getString (), "user:/");
+ assertFalse (ks.lookup (BASE_KEY + "/getter/verbose").isNull ());
+ assertEquals (ks.lookup (BASE_KEY + "/getter/verbose").getString (), "1");
}
}
- @After
- public void removeSpec() throws KDBException {
- Key specParent = Key.create(SPEC_BASE_KEY);
- try (final KDB kdb = KDB.open(specParent)) {
- final KeySet ks = KeySet.create(10);
- kdb.get(ks, specParent);
- ks.cut(specParent);
- kdb.set(ks, specParent);
+ @After public void removeSpec () throws KDBException
+ {
+ Key specParent = Key.create (SPEC_BASE_KEY);
+ try (final KDB kdb = KDB.open (specParent))
+ {
+ final KeySet ks = KeySet.create (10);
+ kdb.get (ks, specParent);
+ ks.cut (specParent);
+ kdb.set (ks, specParent);
}
}
}