Skip to content

Commit 75a993c

Browse files
committed
minor: Move 'AnalysisContext#increaseRefCounter' in the valid section
1 parent 3c08fae commit 75a993c

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

langkit/templates/java_api/main_class.mako

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3069,6 +3069,26 @@ public final class ${ctx.lib_name.camel} {
30693069
return this.eventHandler;
30703070
}
30713071

3072+
// ----- Class methods -----
3073+
3074+
/**
3075+
* Increase the reference counter of the given context.
3076+
*
3077+
* @param context The context to increase the reference counter of.
3078+
*/
3079+
private static void increaseRefCounter(
3080+
final AnalysisContext context
3081+
) {
3082+
// Increase the context reference counter of the context if not null
3083+
if(!context.reference.isNull()) {
3084+
if(ImageInfo.inImageCode()) {
3085+
NI_LIB.${nat("context_incref")}(context.reference.ni());
3086+
} else {
3087+
JNI_LIB.${nat("context_incref")}(context.reference.jni());
3088+
}
3089+
}
3090+
}
3091+
30723092
// ----- Instance methods -----
30733093

30743094
/**
@@ -3258,24 +3278,6 @@ public final class ${ctx.lib_name.camel} {
32583278
}
32593279
% endif
32603280

3261-
/**
3262-
* Increase the reference counter of the given context.
3263-
*
3264-
* @param context The context to increase the reference counter of.
3265-
*/
3266-
private static void increaseRefCounter(
3267-
final AnalysisContext context
3268-
) {
3269-
// Increase the context reference counter of the context if not null
3270-
if(!context.reference.isNull()) {
3271-
if(ImageInfo.inImageCode()) {
3272-
NI_LIB.${nat("context_incref")}(context.reference.ni());
3273-
} else {
3274-
JNI_LIB.${nat("context_incref")}(context.reference.jni());
3275-
}
3276-
}
3277-
}
3278-
32793281
/** @see java.lang.AutoCloseable#close() */
32803282
@Override
32813283
public void close() {

0 commit comments

Comments
 (0)