Skip to content

Commit 944b26d

Browse files
committed
chore: remove redundant final modifiers in try-with-resources and suppress Checkstyle warning
1 parent 5e03e80 commit 944b26d

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

imgui-app/src/main/java/imgui/app/WindowSdl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ protected void runFrame() {
146146
if (commandBuffer != 0L) {
147147
imGuiSdlGpu3.prepareDrawData(ImGui.getDrawData().ptr, commandBuffer);
148148

149-
try (final MemoryStack stack = MemoryStack.stackPush()) {
149+
try (MemoryStack stack = MemoryStack.stackPush()) {
150150
final PointerBuffer pSwapchain = stack.callocPointer(1);
151151
final IntBuffer pW = stack.mallocInt(1);
152152
final IntBuffer pH = stack.mallocInt(1);

imgui-lwjgl3/src/main/java/imgui/sdl3/ImGuiImplSdl3.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@
247247
* {@code ImGuiPlatformIO} are not ported — they require C function pointers (see
248248
* {@code // NOTE: not ported} markers below). Single-viewport mode covers the visual smoke test.
249249
*/
250+
@SuppressWarnings("checkstyle:DesignForExtension")
250251
public class ImGuiImplSdl3 {
251252
/**
252253
* Manual gamepad list mode: {@link #setGamepadMode(int, long[])} accepts gamepad handles directly.

imgui-lwjgl3/src/main/java/imgui/sdl3/ImGuiImplSdlGpu3.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ private void ensureIndexBuffer(final long device, final int sizeNeeded) {
585585
if (indexTransferBuffer != 0L) {
586586
SDL_ReleaseGPUTransferBuffer(device, indexTransferBuffer);
587587
}
588-
try (final MemoryStack stack = MemoryStack.stackPush()) {
588+
try (MemoryStack stack = MemoryStack.stackPush()) {
589589
indexBuffer = SDL_CreateGPUBuffer(device, SDL_GPUBufferCreateInfo.calloc(stack)
590590
.usage(SDL_GPU_BUFFERUSAGE_INDEX)
591591
.size(newSize)
@@ -619,7 +619,7 @@ public final void renderDrawData(final long drawDataPtr, final long commandBuffe
619619

620620
final long usePipeline = pipelineOverride != 0L ? pipelineOverride : pipeline;
621621

622-
try (final MemoryStack stack = MemoryStack.stackPush()) {
622+
try (MemoryStack stack = MemoryStack.stackPush()) {
623623
// Viewport
624624
final SDL_GPUViewport viewport = SDL_GPUViewport.calloc(stack)
625625
.x(0.0f).y(0.0f).w(fbWidth).h(fbHeight).min_depth(0.0f).max_depth(1.0f);

imgui-lwjgl3/src/main/java/imgui/sdl3/ImGuiImplSdlGpu3Shaders.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ private ImGuiImplSdlGpu3Shaders() {
4646

4747
private static byte[] load(final String name) {
4848
final String resource = "/imgui/sdl3/shaders/" + name;
49-
try (final InputStream in = ImGuiImplSdlGpu3Shaders.class.getResourceAsStream(resource)) {
49+
try (InputStream in = ImGuiImplSdlGpu3Shaders.class.getResourceAsStream(resource)) {
5050
if (in == null) {
5151
throw new IllegalStateException("Missing classpath resource: " + resource);
5252
}
53-
try (final ByteArrayOutputStream buf = new ByteArrayOutputStream()) {
53+
try (ByteArrayOutputStream buf = new ByteArrayOutputStream()) {
5454
final byte[] chunk = new byte[4096];
5555
int n;
5656
while ((n = in.read(chunk)) > 0) {

0 commit comments

Comments
 (0)