From e20dc26baeb0b88b4aecf7e10d042aea23937aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Tue, 9 Apr 2024 15:03:16 +0200 Subject: [PATCH] *Bundle: use delegation --- .../java/com/yanncebron/m68kplugin/M68kApiBundle.java | 9 ++++----- .../com/yanncebron/m68kplugin/amiga/M68kAmigaBundle.java | 9 ++++----- src/com/yanncebron/m68kplugin/M68kBundle.java | 9 ++++----- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/api/plugin-api/src/main/java/com/yanncebron/m68kplugin/M68kApiBundle.java b/api/plugin-api/src/main/java/com/yanncebron/m68kplugin/M68kApiBundle.java index 747d8e2e..9385022b 100644 --- a/api/plugin-api/src/main/java/com/yanncebron/m68kplugin/M68kApiBundle.java +++ b/api/plugin-api/src/main/java/com/yanncebron/m68kplugin/M68kApiBundle.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Authors + * Copyright 2024 The Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,22 +16,21 @@ package com.yanncebron.m68kplugin; -import com.intellij.AbstractBundle; +import com.intellij.DynamicBundle; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.util.function.Supplier; -public class M68kApiBundle extends AbstractBundle { +public final class M68kApiBundle { @NonNls private static final String PATH_TO_BUNDLE = "messages.M68kApiBundle"; - private static final M68kApiBundle INSTANCE = new M68kApiBundle(); + private static final DynamicBundle INSTANCE = new DynamicBundle(M68kApiBundle.class, PATH_TO_BUNDLE); private M68kApiBundle() { - super(PATH_TO_BUNDLE); } public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object @NotNull ... params) { diff --git a/platforms/amiga/src/main/java/com/yanncebron/m68kplugin/amiga/M68kAmigaBundle.java b/platforms/amiga/src/main/java/com/yanncebron/m68kplugin/amiga/M68kAmigaBundle.java index 496b6eb2..d8d1b18c 100644 --- a/platforms/amiga/src/main/java/com/yanncebron/m68kplugin/amiga/M68kAmigaBundle.java +++ b/platforms/amiga/src/main/java/com/yanncebron/m68kplugin/amiga/M68kAmigaBundle.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Authors + * Copyright 2024 The Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,22 +16,21 @@ package com.yanncebron.m68kplugin.amiga; -import com.intellij.AbstractBundle; +import com.intellij.DynamicBundle; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.util.function.Supplier; -public class M68kAmigaBundle extends AbstractBundle { +public final class M68kAmigaBundle { @NonNls private static final String PATH_TO_BUNDLE = "messages.M68kAmigaBundle"; - private static final M68kAmigaBundle INSTANCE = new M68kAmigaBundle(); + private static final DynamicBundle INSTANCE = new DynamicBundle(M68kAmigaBundle.class, PATH_TO_BUNDLE); private M68kAmigaBundle() { - super(PATH_TO_BUNDLE); } public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object @NotNull ... params) { diff --git a/src/com/yanncebron/m68kplugin/M68kBundle.java b/src/com/yanncebron/m68kplugin/M68kBundle.java index d97cc90e..501a392a 100644 --- a/src/com/yanncebron/m68kplugin/M68kBundle.java +++ b/src/com/yanncebron/m68kplugin/M68kBundle.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Authors + * Copyright 2024 The Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,22 +16,21 @@ package com.yanncebron.m68kplugin; -import com.intellij.AbstractBundle; +import com.intellij.DynamicBundle; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.PropertyKey; import java.util.function.Supplier; -public class M68kBundle extends AbstractBundle { +public final class M68kBundle { @NonNls private static final String PATH_TO_BUNDLE = "messages.M68kBundle"; - private static final M68kBundle INSTANCE = new M68kBundle(); + private static final DynamicBundle INSTANCE = new DynamicBundle(M68kBundle.class, PATH_TO_BUNDLE); private M68kBundle() { - super(PATH_TO_BUNDLE); } public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, Object @NotNull ... params) {