Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/main/java/com/cryptlex/lexactivator/LexActivator.java
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,24 @@
}
}

/**
* Gets the error code that caused the activation data to be cleared.
*
* @return Returns the error code that caused the activation data to be cleared.
* @throws LexActivatorException
*/
public static int GetLastActivationError() throws LexActivatorException {

Check warning on line 1387 in src/main/java/com/cryptlex/lexactivator/LexActivator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=cryptlex_lexactivator-java&issues=AZsHJORinByX-KFmj4rk&open=AZsHJORinByX-KFmj4rk&pullRequest=48
int status;
IntByReference errorCode = new IntByReference(0);
status = LexActivatorNative.GetLastActivationError(errorCode);
switch (status) {

Check warning on line 1391 in src/main/java/com/cryptlex/lexactivator/LexActivator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace this "switch" statement by "if" statements to increase readability.

See more on https://sonarcloud.io/project/issues?id=cryptlex_lexactivator-java&issues=AZsHJORinByX-KFmj4rl&open=AZsHJORinByX-KFmj4rl&pullRequest=48
case LA_OK:
return errorCode.getValue();
default:
throw new LexActivatorException(status);
}
}

/**
* Gets the trial activation metadata.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@

public static native int GetServerSyncGracePeriodExpiryDate(IntByReference expiryDate);

public static native int GetLastActivationError(IntByReference errorCode);

Check warning on line 224 in src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=cryptlex_lexactivator-java&issues=AZsHJOPAnByX-KFmj4rj&open=AZsHJOPAnByX-KFmj4rj&pullRequest=48

public static native int GetTrialActivationMetadata(String key, ByteBuffer value, int length);

public static native int GetTrialActivationMetadata(WString key, CharBuffer value, int length);
Expand Down