From d67f88254b5d520a7388ce773f6b5013c42d4317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 5 Nov 2023 18:24:31 +0100 Subject: [PATCH] checkstyle fix --- src/com/jpexs/decompiler/flash/gui/View.java | 8 ++++---- .../decompiler/flash/gui/abc/DecompiledEditorPane.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/View.java b/src/com/jpexs/decompiler/flash/gui/View.java index ff8430737..18a8e455a 100644 --- a/src/com/jpexs/decompiler/flash/gui/View.java +++ b/src/com/jpexs/decompiler/flash/gui/View.java @@ -811,7 +811,7 @@ public class View { */ public static int textComponentViewToModel(JTextComponent editor, Point2D pt) { try { - return (int)(Integer)JTextComponent.class.getDeclaredMethod("viewToModel2D", Point2D.class).invoke(editor, pt); + return (int) (Integer) JTextComponent.class.getDeclaredMethod("viewToModel2D", Point2D.class).invoke(editor, pt); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | InvocationTargetException ex) { //method does not exist, we must be on Java8 } @@ -819,7 +819,7 @@ public class View { //Try older method Point p = new Point((int) Math.round(pt.getX()), (int) Math.round(pt.getY())); try { - return (int)(Integer)JTextComponent.class.getDeclaredMethod("viewToModel", Point.class).invoke(editor, p); + return (int) (Integer) JTextComponent.class.getDeclaredMethod("viewToModel", Point.class).invoke(editor, p); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | InvocationTargetException ex) { Logger.getLogger(View.class.getName()).log(Level.SEVERE, null, ex); return 0; @@ -846,14 +846,14 @@ public class View { */ public static Rectangle2D textComponentModelToView(JTextComponent editor, int pos) throws BadLocationException { try { - return (Rectangle2D)JTextComponent.class.getDeclaredMethod("modelToView2D", int.class).invoke(editor, pos); + return (Rectangle2D) JTextComponent.class.getDeclaredMethod("modelToView2D", int.class).invoke(editor, pos); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | InvocationTargetException ex) { //method does not exist, we must be on Java8 } //Try older method try { - return (Rectangle)JTextComponent.class.getDeclaredMethod("modelToView", int.class).invoke(editor, pos); + return (Rectangle) JTextComponent.class.getDeclaredMethod("modelToView", int.class).invoke(editor, pos); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | InvocationTargetException ex) { Logger.getLogger(View.class.getName()).log(Level.SEVERE, null, ex); return null; diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index bdb6e198f..80e4a488d 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -1039,7 +1039,7 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL } final Point point = new Point(e.getX(), e.getY()); - final int pos = View.textComponentViewToModel(abcPanel.decompiledTextArea,point); + final int pos = View.textComponentViewToModel(abcPanel.decompiledTextArea, point); final String identifier = abcPanel.getMainPanel().getActionPanel().getStringUnderPosition(pos, abcPanel.decompiledTextArea); if (identifier != null && !identifier.isEmpty()) {