Skip to content

Commit

Permalink
Add a comment about the need for compat
Browse files Browse the repository at this point in the history
Co-Authored-By: Sören Reichardt <[email protected]>
  • Loading branch information
knutwalker and soerenreichardt committed Aug 29, 2024
1 parent 1208bb5 commit 260d013
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ Estimates knownEstimates(
long numberOfNodeLabels
);

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
@CompatSince(minor = 24)
void rethrowUnlessDuplicateRegistration(ProcedureException e) throws KernelException;

Expand All @@ -111,18 +117,48 @@ Estimates knownEstimates(
@CompatSince(minor = 24)
int sequenceSizeAsInt(SequenceValue sequenceValue);

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
@CompatSince(minor = 24)
RuntimeException queryExceptionAsRuntimeException(Throwable e);

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
@CompatSince(minor = 24)
ProcedureException procedureCallFailed(@PrintFormat String message, Object... args);

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
@CompatSince(minor = 24)
ProcedureException procedureCallFailed(Throwable reason, @PrintFormat String message, Object... args);

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
@CompatSince(minor = 24)
String exceptionMessage(Throwable e);

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
@CompatSince(minor = 24)
DatabaseNotFoundException databaseNotFoundException(String message);
}
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,32 @@ public static int sequenceSizeAsInt(SequenceValue listValue) {
return IMPL.sequenceSizeAsInt(listValue);
}

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
public static RuntimeException queryExceptionAsRuntimeException(Throwable e) {
return IMPL.queryExceptionAsRuntimeException(e);
}

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
public static ProcedureException procedureCallFailed(@PrintFormat String message, Object... args) {
return IMPL.procedureCallFailed(message, args);
}

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
public static ProcedureException procedureCallFailed(
Throwable reason,
@PrintFormat String message,
Expand All @@ -559,10 +577,22 @@ public static ProcedureException procedureCallFailed(
return IMPL.procedureCallFailed(reason, message, args);
}

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
public static DatabaseNotFoundException databaseNotFoundException(String message) {
return IMPL.databaseNotFoundException(message);
}

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
public static String exceptionMessage(Throwable e) {
return IMPL.exceptionMessage(e);
}
Expand Down Expand Up @@ -604,6 +634,12 @@ public static void registerCloseableResource(
transaction.resourceMonitor().registerCloseableResource(autoCloseable);
}

/**
* The implementations of this method should look identical and are source-compatible.
* However, Since 5.24, Neo4j exceptions implement `HasGqlStatusInfo`, which requires
* a new module dependency that doesn't exist in versions before 5.24.
* In order to access any methods on exceptions, we need to do so behind the compat layer.
*/
static void rethrowUnlessDuplicateRegistration(ProcedureException e) throws KernelException {
IMPL.rethrowUnlessDuplicateRegistration(e);
}
Expand Down

0 comments on commit 260d013

Please sign in to comment.