Skip to content

Commit

Permalink
ElektraInitiative#3713 updated release notes and renamed KeyException…
Browse files Browse the repository at this point in the history
… specializations
  • Loading branch information
Michael Tucek authored and a-kraschitzer committed Apr 14, 2021
1 parent ea170a2 commit f617fca
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 deletions.
18 changes: 13 additions & 5 deletions doc/news/_preparation_next_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,22 @@ you up to date with the multi-language support provided by Elektra.
- `KeySet::getCursor`
- `KeySet::setCursor`
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)_
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`. _(Michael 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)_
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`. _(Michael 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)_
- Renamed `KeyException` specializations: `KeyInvalidNameException`, `KeyTypeConversionException`, `KeyTypeMismatchException`
- Ongoing work on bringing the JNA binding up to scratch and improving developer experience. Both for JNA binding API consumers, as well as future JNA binding contrubutors. _(Michael Tucek)_
- Migration from Maven to Gradle _(Michael Tucek)_
- Updated documentation for usage of published artifacts _(Michael Tucek)_
- Integration of Maven Central publishing on Elektra release _(Robert Sowula)_
### Python + Lua
Expand Down
30 changes: 15 additions & 15 deletions src/bindings/jna/libelektra/src/main/java/org/libelektra/Key.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static class KeyException extends RuntimeException
/**
* Indicates an invalid key name has been used.
*/
public static class InvalidNameException extends KeyException
public static class KeyInvalidNameException extends KeyException
{

private static final long serialVersionUID = -7659317176138893895L;
Expand All @@ -45,7 +45,7 @@ public static class InvalidNameException extends KeyException
/**
* Indicates a key's type conversion failed.
*/
public static class TypeConversionException extends KeyException
public static class KeyTypeConversionException extends KeyException
{

private static final long serialVersionUID = -8648296754188373810L;
Expand All @@ -54,7 +54,7 @@ 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 KeyTypeMismatchException extends KeyException
{

private static final long serialVersionUID = 8035874860117969698L;
Expand Down Expand Up @@ -685,13 +685,13 @@ public int getNameSize ()
* Helper function to set key name
*
* @param name New key name to use
* @throws InvalidNameException TODO #3754 detailed exception description
* @throws KeyInvalidNameException TODO #3754 detailed exception description
*/
public void setName (final String name) throws InvalidNameException
public void setName (final String name) throws KeyInvalidNameException
{
if (Elektra.INSTANCE.keySetName (get (), name) == -1)
{
throw new InvalidNameException ();
throw new KeyInvalidNameException ();
}
}

Expand Down Expand Up @@ -720,13 +720,13 @@ public int getBaseNameSize ()
* base name
*
* @param baseName New key base name to use
* @throws InvalidNameException TODO #3754 detailed exception description
* @throws KeyInvalidNameException TODO #3754 detailed exception description
*/
public void setBaseName (final String baseName) throws InvalidNameException
public void setBaseName (final String baseName) throws KeyInvalidNameException
{
if (Elektra.INSTANCE.keySetBaseName (get (), baseName) == -1)
{
throw new InvalidNameException ();
throw new KeyInvalidNameException ();
}
}

Expand All @@ -735,13 +735,13 @@ public void setBaseName (final String baseName) throws InvalidNameException
* so that new key is sub key of current key
*
* @param baseName New key base name to add
* @throws InvalidNameException TODO #3754 detailed exception description
* @throws KeyInvalidNameException TODO #3754 detailed exception description
*/
public void addBaseName (final String baseName) throws InvalidNameException
public void addBaseName (final String baseName) throws KeyInvalidNameException
{
if (Elektra.INSTANCE.keyAddBaseName (get (), baseName) == -1)
{
throw new InvalidNameException ();
throw new KeyInvalidNameException ();
}
}

Expand All @@ -759,13 +759,13 @@ public int getValueSize ()
* Helper function to get representation of key value
*
* @return Key value in String format
* @throws TypeMismatchException TODO #3754 detailed exception description
* @throws KeyTypeMismatchException TODO #3754 detailed exception description
*/
public String getString () throws TypeMismatchException
public String getString () throws KeyTypeMismatchException
{
if (isBinary ())
{
throw new TypeMismatchException ();
throw new KeyTypeMismatchException ();
}
return Elektra.INSTANCE.keyString (key);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import java.util.Iterator;
import org.junit.Test;
import org.libelektra.Key.InvalidNameException;
import org.libelektra.Key.KeyInvalidNameException;

public class KeyTest
{
Expand Down Expand Up @@ -265,7 +265,7 @@ public class KeyTest
assertEquals (new_keyname, key.getName ());
}

@Test (expected = InvalidNameException.class) public void test_keySetName_shouldFail ()
@Test (expected = KeyInvalidNameException.class) public void test_keySetName_shouldFail ()
{
final String new_keyname = "some_random/test/stuff_or/whatever"; // initial slash missing
final Key key = Key.create (KEY_1_NAME, KEY_1_VALUE);
Expand Down

0 comments on commit f617fca

Please sign in to comment.