You can subscribe to this list here.
2000 |
Jan
(11) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(8) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(145) |
Nov
(352) |
Dec
(329) |
2002 |
Jan
(461) |
Feb
(533) |
Mar
(632) |
Apr
(363) |
May
(619) |
Jun
(324) |
Jul
(109) |
Aug
(247) |
Sep
(167) |
Oct
(215) |
Nov
(115) |
Dec
(262) |
2003 |
Jan
(568) |
Feb
(537) |
Mar
(760) |
Apr
(493) |
May
(500) |
Jun
(284) |
Jul
(178) |
Aug
(180) |
Sep
(135) |
Oct
(230) |
Nov
(266) |
Dec
(175) |
2004 |
Jan
(121) |
Feb
(294) |
Mar
(222) |
Apr
(172) |
May
(162) |
Jun
(105) |
Jul
(93) |
Aug
(151) |
Sep
(136) |
Oct
(62) |
Nov
(74) |
Dec
(178) |
2005 |
Jan
(179) |
Feb
(288) |
Mar
(153) |
Apr
(138) |
May
(195) |
Jun
(39) |
Jul
(62) |
Aug
(41) |
Sep
(15) |
Oct
(365) |
Nov
(130) |
Dec
(199) |
2006 |
Jan
(235) |
Feb
(92) |
Mar
(262) |
Apr
(250) |
May
(345) |
Jun
(513) |
Jul
(587) |
Aug
(210) |
Sep
(216) |
Oct
(200) |
Nov
(188) |
Dec
(115) |
2007 |
Jan
(259) |
Feb
(182) |
Mar
(217) |
Apr
(109) |
May
(161) |
Jun
(205) |
Jul
(291) |
Aug
(176) |
Sep
(185) |
Oct
(190) |
Nov
(208) |
Dec
(182) |
2008 |
Jan
(141) |
Feb
(193) |
Mar
(219) |
Apr
(112) |
May
(233) |
Jun
(218) |
Jul
(149) |
Aug
(338) |
Sep
(291) |
Oct
(143) |
Nov
(131) |
Dec
(152) |
2009 |
Jan
(266) |
Feb
(178) |
Mar
(168) |
Apr
(167) |
May
(198) |
Jun
(282) |
Jul
(383) |
Aug
(341) |
Sep
(153) |
Oct
(214) |
Nov
(164) |
Dec
(278) |
2010 |
Jan
(430) |
Feb
(300) |
Mar
(214) |
Apr
(198) |
May
(271) |
Jun
(321) |
Jul
(144) |
Aug
(208) |
Sep
(275) |
Oct
(287) |
Nov
(218) |
Dec
(153) |
2011 |
Jan
(172) |
Feb
(172) |
Mar
(121) |
Apr
(62) |
May
(23) |
Jun
(155) |
Jul
(120) |
Aug
(252) |
Sep
(170) |
Oct
(206) |
Nov
(356) |
Dec
(300) |
2012 |
Jan
(412) |
Feb
(313) |
Mar
(419) |
Apr
(153) |
May
(194) |
Jun
(226) |
Jul
(115) |
Aug
(143) |
Sep
(223) |
Oct
(173) |
Nov
(121) |
Dec
(143) |
2013 |
Jan
(156) |
Feb
(109) |
Mar
(146) |
Apr
(82) |
May
(65) |
Jun
(52) |
Jul
(55) |
Aug
(347) |
Sep
(65) |
Oct
(95) |
Nov
(85) |
Dec
(37) |
2014 |
Jan
(12) |
Feb
(51) |
Mar
(31) |
Apr
(97) |
May
(60) |
Jun
(32) |
Jul
(35) |
Aug
(47) |
Sep
(16) |
Oct
(36) |
Nov
(55) |
Dec
(90) |
2015 |
Jan
(34) |
Feb
(65) |
Mar
(13) |
Apr
(13) |
May
(49) |
Jun
(10) |
Jul
(23) |
Aug
(96) |
Sep
(78) |
Oct
(38) |
Nov
(41) |
Dec
(126) |
2016 |
Jan
(29) |
Feb
(38) |
Mar
(21) |
Apr
(12) |
May
(45) |
Jun
(53) |
Jul
(40) |
Aug
(69) |
Sep
(60) |
Oct
(11) |
Nov
(19) |
Dec
(2) |
2017 |
Jan
(28) |
Feb
(17) |
Mar
(57) |
Apr
(4) |
May
(15) |
Jun
(60) |
Jul
(21) |
Aug
(5) |
Sep
(6) |
Oct
(34) |
Nov
(17) |
Dec
(28) |
2018 |
Jan
(15) |
Feb
(7) |
Mar
(13) |
Apr
(7) |
May
(2) |
Jun
(6) |
Jul
(10) |
Aug
(15) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
2019 |
Jan
(2) |
Feb
(2) |
Mar
(9) |
Apr
(5) |
May
|
Jun
(6) |
Jul
(4) |
Aug
(35) |
Sep
(1) |
Oct
(6) |
Nov
(1) |
Dec
(18) |
2020 |
Jan
(1) |
Feb
|
Mar
(141) |
Apr
(196) |
May
(41) |
Jun
(3) |
Jul
(4) |
Aug
(3) |
Sep
(27) |
Oct
(2) |
Nov
(4) |
Dec
(25) |
2021 |
Jan
(8) |
Feb
(1) |
Mar
(46) |
Apr
(48) |
May
|
Jun
(9) |
Jul
(1) |
Aug
|
Sep
(5) |
Oct
(3) |
Nov
(10) |
Dec
(7) |
2022 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
(24) |
Jul
(7) |
Aug
(7) |
Sep
(13) |
Oct
(7) |
Nov
(1) |
Dec
(2) |
2023 |
Jan
(11) |
Feb
(4) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(13) |
Sep
(32) |
Oct
(10) |
Nov
(6) |
Dec
|
2024 |
Jan
|
Feb
(8) |
Mar
(4) |
Apr
(3) |
May
(22) |
Jun
|
Jul
(11) |
Aug
(8) |
Sep
|
Oct
(9) |
Nov
|
Dec
|
2025 |
Jan
|
Feb
(2) |
Mar
(16) |
Apr
(5) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <vam...@us...> - 2023-10-13 20:06:53
|
Revision: 25693 http://sourceforge.net/p/jedit/svn/25693 Author: vampire0 Date: 2023-10-13 20:06:50 +0000 (Fri, 13 Oct 2023) Log Message: ----------- Fix unchecked and deprecated compiler warnings Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/browser/VFSBrowser.java jEdit/trunk/org/gjt/sp/jedit/gui/BufferSwitcher.java jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/EncodingWidgetFactory.java jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/FoldWidgetFactory.java jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/ModeWidgetFactory.java jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/WrapWidgetFactory.java jEdit/trunk/org/gjt/sp/jedit/pluginmgr/PluginManagerProgress.java jEdit/trunk/org/gjt/sp/jedit/pluginmgr/Roster.java jEdit/trunk/org/gjt/sp/jedit/syntax/ParserRuleSet.java jEdit/trunk/org/gjt/sp/util/StandardUtilities.java Modified: jEdit/trunk/org/gjt/sp/jedit/browser/VFSBrowser.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/browser/VFSBrowser.java 2023-10-13 19:09:34 UTC (rev 25692) +++ jEdit/trunk/org/gjt/sp/jedit/browser/VFSBrowser.java 2023-10-13 20:06:50 UTC (rev 25693) @@ -51,6 +51,8 @@ import org.gjt.sp.jedit.buffer.JEditBuffer; import org.gjt.sp.util.*; import org.gjt.sp.jedit.menu.MenuItemTextComparator; + +import static org.gjt.sp.util.StandardUtilities.castUnchecked; //}}} /** @@ -731,7 +733,7 @@ } final Task task = new DeleteBrowserTask(this, session, vfs, files[i].getDeletePath()); - TaskManager.instance.addTaskListener(new TaskAdapter() + TaskManager.instance.addTaskListener(new TaskListener() { @Override public void done(Task t) @@ -1037,7 +1039,7 @@ return getSelectedFiles(); } } //}}} - + //{{{ paste() method /** * Paste the file contained in the clipboard. @@ -1045,7 +1047,6 @@ * @param file the target, it can be a file, in that case it will be pasted to * the parent directory, or a directory. */ - @SuppressWarnings({"unchecked"}) public void paste(VFSFile file) throws IOException, UnsupportedFlavorException { if (file == null) @@ -1079,7 +1080,7 @@ List<String> sources = new ArrayList<>(); if (transferable.isDataFlavorSupported(ListVFSFileTransferable.jEditFileList)) { - Iterable<VFSFile> copiedFiles = (Iterable<VFSFile>) transferable.getTransferData(ListVFSFileTransferable.jEditFileList); + Iterable<VFSFile> copiedFiles = castUnchecked(transferable.getTransferData(ListVFSFileTransferable.jEditFileList)); for (VFSFile copiedFile : copiedFiles) { sources.add(copiedFile.getPath()); @@ -1087,7 +1088,7 @@ } else if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { - Iterable<File> copiedFiles = (Iterable<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor); + Iterable<File> copiedFiles = castUnchecked(transferable.getTransferData(DataFlavor.javaFileListFlavor)); for (File copiedFile : copiedFiles) { sources.add(copiedFile.getAbsolutePath()); @@ -1797,7 +1798,7 @@ } } } //}}} - + //{{{ Action class class Action extends AbstractAction { @@ -1887,7 +1888,7 @@ @Override void doPopup() - { + { if (popup==null) createPopupMenu(); GenericGUIUtilities.showPopupMenu(popup, this, 0, getHeight(), false); } Modified: jEdit/trunk/org/gjt/sp/jedit/gui/BufferSwitcher.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/BufferSwitcher.java 2023-10-13 19:09:34 UTC (rev 25692) +++ jEdit/trunk/org/gjt/sp/jedit/gui/BufferSwitcher.java 2023-10-13 20:06:50 UTC (rev 25693) @@ -41,6 +41,8 @@ import org.gjt.sp.jedit.bufferset.BufferSetManager; import org.gjt.sp.jedit.msg.PropertiesChanged; import org.gjt.sp.util.ThreadUtilities; + +import static org.gjt.sp.util.StandardUtilities.castUnchecked; //}}} /** BufferSwitcher class @@ -223,7 +225,7 @@ Accessible acc = ui.getAccessibleChild(null, 0); if (acc instanceof BasicComboPopup) { - JList list = ((BasicComboPopup)acc).getList(); + JList<Object> list = ((BasicComboPopup)acc).getList(); list.setDragEnabled(true); list.setDropMode(DropMode.INSERT); list.setTransferHandler(new BufferSwitcherTransferHandler()); @@ -444,7 +446,7 @@ @Override public Transferable createTransferable(JComponent c) { - JList<Buffer> list = (JList<Buffer>) c; + JList<Buffer> list = castUnchecked(c); Buffer buffer = list.getSelectedValue(); if (buffer == null) { Modified: jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/EncodingWidgetFactory.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/EncodingWidgetFactory.java 2023-10-13 19:09:34 UTC (rev 25692) +++ jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/EncodingWidgetFactory.java 2023-10-13 20:06:50 UTC (rev 25693) @@ -38,11 +38,12 @@ import javax.swing.*; import static java.lang.String.CASE_INSENSITIVE_ORDER; +import static org.gjt.sp.util.StandardUtilities.castUnchecked; //}}} /** * @author Matthieu Casanova - * @since jEdit 4.3pre14 + * @since jEdit 4.3pre14 */ public class EncodingWidgetFactory implements StatusWidgetFactory { @@ -73,7 +74,7 @@ currentEncoding, listSelectionEvent -> EventQueue.invokeLater(() -> { - JList<String> list = (JList<String>) listSelectionEvent.getSource(); + JList<String> list = castUnchecked(listSelectionEvent.getSource()); String selectedValue = list.getSelectedValue(); int selectedOption = DialogChooser.openChooserWindow(view, jEdit.getProperty("buffer.encoding.reload", new String[]{selectedValue}), Modified: jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/FoldWidgetFactory.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/FoldWidgetFactory.java 2023-10-13 19:09:34 UTC (rev 25692) +++ jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/FoldWidgetFactory.java 2023-10-13 20:06:50 UTC (rev 25693) @@ -38,11 +38,13 @@ import org.gjt.sp.jedit.msg.BufferUpdate; import javax.swing.*; + +import static org.gjt.sp.util.StandardUtilities.castUnchecked; //}}} /** * @author Matthieu Casanova - * @since jEdit 4.3pre14 + * @since jEdit 4.3pre14 */ public class FoldWidgetFactory implements StatusWidgetFactory { @@ -71,7 +73,7 @@ currentFoldingMode, listSelectionEvent -> EventQueue.invokeLater(() -> { - JList<String> list = (JList<String>) listSelectionEvent.getSource(); + JList<String> list = castUnchecked(listSelectionEvent.getSource()); String selectedValue = list.getSelectedValue(); buffer.setStringProperty("folding", selectedValue); buffer.propertiesChanged(); Modified: jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/ModeWidgetFactory.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/ModeWidgetFactory.java 2023-10-13 19:09:34 UTC (rev 25692) +++ jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/ModeWidgetFactory.java 2023-10-13 20:06:50 UTC (rev 25693) @@ -33,6 +33,8 @@ import org.gjt.sp.jedit.gui.DialogChooser; import javax.swing.*; + +import static org.gjt.sp.util.StandardUtilities.castUnchecked; //}}} /** @@ -67,7 +69,7 @@ currentMode, listSelectionEvent -> EventQueue.invokeLater(() -> { - JList<Mode> list = (JList<Mode>) listSelectionEvent.getSource(); + JList<Mode> list = castUnchecked(listSelectionEvent.getSource()); buffer.setMode(list.getSelectedValue()); }), modes); Modified: jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/WrapWidgetFactory.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/WrapWidgetFactory.java 2023-10-13 19:09:34 UTC (rev 25692) +++ jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/WrapWidgetFactory.java 2023-10-13 20:06:50 UTC (rev 25693) @@ -37,6 +37,7 @@ import static org.gjt.sp.jedit.buffer.WordWrap.none; import static org.gjt.sp.jedit.buffer.WordWrap.soft; +import static org.gjt.sp.util.StandardUtilities.castUnchecked; //}}} /** @@ -70,7 +71,7 @@ currentFoldingMode, listSelectionEvent -> EventQueue.invokeLater(() -> { - JList<WordWrap> list = (JList<WordWrap>) listSelectionEvent.getSource(); + JList<WordWrap> list = castUnchecked(listSelectionEvent.getSource()); WordWrap selectedValue = list.getSelectedValue(); buffer.setWordWrap(selectedValue); EditBus.send(new BufferUpdate(buffer,null,BufferUpdate.PROPERTIES_CHANGED)); Modified: jEdit/trunk/org/gjt/sp/jedit/pluginmgr/PluginManagerProgress.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/pluginmgr/PluginManagerProgress.java 2023-10-13 19:09:34 UTC (rev 25692) +++ jEdit/trunk/org/gjt/sp/jedit/pluginmgr/PluginManagerProgress.java 2023-10-13 20:06:50 UTC (rev 25693) @@ -60,8 +60,8 @@ JButton stop = new JButton(jEdit.getProperty("plugin-manager.progress.stop")); stop.addActionListener(e -> { - // TODO: Thread.stop is deprecated, this should probably be Thread.interrupt - thread.stop(); + roster.abortWorkThreadOperations(); + thread.interrupt(); dispose(); }); JPanel panel = new JPanel(new FlowLayout( @@ -172,12 +172,10 @@ } @Override - @SuppressWarnings("deprecation") public void windowClosing(WindowEvent evt) { - // TODO: Thread.stop is deprecated, this should probably be Thread.interrupt - thread.stop(); - dispose(); + roster.abortWorkThreadOperations(); + thread.interrupt(); } } //}}} //}}} Modified: jEdit/trunk/org/gjt/sp/jedit/pluginmgr/Roster.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/pluginmgr/Roster.java 2023-10-13 19:09:34 UTC (rev 25692) +++ jEdit/trunk/org/gjt/sp/jedit/pluginmgr/Roster.java 2023-10-13 20:06:50 UTC (rev 25693) @@ -28,6 +28,7 @@ import java.awt.Component; import java.io.*; import java.net.*; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.zip.*; @@ -51,6 +52,7 @@ //{{{ Roster constructor Roster() { + abortWorkThreadOperations = new AtomicBoolean(false); operations = new ArrayList<>(); toLoad = new ArrayList<>(); } //}}} @@ -77,6 +79,12 @@ toLoad.add(path); } //}}} + //{{{ abortWorkThreadOperations() method + void abortWorkThreadOperations() + { + abortWorkThreadOperations.set(true); + } //}}} + //{{{ getOperation() method public Operation getOperation(int i) { @@ -103,7 +111,7 @@ op.runInWorkThread(progress); progress.done(); - if (Thread.interrupted()) + if (abortWorkThreadOperations.get()) return; } } //}}} @@ -143,6 +151,7 @@ //{{{ Private members private static File downloadDir; + private final AtomicBoolean abortWorkThreadOperations; private final List<Operation> operations; private final List<String> toLoad; Modified: jEdit/trunk/org/gjt/sp/jedit/syntax/ParserRuleSet.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/syntax/ParserRuleSet.java 2023-10-13 19:09:34 UTC (rev 25692) +++ jEdit/trunk/org/gjt/sp/jedit/syntax/ParserRuleSet.java 2023-10-13 20:06:50 UTC (rev 25693) @@ -25,8 +25,11 @@ //{{{ Imports import org.jedit.annotation.Nonnull; +import java.lang.reflect.Array; import java.util.*; import java.util.regex.Pattern; + +import static org.gjt.sp.util.StandardUtilities.castUnchecked; //}}} /** @@ -54,7 +57,7 @@ this.setName = setName; allRules = new ArrayList<>(); rulesForNull = new ArrayList<>(); - ruleArray = new List[BASE_CACHE]; + ruleArray = castUnchecked(Array.newInstance(List.class, BASE_CACHE)); imports = new ArrayList<>(); } //}}} Modified: jEdit/trunk/org/gjt/sp/util/StandardUtilities.java =================================================================== --- jEdit/trunk/org/gjt/sp/util/StandardUtilities.java 2023-10-13 19:09:34 UTC (rev 25692) +++ jEdit/trunk/org/gjt/sp/util/StandardUtilities.java 2023-10-13 20:06:50 UTC (rev 25693) @@ -754,4 +754,18 @@ } } // }}} + + //{{{ castUnchecked() method + /** + * Casts the given argument to the needed return type. + * + * @param castee The object to be casted unchecked + * @throws ClassCastException if the cast does not succeed + * @since jEdit 5.7 + */ + @SuppressWarnings("unchecked") + public static <T> T castUnchecked(Object castee) + { + return (T) castee; + } //}}} } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vam...@us...> - 2023-10-13 19:09:37
|
Revision: 25692 http://sourceforge.net/p/jedit/svn/25692 Author: vampire0 Date: 2023-10-13 19:09:34 +0000 (Fri, 13 Oct 2023) Log Message: ----------- Add missing contributor information Modified Paths: -------------- jEdit/trunk/doc/CHANGES.txt Modified: jEdit/trunk/doc/CHANGES.txt =================================================================== --- jEdit/trunk/doc/CHANGES.txt 2023-10-11 19:19:41 UTC (rev 25691) +++ jEdit/trunk/doc/CHANGES.txt 2023-10-13 19:09:34 UTC (rev 25692) @@ -18,10 +18,10 @@ - Allow user to choose filename when printing to pdf (partial fix for #4115 - Dale Anson) -- Bug #4128 key handling in the Errors dialog uses current keymap. +- Key handling in the Errors dialog uses current keymap (#4128 - Eric Le Lay) -- Bug #4125 Delete at the end of the line does not delete newline on java20, - java21 +- Delete at the end of the line does not delete newline on java20, java21 + (#4125 - Eric Le Lay) }}} {{{ Miscellaneous @@ -103,7 +103,7 @@ - Updated java mode for new keywords introduced up to Java 17. (Dale Anson) -- FR #554 add match index to beanshell replace context +- Add match index to beanshell replace context (#554 - Eric Le Lay) }}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-10-11 19:19:45
|
Revision: 25691 http://sourceforge.net/p/jedit/svn/25691 Author: kpouer Date: 2023-10-11 19:19:41 +0000 (Wed, 11 Oct 2023) Log Message: ----------- removed jsr305 which is incompatible with Java module system Modified Paths: -------------- jEdit/trunk/README.SRC.txt jEdit/trunk/build.xml jEdit/trunk/ivy.xml jEdit/trunk/org/gjt/sp/jedit/ActionSet.java jEdit/trunk/org/gjt/sp/jedit/EditPane.java jEdit/trunk/org/gjt/sp/jedit/EditPlugin.java jEdit/trunk/org/gjt/sp/jedit/GUIUtilities.java jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java jEdit/trunk/org/gjt/sp/jedit/PluginJAR.java jEdit/trunk/org/gjt/sp/jedit/Registers.java jEdit/trunk/org/gjt/sp/jedit/ServiceListHandler.java jEdit/trunk/org/gjt/sp/jedit/View.java jEdit/trunk/org/gjt/sp/jedit/browser/VFSBrowser.java jEdit/trunk/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java jEdit/trunk/org/gjt/sp/jedit/buffer/BufferSegment.java jEdit/trunk/org/gjt/sp/jedit/buffer/JEditBuffer.java jEdit/trunk/org/gjt/sp/jedit/buffer/PositionManager.java jEdit/trunk/org/gjt/sp/jedit/bufferset/BufferSet.java jEdit/trunk/org/gjt/sp/jedit/gui/DefaultInputHandler.java jEdit/trunk/org/gjt/sp/jedit/gui/DockingLayoutManager.java jEdit/trunk/org/gjt/sp/jedit/gui/ExtendedGridLayout.java jEdit/trunk/org/gjt/sp/jedit/gui/FilteredListModel.java jEdit/trunk/org/gjt/sp/jedit/gui/LogViewer.java jEdit/trunk/org/gjt/sp/jedit/gui/PanelWindowContainer.java jEdit/trunk/org/gjt/sp/jedit/gui/PingPongList.java jEdit/trunk/org/gjt/sp/jedit/gui/StatusBar.java jEdit/trunk/org/gjt/sp/jedit/input/AbstractInputHandler.java jEdit/trunk/org/gjt/sp/jedit/io/AutoDetection.java jEdit/trunk/org/gjt/sp/jedit/io/CharsetEncoding.java jEdit/trunk/org/gjt/sp/jedit/io/CopyFileWorker.java jEdit/trunk/org/gjt/sp/jedit/io/Encoding.java jEdit/trunk/org/gjt/sp/jedit/io/EncodingWithBOM.java jEdit/trunk/org/gjt/sp/jedit/io/FavoritesVFS.java jEdit/trunk/org/gjt/sp/jedit/io/FileRootsVFS.java jEdit/trunk/org/gjt/sp/jedit/io/FileVFS.java jEdit/trunk/org/gjt/sp/jedit/io/RegexEncodingDetector.java jEdit/trunk/org/gjt/sp/jedit/io/VFS.java jEdit/trunk/org/gjt/sp/jedit/io/VFSManager.java jEdit/trunk/org/gjt/sp/jedit/jEdit.java jEdit/trunk/org/gjt/sp/jedit/manager/BufferManagerImpl.java jEdit/trunk/org/gjt/sp/jedit/manager/ViewManager.java jEdit/trunk/org/gjt/sp/jedit/manager/ViewManagerImpl.java jEdit/trunk/org/gjt/sp/jedit/menu/EnhancedMenuItem.java jEdit/trunk/org/gjt/sp/jedit/msg/BufferUpdate.java jEdit/trunk/org/gjt/sp/jedit/msg/DockableWindowUpdate.java jEdit/trunk/org/gjt/sp/jedit/msg/EditPaneUpdate.java jEdit/trunk/org/gjt/sp/jedit/msg/PluginUpdate.java jEdit/trunk/org/gjt/sp/jedit/msg/VFSUpdate.java jEdit/trunk/org/gjt/sp/jedit/msg/ViewUpdate.java jEdit/trunk/org/gjt/sp/jedit/options/StatusBarOptionPane.java jEdit/trunk/org/gjt/sp/jedit/pluginmgr/CachePluginList.java jEdit/trunk/org/gjt/sp/jedit/pluginmgr/RemotePluginList.java jEdit/trunk/org/gjt/sp/jedit/pluginmgr/Roster.java jEdit/trunk/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java jEdit/trunk/org/gjt/sp/jedit/search/SearchDialog.java jEdit/trunk/org/gjt/sp/jedit/syntax/Chunk.java jEdit/trunk/org/gjt/sp/jedit/syntax/ParserRuleSet.java jEdit/trunk/org/gjt/sp/jedit/syntax/TokenMarker.java jEdit/trunk/org/gjt/sp/jedit/textarea/InputMethodSupport.java jEdit/trunk/org/gjt/sp/jedit/textarea/SelectionManager.java jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java jEdit/trunk/org/gjt/sp/util/AwtRunnableQueue.java jEdit/trunk/org/gjt/sp/util/IOUtilities.java jEdit/trunk/org/gjt/sp/util/ReverseCharSequence.java jEdit/trunk/org/gjt/sp/util/SegmentCharSequence.java jEdit/trunk/org/gjt/sp/util/StringList.java jEdit/trunk/org/jedit/io/Native2ASCIIEncoding.java Added Paths: ----------- jEdit/trunk/org/jedit/annotation/ jEdit/trunk/org/jedit/annotation/GuardedBy.java jEdit/trunk/org/jedit/annotation/Nonnull.java jEdit/trunk/org/jedit/annotation/NotThreadSafe.java jEdit/trunk/org/jedit/annotation/Nullable.java jEdit/trunk/org/jedit/annotation/ThreadSafe.java Modified: jEdit/trunk/README.SRC.txt =================================================================== --- jEdit/trunk/README.SRC.txt 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/README.SRC.txt 2023-10-11 19:19:41 UTC (rev 25691) @@ -173,13 +173,6 @@ * Tips for Eclipse/NetBeans/IDE users: -A file "jsr305.jar" contains definitions of the annotations -used in jEdit source code. It is downloaded automatically by ivy -as part of the ant build process, to your lib/compile subfolder. -If you add that jar to the -project properties - java build path - libraries, that will -get rid of the compiler errors on the annotations. - A file "tools.jar" from the JDK is also needed in your java build path. Modified: jEdit/trunk/build.xml =================================================================== --- jEdit/trunk/build.xml 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/build.xml 2023-10-11 19:19:41 UTC (rev 25691) @@ -239,10 +239,6 @@ compiler="modern" encoding="UTF-8" includeAntRuntime="false"> - <classpath id="classpath.compile"> - <fileset dir="${lib.dir}/compile" - includes="*.jar"/> - </classpath> <include name="org/**"/> <compilerarg line="${config.build.compilerarg}"/> </javac> @@ -430,9 +426,6 @@ compiler="modern" encoding="UTF-8" includeAntRuntime="false"> - <classpath id="classpath.compile"> - <fileset dir="${lib.dir}/compile" includes="*.jar"/> - </classpath> <compilerarg line="${config.build.compilerarg}"/> </javac> </target> Modified: jEdit/trunk/ivy.xml =================================================================== --- jEdit/trunk/ivy.xml 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/ivy.xml 2023-10-11 19:19:41 UTC (rev 25691) @@ -92,8 +92,6 @@ <dependency org="org.beanshell" name="bsh" rev="2.0b5" conf="scripting"/> <dependency org="org.bouncycastle" name="bcpg-jdk15on" rev="1.62" conf="scripting"/> - <dependency org="com.google.code.findbugs" name="jsr305" rev="3.0.2"/> - <dependency org="com.evolvedbinary.appbundler" name="appbundler" rev="1.0.4" conf="appbundler"/> </dependencies> </ivy-module> Modified: jEdit/trunk/org/gjt/sp/jedit/ActionSet.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/ActionSet.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/ActionSet.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -31,7 +31,7 @@ import org.jedit.keymap.Keymap; import org.gjt.sp.util.Log; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; //}}} /** Modified: jEdit/trunk/org/gjt/sp/jedit/EditPane.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/EditPane.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/EditPane.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -30,8 +30,8 @@ import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.jedit.annotation.Nonnull; +import org.jedit.annotation.Nullable; import javax.swing.*; import org.gjt.sp.jedit.EditBus.EBHandler; Modified: jEdit/trunk/org/gjt/sp/jedit/EditPlugin.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/EditPlugin.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/EditPlugin.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -26,7 +26,7 @@ import org.gjt.sp.jedit.menu.EnhancedMenu; import org.gjt.sp.util.Log; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; import javax.swing.*; import java.io.*; Modified: jEdit/trunk/org/gjt/sp/jedit/GUIUtilities.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/GUIUtilities.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/GUIUtilities.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -44,7 +44,7 @@ import java.util.List; import java.lang.ref.SoftReference; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JButton; Modified: jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -44,8 +44,8 @@ import org.gjt.sp.util.StandardUtilities; import org.gjt.sp.util.StringList; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.jedit.annotation.Nonnull; +import org.jedit.annotation.Nullable; //}}} /** Modified: jEdit/trunk/org/gjt/sp/jedit/PluginJAR.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/PluginJAR.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/PluginJAR.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -57,7 +57,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.SwingUtilities; import org.gjt.sp.jedit.browser.VFSBrowser; Modified: jEdit/trunk/org/gjt/sp/jedit/Registers.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/Registers.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/Registers.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -38,7 +38,7 @@ import org.gjt.sp.jedit.textarea.Selection; import org.gjt.sp.util.Log; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; //}}} /** Modified: jEdit/trunk/org/gjt/sp/jedit/ServiceListHandler.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/ServiceListHandler.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/ServiceListHandler.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -32,7 +32,7 @@ import org.gjt.sp.util.XMLUtilities; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; //}}} /** Modified: jEdit/trunk/org/gjt/sp/jedit/View.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/View.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/View.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -39,8 +39,8 @@ import java.util.List; import java.util.function.Consumer; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.jedit.annotation.Nonnull; +import org.jedit.annotation.Nullable; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JMenu; Modified: jEdit/trunk/org/gjt/sp/jedit/browser/VFSBrowser.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/browser/VFSBrowser.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/browser/VFSBrowser.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -26,7 +26,7 @@ import org.gjt.sp.jedit.EditBus.EBHandler; import org.gjt.sp.jedit.bsh.*; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; import javax.swing.border.EmptyBorder; import javax.swing.event.*; import javax.swing.*; Modified: jEdit/trunk/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -23,7 +23,7 @@ package org.gjt.sp.jedit.browser; //{{{ Imports -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.border.EmptyBorder; import javax.swing.*; import java.awt.BorderLayout; Modified: jEdit/trunk/org/gjt/sp/jedit/buffer/BufferSegment.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/buffer/BufferSegment.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/buffer/BufferSegment.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -21,7 +21,7 @@ package org.gjt.sp.jedit.buffer; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; /** * A read-only text segment from a buffer. Allows concatenation using a Modified: jEdit/trunk/org/gjt/sp/jedit/buffer/JEditBuffer.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/buffer/JEditBuffer.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/buffer/JEditBuffer.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -37,7 +37,7 @@ import org.gjt.sp.util.Log; import org.gjt.sp.util.StandardUtilities; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.text.Position; import javax.swing.text.Segment; import java.util.*; Modified: jEdit/trunk/org/gjt/sp/jedit/buffer/PositionManager.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/buffer/PositionManager.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/buffer/PositionManager.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -23,7 +23,7 @@ package org.gjt.sp.jedit.buffer; //{{{ Imports -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.text.Position; import java.util.*; import org.gjt.sp.util.Log; Modified: jEdit/trunk/org/gjt/sp/jedit/bufferset/BufferSet.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/bufferset/BufferSet.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/bufferset/BufferSet.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -32,7 +32,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; //}}} /** An ordered list of buffers, normally attached to an EditPane Modified: jEdit/trunk/org/gjt/sp/jedit/gui/DefaultInputHandler.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/DefaultInputHandler.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/gui/DefaultInputHandler.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -29,7 +29,7 @@ import org.gjt.sp.jedit.*; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; //}}} /** The default input handler maps sequences of keystrokes into actions and inserts key typed events into the text area. Modified: jEdit/trunk/org/gjt/sp/jedit/gui/DockingLayoutManager.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/DockingLayoutManager.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/gui/DockingLayoutManager.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -4,7 +4,7 @@ import java.util.Map; import java.util.Objects; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.JOptionPane; import org.gjt.sp.jedit.ActionSet; Modified: jEdit/trunk/org/gjt/sp/jedit/gui/ExtendedGridLayout.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/ExtendedGridLayout.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/gui/ExtendedGridLayout.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -16,7 +16,7 @@ package org.gjt.sp.jedit.gui; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; Modified: jEdit/trunk/org/gjt/sp/jedit/gui/FilteredListModel.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/FilteredListModel.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/gui/FilteredListModel.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -21,7 +21,7 @@ */ package org.gjt.sp.jedit.gui; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; import javax.swing.*; import javax.swing.event.*; import java.util.*; Modified: jEdit/trunk/org/gjt/sp/jedit/gui/LogViewer.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/LogViewer.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/gui/LogViewer.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -25,7 +25,7 @@ //{{{ Imports import java.awt.*; import java.awt.event.*; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; import javax.swing.*; import javax.swing.border.EmptyBorder; import javax.swing.event.*; Modified: jEdit/trunk/org/gjt/sp/jedit/gui/PanelWindowContainer.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/PanelWindowContainer.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/gui/PanelWindowContainer.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -45,7 +45,7 @@ import java.util.Comparator; import java.util.List; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; import javax.swing.AbstractButton; import javax.swing.ButtonGroup; import javax.swing.Icon; Modified: jEdit/trunk/org/gjt/sp/jedit/gui/PingPongList.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/PingPongList.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/gui/PingPongList.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -24,7 +24,7 @@ //{{{ Imports import org.gjt.sp.util.Log; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.*; import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataListener; Modified: jEdit/trunk/org/gjt/sp/jedit/gui/StatusBar.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/StatusBar.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/gui/StatusBar.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -34,7 +34,7 @@ import org.gjt.sp.util.TaskListener; import org.gjt.sp.util.TaskManager; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; import javax.swing.*; import javax.swing.border.CompoundBorder; import javax.swing.border.EmptyBorder; Modified: jEdit/trunk/org/gjt/sp/jedit/input/AbstractInputHandler.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/input/AbstractInputHandler.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/input/AbstractInputHandler.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -29,8 +29,8 @@ import java.awt.event.KeyEvent; import java.util.Hashtable; import java.util.StringTokenizer; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.jedit.annotation.Nonnull; +import org.jedit.annotation.Nullable; import org.gjt.sp.jedit.JEditAbstractEditAction; import org.gjt.sp.jedit.gui.ShortcutPrefixActiveEvent; Modified: jEdit/trunk/org/gjt/sp/jedit/io/AutoDetection.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/AutoDetection.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/io/AutoDetection.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -34,7 +34,7 @@ import org.gjt.sp.jedit.bufferio.BufferIORequest; import org.gjt.sp.util.Log; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; //}}} /** Modified: jEdit/trunk/org/gjt/sp/jedit/io/CharsetEncoding.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/CharsetEncoding.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/io/CharsetEncoding.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -31,7 +31,7 @@ import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CodingErrorAction; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; //}}} /** Modified: jEdit/trunk/org/gjt/sp/jedit/io/CopyFileWorker.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/CopyFileWorker.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/io/CopyFileWorker.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -29,8 +29,8 @@ import java.util.Objects; import java.util.concurrent.CountDownLatch; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.jedit.annotation.Nonnull; +import org.jedit.annotation.Nullable; import org.gjt.sp.jedit.MiscUtilities; import org.gjt.sp.util.Log; Modified: jEdit/trunk/org/gjt/sp/jedit/io/Encoding.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/Encoding.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/io/Encoding.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -25,7 +25,7 @@ import java.io.OutputStream; import java.io.Reader; import java.io.Writer; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; /** * An interface to represent an encoding. Modified: jEdit/trunk/org/gjt/sp/jedit/io/EncodingWithBOM.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/EncodingWithBOM.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/io/EncodingWithBOM.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -33,7 +33,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; //}}} /** Modified: jEdit/trunk/org/gjt/sp/jedit/io/FavoritesVFS.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/FavoritesVFS.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/io/FavoritesVFS.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -30,7 +30,7 @@ import org.gjt.sp.jedit.msg.DynamicMenuChanged; import org.gjt.sp.jedit.*; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; //}}} /** Modified: jEdit/trunk/org/gjt/sp/jedit/io/FileRootsVFS.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/FileRootsVFS.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/io/FileRootsVFS.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -25,7 +25,7 @@ package org.gjt.sp.jedit.io; //{{{ Imports -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.filechooser.FileSystemView; import java.awt.Component; import java.io.File; Modified: jEdit/trunk/org/gjt/sp/jedit/io/FileVFS.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/FileVFS.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/io/FileVFS.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -27,8 +27,8 @@ //{{{ Imports import java.io.Closeable; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.jedit.annotation.Nonnull; +import org.jedit.annotation.Nullable; import javax.swing.filechooser.FileSystemView; import javax.swing.*; Modified: jEdit/trunk/org/gjt/sp/jedit/io/RegexEncodingDetector.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/RegexEncodingDetector.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/io/RegexEncodingDetector.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -20,7 +20,7 @@ package org.gjt.sp.jedit.io; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; Modified: jEdit/trunk/org/gjt/sp/jedit/io/VFS.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/VFS.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/io/VFS.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -44,8 +44,8 @@ import org.gjt.sp.util.Task; import org.gjt.sp.util.ThreadUtilities; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.jedit.annotation.Nonnull; +import org.jedit.annotation.Nullable; //}}} /** Modified: jEdit/trunk/org/gjt/sp/jedit/io/VFSManager.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/VFSManager.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/io/VFSManager.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -23,7 +23,7 @@ package org.gjt.sp.jedit.io; //{{{ Imports -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.JOptionPane; import java.awt.Component; import java.awt.EventQueue; Modified: jEdit/trunk/org/gjt/sp/jedit/jEdit.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -40,8 +40,8 @@ import org.gjt.sp.jedit.View.ViewConfig; import org.gjt.sp.jedit.bsh.UtilEvalError; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.jedit.annotation.Nonnull; +import org.jedit.annotation.Nullable; import javax.swing.*; import java.awt.event.*; import java.io.*; Modified: jEdit/trunk/org/gjt/sp/jedit/manager/BufferManagerImpl.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/manager/BufferManagerImpl.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/manager/BufferManagerImpl.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -32,7 +32,7 @@ import org.gjt.sp.util.AwtRunnableQueue; import org.gjt.sp.util.StandardUtilities; -import javax.annotation.concurrent.GuardedBy; +import org.jedit.annotation.GuardedBy; import java.util.*; import java.util.function.Consumer; import java.util.function.Predicate; Modified: jEdit/trunk/org/gjt/sp/jedit/manager/ViewManager.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/manager/ViewManager.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/manager/ViewManager.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -23,7 +23,7 @@ import org.gjt.sp.jedit.View; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; import java.util.List; import java.util.function.Consumer; Modified: jEdit/trunk/org/gjt/sp/jedit/manager/ViewManagerImpl.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/manager/ViewManagerImpl.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/manager/ViewManagerImpl.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -23,7 +23,7 @@ import org.gjt.sp.jedit.*; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; import java.util.*; import java.util.function.Consumer; Modified: jEdit/trunk/org/gjt/sp/jedit/menu/EnhancedMenuItem.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/menu/EnhancedMenuItem.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/menu/EnhancedMenuItem.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -23,7 +23,7 @@ package org.gjt.sp.jedit.menu; //{{{ Imports -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; import javax.swing.*; import java.awt.*; import org.gjt.sp.jedit.*; Modified: jEdit/trunk/org/gjt/sp/jedit/msg/BufferUpdate.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/msg/BufferUpdate.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/msg/BufferUpdate.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -24,7 +24,7 @@ import org.gjt.sp.jedit.*; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import java.util.Objects; /** Modified: jEdit/trunk/org/gjt/sp/jedit/msg/DockableWindowUpdate.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/msg/DockableWindowUpdate.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/msg/DockableWindowUpdate.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -25,7 +25,7 @@ import org.gjt.sp.jedit.gui.DockableWindowManager; import org.gjt.sp.jedit.*; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import java.util.Objects; /** Modified: jEdit/trunk/org/gjt/sp/jedit/msg/EditPaneUpdate.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/msg/EditPaneUpdate.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/msg/EditPaneUpdate.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -21,7 +21,7 @@ import org.gjt.sp.jedit.*; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import java.util.Objects; /** Modified: jEdit/trunk/org/gjt/sp/jedit/msg/PluginUpdate.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/msg/PluginUpdate.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/msg/PluginUpdate.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -24,8 +24,8 @@ import java.io.File; import java.util.Objects; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.jedit.annotation.Nonnull; +import org.jedit.annotation.Nullable; import org.gjt.sp.jedit.*; Modified: jEdit/trunk/org/gjt/sp/jedit/msg/VFSUpdate.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/msg/VFSUpdate.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/msg/VFSUpdate.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -21,7 +21,7 @@ import org.gjt.sp.jedit.*; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import java.util.Objects; /** Modified: jEdit/trunk/org/gjt/sp/jedit/msg/ViewUpdate.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/msg/ViewUpdate.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/msg/ViewUpdate.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -24,7 +24,7 @@ import org.gjt.sp.jedit.*; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import java.util.Objects; /** Modified: jEdit/trunk/org/gjt/sp/jedit/options/StatusBarOptionPane.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/options/StatusBarOptionPane.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/options/StatusBarOptionPane.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -33,7 +33,7 @@ import org.gjt.sp.jedit.gui.statusbar.Widget; import org.gjt.sp.jedit.jEdit; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.*; import javax.swing.border.EmptyBorder; import javax.swing.table.AbstractTableModel; Modified: jEdit/trunk/org/gjt/sp/jedit/pluginmgr/CachePluginList.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/pluginmgr/CachePluginList.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/pluginmgr/CachePluginList.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -24,7 +24,7 @@ import org.gjt.sp.jedit.jEdit; import org.gjt.sp.util.Log; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; Modified: jEdit/trunk/org/gjt/sp/jedit/pluginmgr/RemotePluginList.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/pluginmgr/RemotePluginList.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/pluginmgr/RemotePluginList.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -27,7 +27,7 @@ import org.gjt.sp.util.ProgressObserver; import org.jedit.io.HttpException; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.IOException; Modified: jEdit/trunk/org/gjt/sp/jedit/pluginmgr/Roster.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/pluginmgr/Roster.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/pluginmgr/Roster.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -23,7 +23,7 @@ package org.gjt.sp.jedit.pluginmgr; //{{{ Imports -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.SwingUtilities; import java.awt.Component; import java.io.*; Modified: jEdit/trunk/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -31,7 +31,7 @@ import java.net.URL; import java.net.URLConnection; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import org.gjt.sp.jedit.MiscUtilities; import org.gjt.sp.jedit.PluginJAR; Modified: jEdit/trunk/org/gjt/sp/jedit/search/SearchDialog.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/search/SearchDialog.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/search/SearchDialog.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -23,7 +23,7 @@ package org.gjt.sp.jedit.search; //{{{ Imports -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.border.*; import javax.swing.*; Modified: jEdit/trunk/org/gjt/sp/jedit/syntax/Chunk.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/syntax/Chunk.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/syntax/Chunk.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -24,8 +24,8 @@ package org.gjt.sp.jedit.syntax; //{{{ Imports -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.jedit.annotation.Nonnull; +import org.jedit.annotation.Nullable; import javax.swing.text.*; import java.awt.font.*; import java.awt.geom.*; Modified: jEdit/trunk/org/gjt/sp/jedit/syntax/ParserRuleSet.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/syntax/ParserRuleSet.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/syntax/ParserRuleSet.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -24,7 +24,7 @@ package org.gjt.sp.jedit.syntax; //{{{ Imports -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import java.util.*; import java.util.regex.Pattern; //}}} Modified: jEdit/trunk/org/gjt/sp/jedit/syntax/TokenMarker.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/syntax/TokenMarker.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/syntax/TokenMarker.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -24,7 +24,7 @@ package org.gjt.sp.jedit.syntax; //{{{ Imports -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.text.Segment; import java.lang.ref.WeakReference; import java.util.*; Modified: jEdit/trunk/org/gjt/sp/jedit/textarea/InputMethodSupport.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/textarea/InputMethodSupport.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/textarea/InputMethodSupport.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -24,7 +24,7 @@ package org.gjt.sp.jedit.textarea; // {{{ Imports -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import java.awt.geom.Rectangle2D; import java.text.AttributedString; import java.text.AttributedCharacterIterator; Modified: jEdit/trunk/org/gjt/sp/jedit/textarea/SelectionManager.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/textarea/SelectionManager.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/textarea/SelectionManager.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -24,7 +24,7 @@ //{{{ Imports import java.util.*; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import org.gjt.sp.jedit.buffer.*; //}}} Modified: jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -28,7 +28,7 @@ import java.text.BreakIterator; import java.text.CharacterIterator; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.*; import javax.swing.Timer; import javax.swing.event.*; Modified: jEdit/trunk/org/gjt/sp/util/AwtRunnableQueue.java =================================================================== --- jEdit/trunk/org/gjt/sp/util/AwtRunnableQueue.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/util/AwtRunnableQueue.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -25,8 +25,8 @@ import java.awt.EventQueue; import java.util.LinkedList; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import org.jedit.annotation.GuardedBy; +import org.jedit.annotation.ThreadSafe; /** * A queue for runnables that should run in the EDT after all pending Modified: jEdit/trunk/org/gjt/sp/util/IOUtilities.java =================================================================== --- jEdit/trunk/org/gjt/sp/util/IOUtilities.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/util/IOUtilities.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -25,7 +25,7 @@ import java.io.*; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import javax.annotation.Nullable; +import org.jedit.annotation.Nullable; /** * IO tools that depend on JDK only. Modified: jEdit/trunk/org/gjt/sp/util/ReverseCharSequence.java =================================================================== --- jEdit/trunk/org/gjt/sp/util/ReverseCharSequence.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/util/ReverseCharSequence.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -20,7 +20,7 @@ package org.gjt.sp.util; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; /** * Reversed view of a given CharSequence. Modified: jEdit/trunk/org/gjt/sp/util/SegmentCharSequence.java =================================================================== --- jEdit/trunk/org/gjt/sp/util/SegmentCharSequence.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/util/SegmentCharSequence.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -21,7 +21,7 @@ package org.gjt.sp.util; import java.io.Serializable; -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import javax.swing.text.Segment; /** Modified: jEdit/trunk/org/gjt/sp/util/StringList.java =================================================================== --- jEdit/trunk/org/gjt/sp/util/StringList.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/gjt/sp/util/StringList.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -22,7 +22,7 @@ package org.gjt.sp.util; //{{{ imports -import javax.annotation.Nonnull; +import org.jedit.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; //}}} Added: jEdit/trunk/org/jedit/annotation/GuardedBy.java =================================================================== --- jEdit/trunk/org/jedit/annotation/GuardedBy.java (rev 0) +++ jEdit/trunk/org/jedit/annotation/GuardedBy.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -0,0 +1,31 @@ +/* FileOpenerService.java + * :tabSize=4:indentSize=4:noTabs=false: + * :folding=sidekick:collapseFolds=1: + * + * Copyright © 2023 Matthieu Casanova + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.jedit.annotation; + +import java.lang.annotation.*; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD, ElementType.METHOD}) +public @interface GuardedBy +{ + String value(); +} Added: jEdit/trunk/org/jedit/annotation/Nonnull.java =================================================================== --- jEdit/trunk/org/jedit/annotation/Nonnull.java (rev 0) +++ jEdit/trunk/org/jedit/annotation/Nonnull.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -0,0 +1,30 @@ +/* FileOpenerService.java + * :tabSize=4:indentSize=4:noTabs=false: + * :folding=sidekick:collapseFolds=1: + * + * Copyright © 2023 Matthieu Casanova + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.jedit.annotation; + +import java.lang.annotation.*; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +public @interface Nonnull +{ +} Added: jEdit/trunk/org/jedit/annotation/NotThreadSafe.java =================================================================== --- jEdit/trunk/org/jedit/annotation/NotThreadSafe.java (rev 0) +++ jEdit/trunk/org/jedit/annotation/NotThreadSafe.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -0,0 +1,30 @@ +/* FileOpenerService.java + * :tabSize=4:indentSize=4:noTabs=false: + * :folding=sidekick:collapseFolds=1: + * + * Copyright © 2023 Matthieu Casanova + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.jedit.annotation; + +import java.lang.annotation.*; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) +public @interface NotThreadSafe +{ +} Added: jEdit/trunk/org/jedit/annotation/Nullable.java =================================================================== --- jEdit/trunk/org/jedit/annotation/Nullable.java (rev 0) +++ jEdit/trunk/org/jedit/annotation/Nullable.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -0,0 +1,30 @@ +/* FileOpenerService.java + * :tabSize=4:indentSize=4:noTabs=false: + * :folding=sidekick:collapseFolds=1: + * + * Copyright © 2023 Matthieu Casanova + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.jedit.annotation; + +import java.lang.annotation.*; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +public @interface Nullable +{ +} Added: jEdit/trunk/org/jedit/annotation/ThreadSafe.java =================================================================== --- jEdit/trunk/org/jedit/annotation/ThreadSafe.java (rev 0) +++ jEdit/trunk/org/jedit/annotation/ThreadSafe.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -0,0 +1,30 @@ +/* FileOpenerService.java + * :tabSize=4:indentSize=4:noTabs=false: + * :folding=sidekick:collapseFolds=1: + * + * Copyright © 2023 Matthieu Casanova + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.jedit.annotation; + +import java.lang.annotation.*; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) +public @interface ThreadSafe +{ +} Modified: jEdit/trunk/org/jedit/io/Native2ASCIIEncoding.java =================================================================== --- jEdit/trunk/org/jedit/io/Native2ASCIIEncoding.java 2023-10-09 20:38:43 UTC (rev 25690) +++ jEdit/trunk/org/jedit/io/Native2ASCIIEncoding.java 2023-10-11 19:19:41 UTC (rev 25691) @@ -35,8 +35,8 @@ import java.nio.charset.CharsetEncoder; import java.nio.charset.MalformedInputException; import java.nio.charset.StandardCharsets; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.jedit.annotation.Nonnull; +import org.jedit.annotation.Nullable; import org.gjt.sp.jedit.io.CharsetEncoding; import org.gjt.sp.jedit.io.Encoding; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ker...@us...> - 2023-10-09 20:38:45
|
Revision: 25690 http://sourceforge.net/p/jedit/svn/25690 Author: kerik-sf Date: 2023-10-09 20:38:43 +0000 (Mon, 09 Oct 2023) Log Message: ----------- Fix bug #4125 delete at the end of the line does not delete newline on java 20, 21 previous commit already had the patch. Adding a comment and changelog entry. Modified Paths: -------------- jEdit/trunk/doc/CHANGES.txt jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java Modified: jEdit/trunk/doc/CHANGES.txt =================================================================== --- jEdit/trunk/doc/CHANGES.txt 2023-10-03 11:13:02 UTC (rev 25689) +++ jEdit/trunk/doc/CHANGES.txt 2023-10-09 20:38:43 UTC (rev 25690) @@ -20,6 +20,9 @@ - Bug #4128 key handling in the Errors dialog uses current keymap. +- Bug #4125 Delete at the end of the line does not delete newline on java20, + java21 + }}} {{{ Miscellaneous Modified: jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java 2023-10-03 11:13:02 UTC (rev 25689) +++ jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java 2023-10-09 20:38:43 UTC (rev 25690) @@ -6314,10 +6314,12 @@ { int following = charBreaker.following(offset - index0Offset); - if (following == BreakIterator.DONE || (Runtime.version().feature() >= 20 && following == offset - index0Offset)) + if (following == BreakIterator.DONE || (Runtime.version().feature() >= 20 && following == offset - index0Offset)) { - // This means a end of line. Then it is - // safe to assume 1 code unit is a character. + // When offset is before a line break, + // pre java20 BreakIterator.DONE is returned by RuleBasedBreakIterator + // after java20, offset - index0Offset is returned by GraphemeBreakIterator. + // In either case it is safe to assume 1 code unit is a character. // This may return an offset beyond the // length of buffer. But it is a callers // responsibility. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-10-03 11:13:05
|
Revision: 25689 http://sourceforge.net/p/jedit/svn/25689 Author: kpouer Date: 2023-10-03 11:13:02 +0000 (Tue, 03 Oct 2023) Log Message: ----------- Add some unit test for #4125 Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java Added Paths: ----------- jEdit/trunk/test/org/gjt/sp/jedit/textarea/LineCharacterBreakerTest.java Modified: jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java 2023-10-01 22:43:12 UTC (rev 25688) +++ jEdit/trunk/org/gjt/sp/jedit/textarea/TextArea.java 2023-10-03 11:13:02 UTC (rev 25689) @@ -367,7 +367,7 @@ * view.getTextArea().getBuffer(). * */ - public final JEditBuffer getBuffer() + public JEditBuffer getBuffer() { return buffer; } //}}} @@ -1260,7 +1260,7 @@ * Returns the line containing the specified offset. * @param offset The offset */ - public final int getLineOfOffset(int offset) + public int getLineOfOffset(int offset) { return buffer.getLineOfOffset(offset); } //}}} @@ -6292,7 +6292,7 @@ //{{{ LineCharacterBreaker class // Shared context among some operations which are aware of // characters above BMP and combining character sequence. - private static class LineCharacterBreaker + public static class LineCharacterBreaker { private final BreakIterator charBreaker; private final int index0Offset; @@ -6301,7 +6301,7 @@ { final int line = textArea.getLineOfOffset(offset); charBreaker = BreakIterator.getCharacterInstance(); - charBreaker.setText(new CharIterator(textArea.buffer.getLineSegment(line))); + charBreaker.setText(new CharIterator(textArea.getBuffer().getLineSegment(line))); index0Offset = textArea.getLineStartOffset(line); } @@ -6314,7 +6314,7 @@ { int following = charBreaker.following(offset - index0Offset); - if (following == BreakIterator.DONE) + if (following == BreakIterator.DONE || (Runtime.version().feature() >= 20 && following == offset - index0Offset)) { // This means a end of line. Then it is // safe to assume 1 code unit is a character. Added: jEdit/trunk/test/org/gjt/sp/jedit/textarea/LineCharacterBreakerTest.java =================================================================== --- jEdit/trunk/test/org/gjt/sp/jedit/textarea/LineCharacterBreakerTest.java (rev 0) +++ jEdit/trunk/test/org/gjt/sp/jedit/textarea/LineCharacterBreakerTest.java 2023-10-03 11:13:02 UTC (rev 25689) @@ -0,0 +1,71 @@ +/* + * jEdit - Programmer's Text Editor + * :tabSize=8:indentSize=8:noTabs=false: + * :folding=explicit:collapseFolds=1: + * + * Copyright © 2023 jEdit contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.gjt.sp.jedit.textarea; + +import org.gjt.sp.jedit.buffer.JEditBuffer; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.internal.util.Primitives; +import org.mockito.junit.MockitoJUnitRunner; + +import static org.junit.jupiter.api.Assertions.*; + +@RunWith(MockitoJUnitRunner.class) +public class LineCharacterBreakerTest { + @Mock + private TextArea textArea; + @Mock + private JEditBuffer buffer; + + @Before + public void setUp() throws Exception { + Mockito.reset(textArea, buffer); + } + + @Test + public void testNextOf() { + var line = 10; + var integerArgumentCaptor = ArgumentCaptor.forClass(Primitives.primitiveTypeOf(int.class)); + Mockito.when(textArea.getLineOfOffset(integerArgumentCaptor.capture())).thenReturn(line); + Mockito.when(textArea.getBuffer()).thenReturn(buffer); + Mockito.when(buffer.getLineSegment(line)).thenReturn("732K /run"); + Mockito.when(textArea.getLineStartOffset(line)).thenReturn(136); + var breaker = new TextArea.LineCharacterBreaker(textArea, 148); + assertEquals(149, breaker.nextOf(148)); + } + + @Test + public void testPreviousOf() { + var line = 10; + var integerArgumentCaptor = ArgumentCaptor.forClass(Primitives.primitiveTypeOf(int.class)); + Mockito.when(textArea.getLineOfOffset(integerArgumentCaptor.capture())).thenReturn(line); + Mockito.when(textArea.getBuffer()).thenReturn(buffer); + Mockito.when(buffer.getLineSegment(line)).thenReturn("732K /run"); + Mockito.when(textArea.getLineStartOffset(line)).thenReturn(136); + var breaker = new TextArea.LineCharacterBreaker(textArea, 148); + assertEquals(136, breaker.previousOf(137)); + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vam...@us...> - 2023-10-01 22:43:13
|
Revision: 25688 http://sourceforge.net/p/jedit/svn/25688 Author: vampire0 Date: 2023-10-01 22:43:12 +0000 (Sun, 01 Oct 2023) Log Message: ----------- Fix whitespace in CHANGES.txt Modified Paths: -------------- jEdit/trunk/doc/CHANGES.txt Modified: jEdit/trunk/doc/CHANGES.txt =================================================================== --- jEdit/trunk/doc/CHANGES.txt 2023-09-20 20:38:49 UTC (rev 25687) +++ jEdit/trunk/doc/CHANGES.txt 2023-10-01 22:43:12 UTC (rev 25688) @@ -12,9 +12,11 @@ - Fix the installation of plugins trying to use invalid file names (Björn Kautler) -- VFSManager.canReadFile() was returning true only for directories (#4102 - Matthieu Casanova) +- VFSManager.canReadFile() was returning true only for directories + (#4102 - Matthieu Casanova) -- Allow user to choose filename when printing to pdf (partial fix for #4115 - Dale Anson) +- Allow user to choose filename when printing to pdf + (partial fix for #4115 - Dale Anson) - Bug #4128 key handling in the Errors dialog uses current keymap. @@ -21,7 +23,8 @@ }}} {{{ Miscellaneous -- Status bar design updated with the ability to add widgets to the left and the right of the bar (Matthieu Casanova) +- Status bar design updated with the ability to add widgets to the left + and the right of the bar (Matthieu Casanova) - Make building possible when using Java 15+ (Björn Kautler) @@ -28,15 +31,20 @@ }}} {{{ API Changes -- Added new methods in SegmentBuffer for append and insert text (Matthieu Casanova) +- Added new methods in SegmentBuffer for append and insert text + (Matthieu Casanova) -- New service org.jedit.util.CleanerService replacing use of finalize() (Matthieu Casanova) +- New service org.jedit.util.CleanerService replacing use of finalize() + (Matthieu Casanova) -- New methods JEditBuffer.getWordWrap() and JeditBuffer.setWordWrap() (Matthieu Casanova) +- New methods JEditBuffer.getWordWrap() and JeditBuffer.setWordWrap() + (Matthieu Casanova) -- New method DialogChooser.openChooserWindow() showing a chooser dialog (Matthieu Casanova) +- New method DialogChooser.openChooserWindow() showing a chooser dialog + (Matthieu Casanova) -- New method DialogChooser.openListChooserWindow() showing a chooser dialog list (Matthieu Casanova) +- New method DialogChooser.openListChooserWindow() showing a chooser dialog list + (Matthieu Casanova) - New method Buffer.setLineSeparator() (Matthieu Casanova) @@ -87,8 +95,8 @@ - New edit mode for QDoc (Dale Anson) -- Status bar encoding widget allow to choose between updating the encoding or reloading - with a new encoding (Matthieu Casanova) +- Status bar encoding widget allow to choose between updating the encoding + or reloading with a new encoding (Matthieu Casanova) - Updated java mode for new keywords introduced up to Java 17. (Dale Anson) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-19 20:15:34
|
Revision: 25686 http://sourceforge.net/p/jedit/svn/25686 Author: kpouer Date: 2023-09-19 20:15:31 +0000 (Tue, 19 Sep 2023) Log Message: ----------- Introduce a SystemManager to encapsulate environment manipulation and make unit tests possible. Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java jEdit/trunk/org/gjt/sp/jedit/jEdit.java jEdit/trunk/test/org/gjt/sp/jedit/MiscUtilitiesTest.java Added Paths: ----------- jEdit/trunk/org/jedit/util/SystemManager.java Modified: jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java 2023-09-19 18:53:06 UTC (rev 25685) +++ jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java 2023-09-19 20:15:31 UTC (rev 25686) @@ -140,7 +140,7 @@ if (m.find()) { String varName = m.group(2); - String expansion = System.getenv(varName); + String expansion = jEdit.systemManager.getenv(varName); if (expansion != null) { expansion = Matcher.quoteReplacement(expansion); @@ -182,7 +182,7 @@ return arg; } String varName = m.group(2); - String expansion = System.getenv(varName); + String expansion = jEdit.systemManager.getenv(varName); if (expansion == null) { if (varName.equalsIgnoreCase("jedit_settings") && jEdit.getSettingsDirectory() != null) { expansion = jEdit.getSettingsDirectory(); Modified: jEdit/trunk/org/gjt/sp/jedit/jEdit.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2023-09-19 18:53:06 UTC (rev 25685) +++ jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2023-09-19 20:15:31 UTC (rev 25686) @@ -56,6 +56,7 @@ import java.util.function.Consumer; import java.util.stream.Stream; +import org.jedit.util.SystemManager; import org.xml.sax.SAXParseException; import org.gjt.sp.jedit.bufferio.BufferIORequest; @@ -147,7 +148,7 @@ System.getProperty("user.home"), "Library/jEdit" ); else if (OperatingSystem.isWindows()) { - String appData = System.getenv("APPDATA"); + String appData = systemManager.getenv("APPDATA"); if (appData != null) settingsDirectory = MiscUtilities.constructPath( appData, "jEdit"); @@ -3245,6 +3246,7 @@ private static BufferManagerImpl bufferManager = new BufferManagerImpl(); private static ViewManagerImpl viewManager = new ViewManagerImpl(); private static EditPaneManager editPaneManager = new EditPaneManagerImpl(viewManager); + public static SystemManager systemManager = new SystemManager(); private static final Object editBusOrderingLock = new Object(); Added: jEdit/trunk/org/jedit/util/SystemManager.java =================================================================== --- jEdit/trunk/org/jedit/util/SystemManager.java (rev 0) +++ jEdit/trunk/org/jedit/util/SystemManager.java 2023-09-19 20:15:31 UTC (rev 25686) @@ -0,0 +1,41 @@ +/* + * jEdit - Programmer's Text Editor + * :tabSize=8:indentSize=8:noTabs=false: + * :folding=explicit:collapseFolds=1: + * + * Copyright © 2023 jEdit contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.jedit.util; + +import java.util.Map; + +/** + * A class to wrap System methods. + * @since jEdit 5.7pre1 + */ +public class SystemManager +{ + public String getenv(String name) + { + return System.getenv(name); + } + + public Map<String, String> getenv() + { + return System.getenv(); + } +} Modified: jEdit/trunk/test/org/gjt/sp/jedit/MiscUtilitiesTest.java =================================================================== --- jEdit/trunk/test/org/gjt/sp/jedit/MiscUtilitiesTest.java 2023-09-19 18:53:06 UTC (rev 25685) +++ jEdit/trunk/test/org/gjt/sp/jedit/MiscUtilitiesTest.java 2023-09-19 20:15:31 UTC (rev 25686) @@ -21,18 +21,19 @@ package org.gjt.sp.jedit; +import org.jedit.util.SystemManager; import org.junit.After; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; import org.mockito.Mock; +import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; import java.io.File; import java.lang.reflect.Field; -import java.util.Collections; import java.util.List; -import java.util.Map; import static org.junit.Assert.*; import static org.mockito.Mockito.when; @@ -168,69 +169,50 @@ @Test public void expandVariablesEnvWindowsAsWindows() throws Exception { - Map<String, String> env = System.getenv(); - Map.Entry<String, String> firstEntry = env.entrySet().iterator().next(); - String key = firstEntry.getKey(); - String value = firstEntry.getValue(); + jEdit.systemManager = Mockito.mock(SystemManager.class); + var captor = ArgumentCaptor.forClass(String.class); + var value = "c:\\home\\jEdit"; + Mockito.when(jEdit.systemManager.getenv(captor.capture())).thenReturn(value); updateOS(WINDOWS_NT); - assertEquals(value, MiscUtilities.expandVariables("%" + key + '%')); + var key = "jEdit_TEST"; + assertEquals(value, MiscUtilities.expandVariables('%' + key + '%')); + assertEquals(captor.getValue(), key); } @Test public void expandVariablesEnvWindowsAsUnix() throws Exception { - var key = "jEdit_TEST"; + jEdit.systemManager = Mockito.mock(SystemManager.class); + var captor = ArgumentCaptor.forClass(String.class); var value = "c:\\home\\jEdit"; - setEnv(Map.of(key, value)); + Mockito.when(jEdit.systemManager.getenv(captor.capture())).thenReturn(value); updateOS(UNIX); + var key = "jEdit_TEST"; assertEquals(value, MiscUtilities.expandVariables('%' + key + '%')); + assertEquals(captor.getValue(), key); } @Test public void expandVariablesEnvUnix() throws Exception { - Map<String, String> env = System.getenv(); - Map.Entry<String, String> firstEntry = env.entrySet().iterator().next(); - String key = firstEntry.getKey(); - String value = firstEntry.getValue(); + jEdit.systemManager = Mockito.mock(SystemManager.class); + var captor = ArgumentCaptor.forClass(String.class); + var value = "c:\\home\\jEdit"; + Mockito.when(jEdit.systemManager.getenv(captor.capture())).thenReturn(value); updateOS(UNIX); - assertEquals(value, MiscUtilities.expandVariables("$" + key)); + var key = "jEdit_TEST"; + assertEquals(value, MiscUtilities.expandVariables('$' + key)); + assertEquals(captor.getValue(), key); } - private static void setEnv(Map<String, String> newenv) throws Exception { - try { - var processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment"); - Field theEnvironmentField = processEnvironmentClass.getDeclaredField("theEnvironment"); - theEnvironmentField.setAccessible(true); - var env = (Map<String, String>) theEnvironmentField.get(null); - env.putAll(newenv); - Field theCaseInsensitiveEnvironmentField = processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment"); - theCaseInsensitiveEnvironmentField.setAccessible(true); - var cienv = (Map<String, String>) theCaseInsensitiveEnvironmentField.get(null); - cienv.putAll(newenv); - } catch (NoSuchFieldException e) { - Class[] classes = Collections.class.getDeclaredClasses(); - Map<String, String> env = System.getenv(); - for(var cl : classes) { - if("java.util.Collections$UnmodifiableMap".equals(cl.getName())) { - Field field = cl.getDeclaredField("m"); - field.setAccessible(true); - var obj = field.get(env); - var map = (Map<String, String>) obj; - map.clear(); - map.putAll(newenv); - } - } - } - } - @Test public void expandVariablesEnvUnix2() throws Exception { - Map<String, String> env = System.getenv(); - Map.Entry<String, String> firstEntry = env.entrySet().iterator().next(); - String key = firstEntry.getKey(); - String value = firstEntry.getValue(); + jEdit.systemManager = Mockito.mock(SystemManager.class); + var captor = ArgumentCaptor.forClass(String.class); + var value = "c:\\home\\jEdit"; + Mockito.when(jEdit.systemManager.getenv(captor.capture())).thenReturn(value); updateOS(UNIX); + var key = "jEdit_TEST"; assertEquals(value, MiscUtilities.expandVariables("${" + key + '}')); } @@ -237,10 +219,9 @@ @Test public void expandVariablesEnvUnixNoMatch() throws Exception { - Map<String, String> env = System.getenv(); - Map.Entry<String, String> firstEntry = env.entrySet().iterator().next(); - String key = firstEntry.getKey(); updateOS(UNIX); + // it is wanted that the } is missing here + var key = "jEdit_TEST"; assertEquals("${" + key, MiscUtilities.expandVariables("${" + key)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-19 18:53:09
|
Revision: 25685 http://sourceforge.net/p/jedit/svn/25685 Author: kpouer Date: 2023-09-19 18:53:06 +0000 (Tue, 19 Sep 2023) Log Message: ----------- use Matcher.quoteReplacement() instead of a simple replace Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java Modified: jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java 2023-09-17 19:29:09 UTC (rev 25684) +++ jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java 2023-09-19 18:53:06 UTC (rev 25685) @@ -141,8 +141,9 @@ { String varName = m.group(2); String expansion = System.getenv(varName); - if (expansion != null) { - expansion = expansion.replace("\\", "\\\\"); + if (expansion != null) + { + expansion = Matcher.quoteReplacement(expansion); return m.replaceFirst(expansion); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-17 19:29:12
|
Revision: 25684 http://sourceforge.net/p/jedit/svn/25684 Author: kpouer Date: 2023-09-17 19:29:09 +0000 (Sun, 17 Sep 2023) Log Message: ----------- some cleanup Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/JEditActionContext.java jEdit/trunk/org/gjt/sp/jedit/PluginJAR.java jEdit/trunk/org/gjt/sp/jedit/print/PrinterDialog.java Modified: jEdit/trunk/org/gjt/sp/jedit/JEditActionContext.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/JEditActionContext.java 2023-09-17 18:22:52 UTC (rev 25683) +++ jEdit/trunk/org/gjt/sp/jedit/JEditActionContext.java 2023-09-17 19:29:09 UTC (rev 25684) @@ -28,6 +28,8 @@ import java.lang.reflect.Array; import java.util.*; +import static org.gjt.sp.util.StandardUtilities.EMPTY_STRING_ARRAY; + /** * Manages a collection of action sets. There are two instances of this class * in jEdit: @@ -152,13 +154,12 @@ { if(actionNames == null) { - List<String> vec = new LinkedList<String>(); + var vec = new LinkedList<String>(); for(int i = 0; i < actionSets.size(); i++) (actionSets.elementAt(i)).getActionNames(vec); - actionNames = vec.toArray(new String[vec.size()]); - Arrays.sort(actionNames, - new StandardUtilities.StringCompare<String>(true)); + actionNames = vec.toArray(EMPTY_STRING_ARRAY); + Arrays.sort(actionNames, new StandardUtilities.StringCompare<>(true)); } return Arrays.copyOf(actionNames, actionNames.length); @@ -170,13 +171,13 @@ * This map contains as key an action name, * and as value the JEditActionSet that contains this action */ - Hashtable<String, E> actionHash = new Hashtable<String, E>(); + Hashtable<String, E> actionHash = new Hashtable<>(); /** A map of built-in actions that were overridden by plugins. */ - Hashtable<String, E> overriddenActions = new Hashtable<String, E>(); + Hashtable<String, E> overriddenActions = new Hashtable<>(); //}}} //{{{ Private members - private final Vector<E> actionSets = new Vector<E>(); + private final Vector<E> actionSets = new Vector<>(); //}}} } Modified: jEdit/trunk/org/gjt/sp/jedit/PluginJAR.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/PluginJAR.java 2023-09-17 18:22:52 UTC (rev 25683) +++ jEdit/trunk/org/gjt/sp/jedit/PluginJAR.java 2023-09-17 19:29:09 UTC (rev 25684) @@ -152,6 +152,7 @@ */ public class PluginJAR { + public static final PluginDepends[] EMPTY_PLUGIN_DEPENDS_ARRAY = new PluginDepends[0]; //{{{ Instance variables private final String path; private String cachePath; @@ -441,7 +442,7 @@ */ public static Set<String> getDependencySet(String className) { - Set<String> retval = new LinkedHashSet<String>(); + Set<String> retval = new LinkedHashSet<>(); PluginDepends[] deps = getPluginDepends(className); for (PluginDepends pluginDepends : deps) { @@ -713,7 +714,7 @@ //{{{ getPluginDepends() method private static PluginDepends[] getPluginDepends(String classname) throws IllegalArgumentException { - List<PluginDepends> ret = new ArrayList<PluginDepends>(); + var ret = new ArrayList<PluginDepends>(); int i = 0; String dep; while((dep = jEdit.getProperty("plugin." + classname + ".depend." + i++)) != null) @@ -744,7 +745,7 @@ depends.name = arg.indexOf(' ') > 0 ? arg.substring(0, arg.indexOf(' ')) : arg; ret.add(depends); } - return ret.toArray(new PluginDepends[ret.size()]); + return ret.toArray(EMPTY_PLUGIN_DEPENDS_ARRAY); } //}}} //{{{ getDependencies() method @@ -756,7 +757,7 @@ @Nonnull public static Set<String> getDependencies(String classname) throws IllegalArgumentException { - Set<String> ret = new HashSet<>(); + var ret = new HashSet<String>(); int i = 0; String dep; while((dep = jEdit.getProperty("plugin." + classname + ".depend." + i++)) != null) @@ -780,7 +781,7 @@ */ public static Set<String> getOptionalDependencies(String classname) throws IllegalArgumentException { - Set<String> ret = new HashSet<String>(); + var ret = new HashSet<String>(); int i = 0; String dep; while((dep = jEdit.getProperty("plugin." + classname + ".depend." + i++)) != null) @@ -1499,12 +1500,12 @@ properties = new Properties(); localizationProperties = new HashMap<>(); - List<String> classes = new LinkedList<>(); - List<String> resources = new LinkedList<>(); + var classes = new LinkedList<String>(); + var resources = new LinkedList<String>(); ZipFile zipFile = getZipFile(); - List<String> plugins = new LinkedList<>(); + var plugins = new LinkedList<String>(); PluginCacheEntry cache = new PluginCacheEntry(); cache.modTime = file.lastModified(); @@ -1854,7 +1855,7 @@ return false; String cacheBuild = readString(din); - if(!cacheBuild.equals(jEdit.getBuild())) + if(!jEdit.getBuild().equals(cacheBuild)) return false; long cacheModTime = din.readLong(); Modified: jEdit/trunk/org/gjt/sp/jedit/print/PrinterDialog.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/print/PrinterDialog.java 2023-09-17 18:22:52 UTC (rev 25683) +++ jEdit/trunk/org/gjt/sp/jedit/print/PrinterDialog.java 2023-09-17 19:29:09 UTC (rev 25684) @@ -1,4 +1,3 @@ - /* * PrinterDialog.java * @@ -21,7 +20,6 @@ */ package org.gjt.sp.jedit.print; - import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -53,14 +51,13 @@ // https://docs.oracle.com/javase/7/docs/technotes/guides/jps/spec/JPSTOC.fm.html public class PrinterDialog extends JDialog implements ListSelectionListener { - private View view; - private String jobName = null; - private PrintService selectedPrintService = null; + private String jobName; + private PrintService selectedPrintService; private PrintRequestAttributeSet attributes; private JTabbedPane tabs; private JList<PrintService> printers; - private JSpinner copies = null; + private JSpinner copies; private JComboBox<String> paperSize; private List<Media> paperSizes; private JComboBox<Priority> priority; @@ -199,7 +196,7 @@ return new ActionListener() { - public void actionPerformed( ActionEvent ae ) + public void actionPerformed(ActionEvent ae) { // check margins and so on @@ -227,7 +224,7 @@ try { PageRanges mergedRanges = mergeRanges( pr ); - if (mergedRanges != null) + if (mergedRanges != null) { PrinterDialog.this.attributes.add( mergedRanges ); } @@ -519,7 +516,7 @@ // paper sizes value = categoryValueMap.get( Media.class ); - Set<MediaSizeName> sizeNames = new HashSet<MediaSizeName>(); + var sizeNames = new HashSet<MediaSizeName>(); for ( Media m : ( Media[] )value ) { if ( m instanceof MediaSizeName ) @@ -527,15 +524,8 @@ sizeNames.add( ( MediaSizeName )m ); } } - MediaSizeName[] sizes = sizeNames.toArray( new MediaSizeName [sizeNames.size()] ); - Arrays.sort( sizes, new Comparator<MediaSizeName>() - { - - public int compare( MediaSizeName a, MediaSizeName b ) - { - return a.toString().compareTo( b.toString() ); - } - } ); + MediaSizeName[] sizes = sizeNames.toArray(new MediaSizeName [0]); + Arrays.sort( sizes, Comparator.comparing(EnumSyntax::toString)); Media previousPaper = ( Media )attributes.get( Media.class ); MediaSizeName previousSize = null; if ( previousPaper instanceof MediaSizeName ) @@ -546,7 +536,7 @@ if (paperSize != null) { String[] paperNames = new String [sizes.length]; - paperSizes = new ArrayList<Media>(); + paperSizes = new ArrayList<>(); int index = -1; int letterSizeIndex = 0; for ( int i = 0; i < sizes.length; i++ ) @@ -682,7 +672,7 @@ } else { - Set<MediaTray> trayNames = new HashSet<MediaTray>(); + var trayNames = new HashSet<MediaTray>(); for ( Media m : ( Media[] )value ) { if ( m instanceof MediaTray ) @@ -690,10 +680,10 @@ trayNames.add( ( MediaTray )m ); } } - if ( trayNames.size() > 0 ) + if (!trayNames.isEmpty()) { - MediaTray[] trays = trayNames.toArray( new MediaTray [trayNames.size()] ); - paperSource.setModel( new DefaultComboBoxModel<MediaTray>( trays ) ); + MediaTray[] trays = trayNames.toArray(new MediaTray [0]); + paperSource.setModel( new DefaultComboBoxModel<>( trays ) ); paperSource.setEnabled( true ); MediaTray lastUsedTray = (MediaTray)attributes.get(MediaTray.class); paperSource.setSelectedItem(lastUsedTray == null ? trays[0] : lastUsedTray); @@ -705,7 +695,6 @@ } } - // orientation, eg. portrait or landscape if (orientation != null) { @@ -725,11 +714,8 @@ } } - - private abstract class PrinterPanel extends JPanel { - public PrinterPanel() { super( new BorderLayout() ); @@ -736,13 +722,9 @@ setBorder( BorderFactory.createEmptyBorder( 11, 11, 11, 11 ) ); } - - abstract AttributeSet getAttributes() - ; + abstract AttributeSet getAttributes(); } - - private class GeneralPanel extends PrinterPanel { @@ -754,7 +736,6 @@ JCheckBox reverse; JTextField pagesField; - // DONE: current page and selection are not implemented yet. Note there // are no standard printer attributes to specify either of these, so I // added the PrintRangeType attribute to handle these. @@ -825,35 +806,15 @@ // install listeners printers.addListSelectionListener( PrinterDialog.this ); - allPages.addActionListener( new ActionListener() - { - - public void actionPerformed( ActionEvent ae ) - { - pagesField.setEnabled( pages.isSelected() ); - } - } - ); - pages.addActionListener( new ActionListener() - { - - public void actionPerformed( ActionEvent ae ) - { - pagesField.setEnabled( pages.isSelected() ); - } - } - ); - copies.addChangeListener( new ChangeListener() - { - - public void stateChanged( ChangeEvent e ) - { - JSpinner spinner = ( JSpinner )e.getSource(); - int value = ( int )spinner.getValue(); - collate.setEnabled( value > 1 ); - collate.setSelected( value > 1 ); - } - } ); + allPages.addActionListener(ae -> pagesField.setEnabled(pages.isSelected())); + pages.addActionListener(ae -> pagesField.setEnabled(pages.isSelected())); + copies.addChangeListener(e -> + { + JSpinner spinner = ( JSpinner )e.getSource(); + int value = ( int )spinner.getValue(); + collate.setEnabled( value > 1 ); + collate.setSelected( value > 1 ); + }); PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService(); // choose last used printer first, default printer if no last used, or first // item in print service list otherwise @@ -933,13 +894,11 @@ as.add( PrintRangeType.SELECTION ); } - if ( collate.isSelected() ) { as.add( SheetCollate.COLLATED ); } - as.add( new Copies( ( Integer )copies.getValue() ) ); if (reverse.isSelected()) @@ -954,10 +913,6 @@ return as; } - - - - // print service cell renderer class PrintServiceCellRenderer extends JLabel implements ListCellRenderer <PrintService> { @@ -1003,11 +958,8 @@ } } - - private class PageSetupPanel extends PrinterPanel { - private JComboBox<String> onlyPrint; private JComboBox<String> outputTray; NumericTextField topMarginField; @@ -1015,10 +967,8 @@ NumericTextField rightMarginField; NumericTextField bottomMarginField; - public PageSetupPanel() { - super(); JPanel layoutPanel = new JPanel( new VariableGridLayout( VariableGridLayout.FIXED_NUM_COLUMNS, 2, 6, 6 ) ); layoutPanel.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), jEdit.getProperty( "print.dialog.Layout", "Layout" ) ), BorderFactory.createEmptyBorder( 11, 11, 11, 11 ) ) ); @@ -1116,43 +1066,19 @@ add( content ); // add listeners - pagesPerSide.addActionListener( new ActionListener() - { - - public void actionPerformed( ActionEvent ae ) + pagesPerSide.addActionListener(ae -> { - NumberUp nu = ( NumberUp )pagesPerSide.getSelectedItem(); - if ( nu != null && nu.getValue() == 1 ) + NumberUp nu = (NumberUp) pagesPerSide.getSelectedItem(); + if (nu != null && nu.getValue() == 1) { - pageOrdering.setEnabled( false ); + pageOrdering.setEnabled(false); } } - } ); - paperSize.addActionListener( new ActionListener() - { - - public void actionPerformed( ActionEvent ae ) - { - PageSetupPanel.this.setDefaultMargins(); - } - } - ); - orientation.addActionListener( new ActionListener() - { - - public void actionPerformed( ActionEvent ae ) - { - PageSetupPanel.this.setDefaultMargins(); - } - } - ); - - + paperSize.addActionListener(ae -> PageSetupPanel.this.setDefaultMargins()); + orientation.addActionListener(ae -> PageSetupPanel.this.setDefaultMargins()); } - - // sides renderer class SidesCellRenderer extends JLabel implements ListCellRenderer <Sides> { @@ -1174,10 +1100,6 @@ } } - - - - // orientation renderer class OrientationCellRenderer extends JLabel implements ListCellRenderer <OrientationRequested> { @@ -1199,10 +1121,6 @@ } } - - - - // finishing renderer class FinishingCellRenderer extends JLabel implements ListCellRenderer <Finishings> { @@ -1224,7 +1142,6 @@ } } - public AttributeSet getAttributes() { AttributeSet as = new HashAttributeSet(); @@ -1265,7 +1182,6 @@ as.add( ( OrientationRequested )orientation.getSelectedItem() ); } - Number topMargin = topMarginField.getValue(); Number leftMargin = leftMarginField.getValue(); Number rightMargin = rightMarginField.getValue(); @@ -1282,7 +1198,6 @@ return as; } - // recalculates the media printable area when the printer, paper size, // margin, or orientation changes // returns null on okay, error message otherwise @@ -1293,7 +1208,6 @@ return null; } - // get the printable area for the selected paper size and orientation int units = getUnits(); MediaPrintableArea supportedArea = getSupportedPrintableArea(); @@ -1361,7 +1275,6 @@ return null; } - private MediaPrintableArea getSupportedPrintableArea() { MediaPrintableArea supportedArea = null; @@ -1390,7 +1303,6 @@ return supportedArea; } - private void rotateMargins( float topMargin, float leftMargin, float rightMargin, float bottomMargin, OrientationRequested orientationRequested ) { if ( OrientationRequested.REVERSE_PORTRAIT.equals( orientationRequested ) ) @@ -1422,9 +1334,6 @@ } } - - - // set the values in the margin text fields to be either the minimum // supported by the printer or the last used margins or the currently // set margins, also sets a range on the text fields so the user can't @@ -1468,8 +1377,8 @@ field.setText( integerOnly ? String.valueOf( value.intValue() ) : String.valueOf( value ) ); } - field.setMinValue( integerOnly ? Integer.valueOf( minMargin.intValue() ) : Float.valueOf( minMargin ) ); - field.setMaxValue( integerOnly ? Integer.valueOf( maxMargin.intValue() ) : Float.valueOf( maxMargin ) ); + field.setMinValue( integerOnly ? Integer.valueOf( minMargin.intValue() ) : minMargin); + field.setMaxValue( integerOnly ? Integer.valueOf( maxMargin.intValue() ) : maxMargin); field.setToolTipText( "Min: " + minMargin + ", max: " + maxMargin ); } } @@ -1498,7 +1407,6 @@ mediaSize = MediaSize.getMediaSizeForName( name ); } - float paperWidth = mediaSize.getX( units ); float paperHeight = mediaSize.getY( units ); @@ -1523,7 +1431,6 @@ private float[] getMaximumMargins() { - // get the printable area for the selected paper size and orientation int units = getUnits(); boolean integerOnly = units == MediaPrintableArea.MM; @@ -1563,7 +1470,6 @@ return new float[] {topMargin, leftMargin, rightMargin, bottomMargin}; } - // returns INCH or MM depending on Locale // note that while Canada is mostly metric, Canadian paper sizes // are essentially US ANSI sizes rounded to the nearest 5 mm @@ -1580,17 +1486,13 @@ } } - - private class JobPanel extends PrinterPanel { - private JRadioButton nowButton; private JRadioButton atButton; private JRadioButton holdButton; private JSpinner when; - // need 3 subpanels, Job Details, Print Document, and Finishing public JobPanel() { @@ -1649,19 +1551,10 @@ add( content, BorderLayout.NORTH ); // add listeners - atButton.addActionListener( new ActionListener() - { - - public void actionPerformed( ActionEvent ae ) - { - when.setEnabled( atButton.isSelected() ); - } - } - ); - + atButton.addActionListener(ae -> when.setEnabled( atButton.isSelected() ) + ); } - public AttributeSet getAttributes() { AttributeSet as = new HashAttributeSet(); @@ -1675,7 +1568,6 @@ Date holdUntil = new Date( 0L ); // print now if ( atButton.isSelected() ) { - // print later holdUntil = ( ( SpinnerDateModel )when.getModel() ).getDate(); } @@ -1689,17 +1581,13 @@ holdUntil = later.getTime(); } - as.add( new JobHoldUntil( holdUntil ) ); return as; } } - - private static class Priority { - public static final Priority LOW = new Priority( 1, jEdit.getProperty( "print.dialog.Low", "Low" ) ); public static final Priority MEDIUM = new Priority( 50, jEdit.getProperty( "print.dialog.Medium", "Medium" ) ); public static final Priority HIGH = new Priority( 80, jEdit.getProperty( "print.dialog.High", "High" ) ); @@ -1714,7 +1602,6 @@ this.name = name; } - @Override public String toString() { @@ -1721,7 +1608,6 @@ return name; } - public int getValue() { return value; @@ -1728,15 +1614,11 @@ } } - - private class AdvancedPanel extends PrinterPanel { - private JComboBox<PrintQuality> quality; private JComboBox<Chromaticity> chromaticity; - public AdvancedPanel() { super(); @@ -1763,7 +1645,6 @@ add( content, BorderLayout.NORTH ); } - public AttributeSet getAttributes() { AttributeSet as = new HashAttributeSet(); @@ -1772,20 +1653,14 @@ return as; } - - - - // quality renderer class QualityCellRenderer extends JLabel implements ListCellRenderer <PrintQuality> { - public QualityCellRenderer() { setOpaque( true ); } - public Component getListCellRendererComponent( JList<? extends PrintQuality> list, PrintQuality value, int index, @@ -1797,20 +1672,14 @@ } } - - - - // Chromaticity renderer class ChromaticityCellRenderer extends JLabel implements ListCellRenderer <Chromaticity> { - public ChromaticityCellRenderer() { setOpaque( true ); } - public Component getListCellRendererComponent( JList<? extends Chromaticity> list, Chromaticity value, int index, @@ -1823,11 +1692,8 @@ } } - - private class jEditPanel extends PrinterPanel { - private FontSelector font; private JCheckBox printHeader; private JCheckBox printFooter; @@ -1835,7 +1701,6 @@ private JCheckBox printFolds; private JComboBox<String> tabSize; - public jEditPanel() { super(); @@ -1882,7 +1747,6 @@ add( content, BorderLayout.NORTH ); } - public AttributeSet getAttributes() { jEdit.setFontProperty( "print.font", font.getFont() ); @@ -1895,17 +1759,11 @@ } } - - - - class MyButtonGroup extends ButtonGroup { - // ButtonGroup should have this public MyButtonGroup( AbstractButton... buttons ) { - super(); for ( AbstractButton b : buttons ) { super.add( b ); @@ -1913,7 +1771,6 @@ } } - // map to lookup the names returned from the print service as more human // readable names public void initMessages() @@ -2029,7 +1886,6 @@ messageMap.put( "two-sided-short-edge", jEdit.getProperty( "print.dialog.two-sided-short-edge", "Two Sided, Short Edge" ) ); } - private String getMessage( String key ) { String value = messageMap.get( key ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ker...@us...> - 2023-09-17 18:22:56
|
Revision: 25683 http://sourceforge.net/p/jedit/svn/25683 Author: kerik-sf Date: 2023-09-17 18:22:52 +0000 (Sun, 17 Sep 2023) Log Message: ----------- fix FR#554 add match index to beanshell replace context simple version, working with replace all. 2 variables starting at 0: - `index` is the match index in buffer, - `indexInSel` resets on each selection (in case you want this in multiple selection mode) not implemented: - keep index between Replace button clicks - a global index Modified Paths: -------------- jEdit/trunk/doc/CHANGES.txt jEdit/trunk/doc/users-guide/text-edit.xml jEdit/trunk/org/gjt/sp/jedit/search/SearchAndReplace.java Modified: jEdit/trunk/doc/CHANGES.txt =================================================================== --- jEdit/trunk/doc/CHANGES.txt 2023-09-17 18:01:06 UTC (rev 25682) +++ jEdit/trunk/doc/CHANGES.txt 2023-09-17 18:22:52 UTC (rev 25683) @@ -92,6 +92,8 @@ - Updated java mode for new keywords introduced up to Java 17. (Dale Anson) +- FR #554 add match index to beanshell replace context + }}} }}} Modified: jEdit/trunk/doc/users-guide/text-edit.xml =================================================================== --- jEdit/trunk/doc/users-guide/text-edit.xml 2023-09-17 18:01:06 UTC (rev 25682) +++ jEdit/trunk/doc/users-guide/text-edit.xml 2023-09-17 18:22:52 UTC (rev 25683) @@ -1108,6 +1108,16 @@ if regular expressions are enabled, these contain the values of matched subexpressions.</para> </listitem> + <listitem> + <para><varname>index</varname> -- + if <guibutton>Replace All</guibutton> is used, + the index (starting at 0) of the match in the buffer.</para> + </listitem> + <listitem> + <para><varname>indexInSel</varname> -- + if <guibutton>Replace All</guibutton> is used, + the index (starting at 0) of the match in the selection.</para> + </listitem> </itemizedlist> <para>BeanShell syntax and features are covered in great detail @@ -1167,6 +1177,25 @@ return b;}]]> </programlisting> </informalexample> + + <informalexample> + <para>To renumber items in a markdown list:</para> + <programlisting>^(\s+)[0-9]+\. )</programlisting> + + <para>Replacing it with the following Beanshell snippet:</para> + <programlisting>_1 + index + ". "</programlisting> + <para>I you need to add padding, it looks like this:</para> + <programlisting>String.format("%03d", new Object[]{index})</programlisting> + </informalexample> + + <informalexample> + <para>To add odd/even class to a table row:</para> + <programlisting><tr></programlisting> + + <para>Replacing it with the following Beanshell snippet:</para> + <programlisting><![CDATA["<tr class=\"" + (index % 2 == 0? "even" : "odd") + "\">"]]></programlisting> + </informalexample> + <para>These examples only scratch the surface; the possibilities are endless.</para> </section> Modified: jEdit/trunk/org/gjt/sp/jedit/search/SearchAndReplace.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/search/SearchAndReplace.java 2023-09-17 18:01:06 UTC (rev 25682) +++ jEdit/trunk/org/gjt/sp/jedit/search/SearchAndReplace.java 2023-09-17 18:22:52 UTC (rev 25683) @@ -747,7 +747,7 @@ { s = aSelection; retVal += replaceInSelection(view, textArea, buffer, - matcher, smartCaseReplace, s); + matcher, smartCaseReplace, s, retVal); } if(reverse) @@ -825,7 +825,7 @@ int retVal = 0; retVal += _replace(view,buffer,matcher,start,end, - smartCaseReplace); + smartCaseReplace, 0, 0); if(retVal != 0) return true; @@ -926,7 +926,7 @@ buffer.beginCompoundEdit(); retVal = _replace(view,buffer,matcher, 0,buffer.getLength(), - smartCaseReplace); + smartCaseReplace, 0, 0); } finally { @@ -1131,7 +1131,7 @@ //{{{ replaceInSelection() method private static int replaceInSelection(View view, TextArea textArea, Buffer buffer, SearchMatcher matcher, boolean smartCaseReplace, - Selection s) throws Exception + Selection s, int indexInBuffer) throws Exception { /* if an occurence occurs at the beginning of the selection, the @@ -1145,7 +1145,7 @@ { returnValue = _replace(view,buffer,matcher, s.getStart(),s.getEnd(), - smartCaseReplace); + smartCaseReplace, indexInBuffer, 0); textArea.removeFromSelection(s); textArea.addToSelection(new Selection.Range( @@ -1165,7 +1165,7 @@ returnValue += _replace(view,buffer,matcher, getColumnOnOtherLine(buffer,j,startCol), getColumnOnOtherLine(buffer,j,endCol), - smartCaseReplace); + smartCaseReplace, indexInBuffer, returnValue); } textArea.addToSelection(new Selection.Rect( start,s.getEnd())); @@ -1190,7 +1190,7 @@ */ private static int _replace(View view, JEditBuffer buffer, SearchMatcher matcher, int start, int end, - boolean smartCaseReplace) + boolean smartCaseReplace, int indexInBuffer, int indexInSelection) throws Exception { if(matcher.wholeWord) @@ -1219,7 +1219,7 @@ occur.start, occur.end); int length = replaceOne(view,buffer,occur,offset, - found,smartCaseReplace); + found,smartCaseReplace, indexInBuffer + indexInSelection + occurCount, indexInSelection + occurCount); if(length == -1) offset += occur.end; else @@ -1240,10 +1240,10 @@ */ private static int replaceOne(View view, JEditBuffer buffer, SearchMatcher.Match occur, int offset, CharSequence found, - boolean smartCaseReplace) + boolean smartCaseReplace, int indexInBuffer, int indexInSelection) throws Exception { - String subst = replaceOne(view,buffer,occur,found); + String subst = replaceOne(view,buffer,occur,found, indexInBuffer, indexInSelection); if(smartCaseReplace && ignoreCase) { int strCase = TextUtilities.getStringCase(found); @@ -1271,13 +1271,13 @@ //{{{ replaceOne() method private static String replaceOne(View view, JEditBuffer buffer, - SearchMatcher.Match occur, CharSequence found) + SearchMatcher.Match occur, CharSequence found, int indexInBuffer, int indexInSelection) throws Exception { if(regexp) { if(replaceMethod != null) - return regexpBeanShellReplace(view,buffer,occur); + return regexpBeanShellReplace(view,buffer,occur, indexInBuffer, indexInSelection); else return regexpReplace(occur,found); } @@ -1284,7 +1284,7 @@ else { if(replaceMethod != null) - return literalBeanShellReplace(view,buffer,found); + return literalBeanShellReplace(view,buffer,found, indexInBuffer, indexInSelection); else return replace; } @@ -1292,9 +1292,11 @@ //{{{ regexpBeanShellReplace() method private static String regexpBeanShellReplace(View view, - JEditBuffer buffer, SearchMatcher.Match occur) throws Exception + JEditBuffer buffer, SearchMatcher.Match occur, int indexInBuffer, int indexInSelection) throws Exception { replaceNS.setVariable("buffer", buffer, false); + replaceNS.setVariable("indexInSel", indexInSelection); + replaceNS.setVariable("index", indexInBuffer); for(int i = 0; i < occur.substitutions.length; i++) { replaceNS.setVariable("_" + i, @@ -1411,10 +1413,12 @@ //{{{ literalBeanShellReplace() method private static String literalBeanShellReplace(View view, - JEditBuffer buffer, CharSequence found) + JEditBuffer buffer, CharSequence found, int indexInBuffer, int indexInSelection) throws Exception { replaceNS.setVariable("buffer",buffer); + replaceNS.setVariable("indexInSel", indexInSelection); + replaceNS.setVariable("index", indexInBuffer); replaceNS.setVariable("_0",found); Object obj = BeanShell.runCachedBlock( replaceMethod, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ker...@us...> - 2023-09-17 18:01:09
|
Revision: 25682 http://sourceforge.net/p/jedit/svn/25682 Author: kerik-sf Date: 2023-09-17 18:01:06 +0000 (Sun, 17 Sep 2023) Log Message: ----------- Fix Bug #4128 No special key handling in the Errors dialog Modified Paths: -------------- jEdit/trunk/doc/CHANGES.txt jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java Modified: jEdit/trunk/doc/CHANGES.txt =================================================================== --- jEdit/trunk/doc/CHANGES.txt 2023-09-17 10:34:54 UTC (rev 25681) +++ jEdit/trunk/doc/CHANGES.txt 2023-09-17 18:01:06 UTC (rev 25682) @@ -16,6 +16,8 @@ - Allow user to choose filename when printing to pdf (partial fix for #4115 - Dale Anson) +- Bug #4128 key handling in the Errors dialog uses current keymap. + }}} {{{ Miscellaneous Modified: jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java 2023-09-17 10:34:54 UTC (rev 25681) +++ jEdit/trunk/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java 2023-09-17 18:01:06 UTC (rev 25682) @@ -29,6 +29,7 @@ import org.gjt.sp.jedit.View; import org.gjt.sp.jedit.jEdit; import org.gjt.sp.jedit.GUIUtilities; +import org.gjt.sp.jedit.IPropertyManager; import org.gjt.sp.jedit.gui.EnhancedDialog; import org.gjt.sp.jedit.syntax.SyntaxStyle; import org.gjt.sp.jedit.textarea.JEditEmbeddedTextArea; @@ -217,19 +218,12 @@ printStream = new PrintStream(byteArrayOutputStream); throwables = Log.throwables.toArray(new Throwable[0]); textArea = new JEditEmbeddedTextArea(); - JEditActionSet<JEditBeanShellAction> actionSet = new StandaloneTextArea.StandaloneActionSet(jEdit.getPropertyManager(), + JEditActionSet<JEditBeanShellAction> actionSet = new StandaloneTextArea.StandaloneActionSet(new KeyMapPropertyManager(), textArea, TextArea.class.getResource("textarea.actions.xml")); textArea.addActionSet(actionSet); actionSet.load(); actionSet.initKeyBindings(); - Keymap keymap = jEdit.getKeymapManager().getKeymap(); - String shortcut = keymap.getShortcut("copy.shortcut"); - if (shortcut != null) - textArea.getInputHandler().addKeyBinding(shortcut, "copy"); - String shortcut2 = keymap.getShortcut("copy.shortcut2"); - if (shortcut2 != null) - textArea.getInputHandler().addKeyBinding(shortcut2, "copy"); JPopupMenu menu = new JPopupMenu(); JMenuItem copy = new JMenuItem(jEdit.getProperty("copy.label").replace("$","")); @@ -355,4 +349,22 @@ } } //}}} } //}}} + //{{{ KeyMapPropertyManager class + /** + * Provide the StandaloneTextArea with current key bindings. + * Otherwise moving left/right with the keyboard doesn't work. + */ + private static class KeyMapPropertyManager implements IPropertyManager + { + @Override + public String getProperty(String name) + { + String value = jEdit.getPropertyManager().getProperty(name); + if (value != null) + { + return value; + } + return jEdit.getKeymapManager().getKeymap().getShortcut(name); + } + } //}}} } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-17 10:34:57
|
Revision: 25681 http://sourceforge.net/p/jedit/svn/25681 Author: kpouer Date: 2023-09-17 10:34:54 +0000 (Sun, 17 Sep 2023) Log Message: ----------- refactor system property loading to allow loading of local files Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/PropertyManager.java jEdit/trunk/org/gjt/sp/jedit/jEdit.java Modified: jEdit/trunk/org/gjt/sp/jedit/PropertyManager.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/PropertyManager.java 2023-09-16 21:54:03 UTC (rev 25680) +++ jEdit/trunk/org/gjt/sp/jedit/PropertyManager.java 2023-09-17 10:34:54 UTC (rev 25681) @@ -43,10 +43,20 @@ } //}}} //{{{ loadSystemProps() method - void loadSystemProps(Reader in) - throws IOException + void loadSystemProps(String path) throws IOException { - loadProps(system,in); + var resourceOptional = jEdit.getResourceAsUTF8Text(path); + if (resourceOptional.isPresent()) + { + try (var in = resourceOptional.get()) + { + loadProps(system, in); + } + } + else + { + throw new IOException("Resource not found: " + path); + } } //}}} //{{{ loadSiteProps() method @@ -57,13 +67,20 @@ } //}}} //{{{ loadLocalizationProps() method - void loadLocalizationProps(Reader in) - throws IOException + void loadLocalizationProps(String path) throws IOException { - if (in == null) + var resourceOptional = jEdit.getResourceAsUTF8Text(path); + if (resourceOptional.isPresent()) + { + try (var in = resourceOptional.get()) + { + loadProps(localization, in); + } + } + else + { localization.clear(); - else - loadProps(localization,in); + } } //}}} //{{{ loadUserProps() method Modified: jEdit/trunk/org/gjt/sp/jedit/jEdit.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2023-09-16 21:54:03 UTC (rev 25680) +++ jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2023-09-17 10:34:54 UTC (rev 25681) @@ -3523,13 +3523,19 @@ } //}}} //{{{ getResourceAsUTF8Text() method - private static Reader getResourceAsUTF8Text(String name) + static Optional<Reader> getResourceAsUTF8Text(String name) throws IOException { InputStream bytes = jEdit.class.getResourceAsStream(name); if (bytes == null) { - return null; + // remove first / + var relativePath = name.substring(1); + var path = Path.of(relativePath); + if (Files.exists(path)) + bytes = Files.newInputStream(path); + else + return Optional.empty(); } Reader text = null; try @@ -3545,7 +3551,7 @@ bytes.close(); } } - return text; + return Optional.of(text); } //}}} //{{{ initSystemProperties() method @@ -3556,24 +3562,13 @@ { try { - propMgr.loadSystemProps(getResourceAsUTF8Text( - "/org/gjt/sp/jedit/jedit.props")); - propMgr.loadSystemProps(getResourceAsUTF8Text( - "/org/gjt/sp/jedit/jedit_gui.props")); - propMgr.loadSystemProps(getResourceAsUTF8Text( - "/org/jedit/localization/jedit_en.props")); + propMgr.loadSystemProps("/org/gjt/sp/jedit/jedit.props"); + propMgr.loadSystemProps("/org/gjt/sp/jedit/jedit_gui.props"); + propMgr.loadSystemProps("/org/jedit/localization/jedit_en.props"); } catch(Exception e) { - Log.log(Log.ERROR,jEdit.class, - "Error while loading system properties!"); - Log.log(Log.ERROR,jEdit.class, - "One of the following property files could not be loaded:\n" - + "- jedit.props\n" - + "- jedit_gui.props\n" - + "- jedit_en.props\n" - + "jedit.jar is probably corrupt."); - Log.log(Log.ERROR,jEdit.class,e); + Log.log(Log.ERROR, jEdit.class, "Unable to launch jEdit, jEdit.jar is probably corrupted " + e.getMessage()); System.exit(1); } } //}}} @@ -3710,11 +3705,9 @@ // no need to load english as localization property as it always loaded as default language return; } - Reader langResource = null; try { - langResource = getResourceAsUTF8Text("/org/jedit/localization/jedit_" + language + ".props"); - propMgr.loadLocalizationProps(langResource); + propMgr.loadLocalizationProps("/org/jedit/localization/jedit_" + language + ".props"); } catch (IOException e) { @@ -3724,10 +3717,6 @@ Log.log(Log.ERROR, jEdit.class, "Unable to load language", e); } } - finally - { - IOUtilities.closeQuietly((Closeable)langResource); - } } //}}} //{{{ fontStyleToString() method This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-16 21:54:05
|
Revision: 25680 http://sourceforge.net/p/jedit/svn/25680 Author: kpouer Date: 2023-09-16 21:54:03 +0000 (Sat, 16 Sep 2023) Log Message: ----------- use optional Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java Modified: jEdit/trunk/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java 2023-09-16 21:40:26 UTC (rev 25679) +++ jEdit/trunk/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java 2023-09-16 21:54:03 UTC (rev 25680) @@ -164,9 +164,8 @@ addSeparator(); add(createEncodingMenu()); } - JMenu customMenu = createCustomMenu(); - if (customMenu != null) - { + + createCustomMenu().ifPresent(customMenu -> { addSeparator(); Component[] menuComponents = customMenu.getMenuComponents(); for (Component menuComponent : menuComponents) @@ -173,7 +172,7 @@ { add((JMenuItem) menuComponent); } - } + }); addSeparator(); add(createPluginMenu(browser)); @@ -291,15 +290,15 @@ } //}}} //{{{ createCustomMenu() method - private static JMenu createCustomMenu() + private static Optional<JMenu> createCustomMenu() { if (!jEdit.getProperty("browser.custom.context", "").isEmpty()) { JMenu custom = GUIUtilities.loadMenu(VFSBrowser.getActionContext(), "browser.custom.context"); - return custom; + return Optional.of(custom); } - return null; + return Optional.empty(); } //}}} //{{{ createPluginsMenu() method This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-16 21:40:29
|
Revision: 25679 http://sourceforge.net/p/jedit/svn/25679 Author: kpouer Date: 2023-09-16 21:40:26 +0000 (Sat, 16 Sep 2023) Log Message: ----------- deprecate TaskAdapter as interfaces can now have default implementation Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/browser/AbstractBrowserTask.java jEdit/trunk/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java jEdit/trunk/org/gjt/sp/jedit/gui/StatusBar.java jEdit/trunk/org/gjt/sp/util/TaskAdapter.java jEdit/trunk/org/gjt/sp/util/TaskListener.java Modified: jEdit/trunk/org/gjt/sp/jedit/browser/AbstractBrowserTask.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/browser/AbstractBrowserTask.java 2023-09-16 21:24:27 UTC (rev 25678) +++ jEdit/trunk/org/gjt/sp/jedit/browser/AbstractBrowserTask.java 2023-09-16 21:40:26 UTC (rev 25679) @@ -60,7 +60,7 @@ protected String path; //}}} - private class MyTaskListener extends TaskAdapter + private class MyTaskListener implements TaskListener { private final Runnable runnable; Modified: jEdit/trunk/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java 2023-09-16 21:24:27 UTC (rev 25678) +++ jEdit/trunk/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java 2023-09-16 21:40:26 UTC (rev 25679) @@ -526,7 +526,7 @@ } //}}} //{{{ IoTaskListener class - private class IoTaskHandler extends TaskAdapter + private class IoTaskHandler implements TaskListener { private final Runnable cursorStatus = () -> { Modified: jEdit/trunk/org/gjt/sp/jedit/gui/StatusBar.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/gui/StatusBar.java 2023-09-16 21:24:27 UTC (rev 25678) +++ jEdit/trunk/org/gjt/sp/jedit/gui/StatusBar.java 2023-09-16 21:40:26 UTC (rev 25679) @@ -31,7 +31,7 @@ import org.gjt.sp.jedit.gui.statusbar.StatusBarEventType; import org.gjt.sp.jedit.jEdit; import org.gjt.sp.util.Task; -import org.gjt.sp.util.TaskAdapter; +import org.gjt.sp.util.TaskListener; import org.gjt.sp.util.TaskManager; import javax.annotation.Nullable; @@ -118,7 +118,7 @@ } //}}} //{{{ TaskListener implementation - private class TaskHandler extends TaskAdapter + private class TaskHandler implements TaskListener { private final Runnable statusLineIo = new Runnable() { Modified: jEdit/trunk/org/gjt/sp/util/TaskAdapter.java =================================================================== --- jEdit/trunk/org/gjt/sp/util/TaskAdapter.java 2023-09-16 21:24:27 UTC (rev 25678) +++ jEdit/trunk/org/gjt/sp/util/TaskAdapter.java 2023-09-16 21:40:26 UTC (rev 25679) @@ -3,7 +3,7 @@ * :tabSize=4:indentSize=4:noTabs=false: * :folding=explicit:collapseFolds=1: * - * Copyright © 2011 Matthieu Casanova + * Copyright © 2011-2023 Matthieu Casanova * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -24,7 +24,9 @@ /** * @author Matthieu Casanova * @since jEdit 4.5pre1 + * @deprecated use {@link TaskListener} instead as it now has default methods */ +@Deprecated public abstract class TaskAdapter implements TaskListener { @Override Modified: jEdit/trunk/org/gjt/sp/util/TaskListener.java =================================================================== --- jEdit/trunk/org/gjt/sp/util/TaskListener.java 2023-09-16 21:24:27 UTC (rev 25678) +++ jEdit/trunk/org/gjt/sp/util/TaskListener.java 2023-09-16 21:40:26 UTC (rev 25679) @@ -3,7 +3,7 @@ * :tabSize=4:indentSize=4:noTabs=false: * :folding=explicit:collapseFolds=1: * - * Copyright (C) 2010 Matthieu Casanova + * Copyright (C) 2010-2023 Matthieu Casanova * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -28,11 +28,11 @@ */ public interface TaskListener extends EventListener { - void waiting(Task task); - void running(Task task); - void done(Task task); + default void waiting(Task task) {} + default void running(Task task) {} + default void done(Task task) {} - void statusUpdated(Task task); - void maximumUpdated(Task task); - void valueUpdated(Task task); + default void statusUpdated(Task task) {} + default void maximumUpdated(Task task) {} + default void valueUpdated(Task task) {} } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-16 21:24:30
|
Revision: 25678 http://sourceforge.net/p/jedit/svn/25678 Author: kpouer Date: 2023-09-16 21:24:27 +0000 (Sat, 16 Sep 2023) Log Message: ----------- little cleanup Modified Paths: -------------- jEdit/trunk/org/gjt/sp/util/StringModel.java Modified: jEdit/trunk/org/gjt/sp/util/StringModel.java =================================================================== --- jEdit/trunk/org/gjt/sp/util/StringModel.java 2023-09-16 21:24:12 UTC (rev 25677) +++ jEdit/trunk/org/gjt/sp/util/StringModel.java 2023-09-16 21:24:27 UTC (rev 25678) @@ -2,7 +2,7 @@ import java.awt.event.TextEvent; import java.awt.event.TextListener; -import java.util.Iterator; +import java.util.Deque; import java.util.LinkedList; /** @@ -10,15 +10,13 @@ * than Document when all you need is to store a single string. * * @author ezust - * */ public class StringModel { + private String theText; - String theText = null; + private Deque<TextListener> listeners = new LinkedList<>(); - LinkedList<TextListener> listeners = new LinkedList<TextListener>(); - public void addTextListener(TextListener tl) { listeners.add(tl); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-16 21:24:21
|
Revision: 25677 http://sourceforge.net/p/jedit/svn/25677 Author: kpouer Date: 2023-09-16 21:24:12 +0000 (Sat, 16 Sep 2023) Log Message: ----------- remove use of concat method Modified Paths: -------------- jEdit/trunk/org/gjt/sp/util/GenericGUIUtilities.java Modified: jEdit/trunk/org/gjt/sp/util/GenericGUIUtilities.java =================================================================== --- jEdit/trunk/org/gjt/sp/util/GenericGUIUtilities.java 2023-09-16 21:23:50 UTC (rev 25676) +++ jEdit/trunk/org/gjt/sp/util/GenericGUIUtilities.java 2023-09-16 21:24:12 UTC (rev 25677) @@ -69,12 +69,12 @@ public static String prettifyMenuLabel(String label) { int index = label.indexOf('$'); + var result = label; if(index != -1) { - label = label.substring(0,index) - .concat(label.substring(index + 1)); + result = label.substring(0, index) + label.substring(index + 1); } - return label; + return result; } //}}} //{{{ setAutoMnemonic() method @@ -92,7 +92,7 @@ if (index != -1 && label.length() - index > 1) { mnemonic = Character.toLowerCase(label.charAt(index + 1)); - label = label.substring(0, index).concat(label.substring(++index)); + label = label.substring(0, index) + label.substring(++index); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-16 21:23:55
|
Revision: 25676 http://sourceforge.net/p/jedit/svn/25676 Author: kpouer Date: 2023-09-16 21:23:50 +0000 (Sat, 16 Sep 2023) Log Message: ----------- remove unused import Modified Paths: -------------- jEdit/trunk/org/gjt/sp/util/EnhancedTreeCellRenderer.java Modified: jEdit/trunk/org/gjt/sp/util/EnhancedTreeCellRenderer.java =================================================================== --- jEdit/trunk/org/gjt/sp/util/EnhancedTreeCellRenderer.java 2023-09-16 21:18:38 UTC (rev 25675) +++ jEdit/trunk/org/gjt/sp/util/EnhancedTreeCellRenderer.java 2023-09-16 21:23:50 UTC (rev 25676) @@ -26,7 +26,6 @@ import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreeCellRenderer; import java.awt.*; -import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Map; import java.util.WeakHashMap; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-16 21:18:40
|
Revision: 25675 http://sourceforge.net/p/jedit/svn/25675 Author: kpouer Date: 2023-09-16 21:18:38 +0000 (Sat, 16 Sep 2023) Log Message: ----------- add a few unit tests for GenericUtilities Added Paths: ----------- jEdit/trunk/test/org/gjt/sp/util/GenericGUIUtilitiesTest.java Added: jEdit/trunk/test/org/gjt/sp/util/GenericGUIUtilitiesTest.java =================================================================== --- jEdit/trunk/test/org/gjt/sp/util/GenericGUIUtilitiesTest.java (rev 0) +++ jEdit/trunk/test/org/gjt/sp/util/GenericGUIUtilitiesTest.java 2023-09-16 21:18:38 UTC (rev 25675) @@ -0,0 +1,47 @@ +/* + * jEdit - Programmer's Text Editor + * :tabSize=8:indentSize=8:noTabs=false: + * :folding=explicit:collapseFolds=1: + * + * Copyright © 2023 jEdit contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.gjt.sp.util; + +import org.junit.Test; + +import javax.swing.*; + +import static org.junit.Assert.assertEquals; + +public class GenericGUIUtilitiesTest { + + @Test + public void prettifyMenuLabel() { + assertEquals("File", GenericGUIUtilities.prettifyMenuLabel("File")); + assertEquals("File", GenericGUIUtilities.prettifyMenuLabel("$File")); + assertEquals("New in Mode", GenericGUIUtilities.prettifyMenuLabel("New in $Mode")); + } + + @Test + public void testSetAutoMnemonic() { + var button = new JButton("$Plugins"); + GenericGUIUtilities.setAutoMnemonic(button); + // see AbstractButton.setMnemonic() + assertEquals('p' - ('a' - 'A'), button.getMnemonic()); + assertEquals("Plugins", button.getText()); + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-16 21:05:03
|
Revision: 25674 http://sourceforge.net/p/jedit/svn/25674 Author: kpouer Date: 2023-09-16 21:05:01 +0000 (Sat, 16 Sep 2023) Log Message: ----------- fix the test using jUnit 4 Modified Paths: -------------- jEdit/trunk/test/org/gjt/sp/util/IOUtilitiesTest.java Modified: jEdit/trunk/test/org/gjt/sp/util/IOUtilitiesTest.java =================================================================== --- jEdit/trunk/test/org/gjt/sp/util/IOUtilitiesTest.java 2023-09-16 20:41:41 UTC (rev 25673) +++ jEdit/trunk/test/org/gjt/sp/util/IOUtilitiesTest.java 2023-09-16 21:05:01 UTC (rev 25674) @@ -21,29 +21,29 @@ package org.gjt.sp.util; -import org.junit.jupiter.api.Test; +import org.junit.Test; import java.io.File; import java.io.IOException; import java.nio.file.Files; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; -class IOUtilitiesTest { - +public class IOUtilitiesTest { public static final String CONTENT = "Hello World"; @Test - void moveFile() throws IOException { + public void moveFile() throws IOException { var source = buildTmpSourceFile(); var target = new File(source.getParentFile(), "destination.txt"); IOUtilities.moveFile(source, target); - assertFalse(source.exists(), "Source file still exists"); - assertEquals(CONTENT, Files.readString(target.toPath()), "The destination file do not exist or has a different content"); + assertFalse("Source file still exists", source.exists()); + assertEquals("The destination file do not exist or has a different content", CONTENT, Files.readString(target.toPath())); } @Test - void testFileLength() throws IOException { + public void testFileLength() throws IOException { var source = buildTmpSourceFile(); assertEquals(CONTENT.length(), IOUtilities.fileLength(source)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-16 20:41:44
|
Revision: 25673 http://sourceforge.net/p/jedit/svn/25673 Author: kpouer Date: 2023-09-16 20:41:41 +0000 (Sat, 16 Sep 2023) Log Message: ----------- add a unit test for IOUtilities Added Paths: ----------- jEdit/trunk/test/org/gjt/sp/util/IOUtilitiesTest.java Added: jEdit/trunk/test/org/gjt/sp/util/IOUtilitiesTest.java =================================================================== --- jEdit/trunk/test/org/gjt/sp/util/IOUtilitiesTest.java (rev 0) +++ jEdit/trunk/test/org/gjt/sp/util/IOUtilitiesTest.java 2023-09-16 20:41:41 UTC (rev 25673) @@ -0,0 +1,57 @@ +/* + * jEdit - Programmer's Text Editor + * :tabSize=8:indentSize=8:noTabs=false: + * :folding=explicit:collapseFolds=1: + * + * Copyright © 2023 jEdit contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.gjt.sp.util; + +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; + +import static org.junit.jupiter.api.Assertions.*; + +class IOUtilitiesTest { + + public static final String CONTENT = "Hello World"; + + @Test + void moveFile() throws IOException { + var source = buildTmpSourceFile(); + var target = new File(source.getParentFile(), "destination.txt"); + IOUtilities.moveFile(source, target); + assertFalse(source.exists(), "Source file still exists"); + assertEquals(CONTENT, Files.readString(target.toPath()), "The destination file do not exist or has a different content"); + } + + @Test + void testFileLength() throws IOException { + var source = buildTmpSourceFile(); + assertEquals(CONTENT.length(), IOUtilities.fileLength(source)); + } + + private static File buildTmpSourceFile() throws IOException { + var source = File.createTempFile("source", ".txt"); + source.deleteOnExit(); + Files.writeString(source.toPath(), CONTENT); + return source; + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-16 20:00:43
|
Revision: 25672 http://sourceforge.net/p/jedit/svn/25672 Author: kpouer Date: 2023-09-16 20:00:40 +0000 (Sat, 16 Sep 2023) Log Message: ----------- Fix the case where the env variable contains \ then we want to see them in the resulting String Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java Modified: jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java 2023-09-16 19:59:56 UTC (rev 25671) +++ jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java 2023-09-16 20:00:40 UTC (rev 25672) @@ -141,8 +141,10 @@ { String varName = m.group(2); String expansion = System.getenv(varName); - if (expansion != null) + if (expansion != null) { + expansion = expansion.replace("\\", "\\\\"); return m.replaceFirst(expansion); + } } return unixPath; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kp...@us...> - 2023-09-16 19:59:57
|
Revision: 25671 http://sourceforge.net/p/jedit/svn/25671 Author: kpouer Date: 2023-09-16 19:59:56 +0000 (Sat, 16 Sep 2023) Log Message: ----------- The unit test should not depends on the execution environment Modified Paths: -------------- jEdit/trunk/test/org/gjt/sp/jedit/MiscUtilitiesTest.java Modified: jEdit/trunk/test/org/gjt/sp/jedit/MiscUtilitiesTest.java =================================================================== --- jEdit/trunk/test/org/gjt/sp/jedit/MiscUtilitiesTest.java 2023-09-07 20:14:30 UTC (rev 25670) +++ jEdit/trunk/test/org/gjt/sp/jedit/MiscUtilitiesTest.java 2023-09-16 19:59:56 UTC (rev 25671) @@ -30,6 +30,7 @@ import java.io.File; import java.lang.reflect.Field; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -174,16 +175,14 @@ updateOS(WINDOWS_NT); assertEquals(value, MiscUtilities.expandVariables("%" + key + '%')); } - @Test public void expandVariablesEnvWindowsAsUnix() throws Exception { - Map<String, String> env = System.getenv(); - Map.Entry<String, String> firstEntry = env.entrySet().iterator().next(); - String key = firstEntry.getKey(); - String value = firstEntry.getValue(); + var key = "jEdit_TEST"; + var value = "c:\\home\\jEdit"; + setEnv(Map.of(key, value)); updateOS(UNIX); - assertEquals(value, MiscUtilities.expandVariables("%" + key + '%')); + assertEquals(value, MiscUtilities.expandVariables('%' + key + '%')); } @Test @@ -197,6 +196,33 @@ assertEquals(value, MiscUtilities.expandVariables("$" + key)); } + private static void setEnv(Map<String, String> newenv) throws Exception { + try { + var processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment"); + Field theEnvironmentField = processEnvironmentClass.getDeclaredField("theEnvironment"); + theEnvironmentField.setAccessible(true); + var env = (Map<String, String>) theEnvironmentField.get(null); + env.putAll(newenv); + Field theCaseInsensitiveEnvironmentField = processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment"); + theCaseInsensitiveEnvironmentField.setAccessible(true); + var cienv = (Map<String, String>) theCaseInsensitiveEnvironmentField.get(null); + cienv.putAll(newenv); + } catch (NoSuchFieldException e) { + Class[] classes = Collections.class.getDeclaredClasses(); + Map<String, String> env = System.getenv(); + for(var cl : classes) { + if("java.util.Collections$UnmodifiableMap".equals(cl.getName())) { + Field field = cl.getDeclaredField("m"); + field.setAccessible(true); + var obj = field.get(env); + var map = (Map<String, String>) obj; + map.clear(); + map.putAll(newenv); + } + } + } + } + @Test public void expandVariablesEnvUnix2() throws Exception { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dal...@us...> - 2023-09-07 20:14:38
|
Revision: 25670 http://sourceforge.net/p/jedit/svn/25670 Author: daleanson Date: 2023-09-07 20:14:30 +0000 (Thu, 07 Sep 2023) Log Message: ----------- Removed the json beautifier as I moved it to be a separate plugin. Modified Paths: -------------- plugins/Beauty/trunk/Beauty.props plugins/Beauty/trunk/beauty_build.xml plugins/Beauty/trunk/services.xml plugins/Beauty/trunk/src/docs/index.html Removed Paths: ------------- plugins/Beauty/trunk/ant_json_test.xml plugins/Beauty/trunk/src/beauty/beautifiers/JsonBeautifier.java plugins/Beauty/trunk/src/beauty/options/JsonOptionPane.java plugins/Beauty/trunk/src/beauty/parsers/json/ Modified: plugins/Beauty/trunk/Beauty.props =================================================================== --- plugins/Beauty/trunk/Beauty.props 2023-09-07 19:55:37 UTC (rev 25669) +++ plugins/Beauty/trunk/Beauty.props 2023-09-07 20:14:30 UTC (rev 25670) @@ -9,7 +9,7 @@ plugin.beauty.BeautyPlugin.docs=docs/index.html plugin.beauty.BeautyPlugin.depend.0=jdk 11 plugin.beauty.BeautyPlugin.depend.1=jedit 05.06.00.00 -plugin.beauty.BeautyPlugin.depend.2=plugin CommonControlsPlugin 1.7.5 +plugin.beauty.BeautyPlugin.depend.2=plugin CommonControlsPlugin 1.7.4 plugin.beauty.BeautyPlugin.depend.3=plugin antlr.AntlrPlugin 4.10 plugin.beauty.BeautyPlugin.usePluginHome=true @@ -27,7 +27,7 @@ # # Option pane properties # -plugin.beauty.BeautyPlugin.option-group=beauty.general beauty.beautifiers beauty.custom beauty.css beauty.jsp beauty.java beauty.json +plugin.beauty.BeautyPlugin.option-group=beauty.general beauty.beautifiers beauty.custom beauty.css beauty.jsp beauty.java options.beauty.general.title=General options.beauty.general.label=General @@ -55,10 +55,6 @@ options.beauty.java.label=Java Beautifier options.beauty.java.code=new beauty.options.JavaOptionPane(); -options.beauty.json.title=JSON Beautifier -options.beauty.json.label=JSON Beautifier -options.beauty.json.code=new beauty.options.JsonOptionPane(); - # mode handlers mode.html.beauty.beautifier=html mode.asp.beauty.beautifier=html @@ -72,7 +68,6 @@ mode.java.beauty.beautifier=java8 mode.javacc.beauty.beautifier=javacc mode.csv.beauty.beautifier=csv -mode.json.beauty.beautifier=json # Menus plugin.beauty.BeautyPlugin.menu=make_it_pretty Deleted: plugins/Beauty/trunk/ant_json_test.xml =================================================================== --- plugins/Beauty/trunk/ant_json_test.xml 2023-09-07 19:55:37 UTC (rev 25669) +++ plugins/Beauty/trunk/ant_json_test.xml 2023-09-07 20:14:30 UTC (rev 25670) @@ -1,82 +0,0 @@ -<project name="json_test" default="test" basedir="." xmlns:if="ant:if" xmlns:unless="ant:unless"> - - <echo> -============================== -===== JSON Tests ===== -============================== - </echo> - - <!-- ======================================================================== - Target: set classpath - ========================================================================= --> - <target name="setClasspath"> - <path id="classpathref"> - <!-- required locations/jars --> - <pathelement location="${classes.dir}" /> - <pathelement path="${java.class.path}"/> - - <!-- required for jEdit plugin --> - <pathelement location="${jedit.install.dir}/jedit.jar" /> - - <!-- dependencies --> - <pathelement location="${jedit.plugins.dir}/kappalayout.jar"/> - <pathelement location="${jedit.plugins.dir}/antlr-4.10.1-complete.jar"/> - </path> - </target> - - <target name="test" depends="test1, test2, test3, test4"> - </target> - - <target name="test1" depends="setClasspath"> - <java classname="beauty.parsers.json.JSONBeautyListener" fork="true" output="./test/test_files/json/after/test1.json"> - <classpath refid="classpathref"/> - <arg file="./test/test_files/json/before/test1.json"/> - </java> - <condition property="test1" value="true"> - <filesmatch file1="./test/test_files/java/after/test1.java" - file2="./test/test_files/java/expected/test1.java" /> - </condition> - <echo if:set="test1">test1 passed</echo> - <fail unless:set="test1">test1 failed: ${test1diff}</fail> - </target> - - <target name="test2" depends="setClasspath"> - <java classname="beauty.parsers.json.JSONBeautyListener" fork="true" output="./test/test_files/json/after/test2.json" > - <classpath refid="classpathref"/> - <arg file="./test/test_files/json/before/test2.json"/> - </java> - <condition property="test2" value="true"> - <filesmatch file1="./test/test_files/java/after/test2.java" - file2="./test/test_files/java/expected/test2.java" /> - </condition> - <echo if:set="test2">test2 passed</echo> - <fail unless:set="test2">test2 failed: ${test2diff}</fail> - </target> - - <target name="test3" depends="setClasspath"> - <java classname="beauty.parsers.json.JSONBeautyListener" fork="true" output="./test/test_files/json/after/test3.json"> - <classpath refid="classpathref"/> - <arg file="./test/test_files/json/before/test3.json"/> - </java> - <condition property="test3" value="true"> - <filesmatch file1="./test/test_files/java/after/test3.java" - file2="./test/test_files/java/expected/test3.java" /> - </condition> - <echo if:set="test3">test3 passed</echo> - <fail unless:set="test3">test3 failed: ${test3diff}</fail> - </target> - - <target name="test4" depends="setClasspath"> - <java classname="beauty.parsers.json.JSONBeautyListener" fork="true" output="./test/test_files/json/after/test4.json" > - <classpath refid="classpathref"/> - <arg file="./test/test_files/json/before/test4.json"/> - </java> - <condition property="test4" value="true"> - <filesmatch file1="./test/test_files/java/after/test4.java" - file2="./test/test_files/java/expected/test4.java" /> - </condition> - <echo if:set="test4">test4 passed</echo> - <fail unless:set="test4">test4 failed: ${test4diff}</fail> - </target> - -</project> \ No newline at end of file Modified: plugins/Beauty/trunk/beauty_build.xml =================================================================== --- plugins/Beauty/trunk/beauty_build.xml 2023-09-07 19:55:37 UTC (rev 25669) +++ plugins/Beauty/trunk/beauty_build.xml 2023-09-07 20:14:30 UTC (rev 25670) @@ -292,6 +292,5 @@ <target name="test"> <ant antfile="ant_java_test.xml" /> - <ant antfile="ant_json_test.xml" /> </target> </project> Modified: plugins/Beauty/trunk/services.xml =================================================================== --- plugins/Beauty/trunk/services.xml 2023-09-07 19:55:37 UTC (rev 25669) +++ plugins/Beauty/trunk/services.xml 2023-09-07 20:14:30 UTC (rev 25670) @@ -18,9 +18,6 @@ <SERVICE CLASS="beauty.beautifiers.Beautifier" NAME="css:beauty"> new beauty.beautifiers.CSSBeautifier(); </SERVICE> - <SERVICE CLASS="beauty.beautifiers.Beautifier" NAME="json:beauty"> - new beauty.beautifiers.JsonBeautifier(); - </SERVICE> <SERVICE CLASS="beauty.beautifiers.Beautifier" NAME="beanshell:beauty"> new beauty.beautifiers.BSHBeautifier(); </SERVICE> Deleted: plugins/Beauty/trunk/src/beauty/beautifiers/JsonBeautifier.java =================================================================== --- plugins/Beauty/trunk/src/beauty/beautifiers/JsonBeautifier.java 2023-09-07 19:55:37 UTC (rev 25669) +++ plugins/Beauty/trunk/src/beauty/beautifiers/JsonBeautifier.java 2023-09-07 20:14:30 UTC (rev 25670) @@ -1,61 +0,0 @@ - -package beauty.beautifiers; - -import beauty.parsers.ErrorListener; -import beauty.parsers.ParserException; -import beauty.parsers.json.*; - -import java.io.*; -import java.util.*; - -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.tree.*; - -import org.gjt.sp.jedit.jEdit; - - -public class JsonBeautifier extends Beautifier { - - public String beautify( String text ) throws ParserException { - ErrorListener errorListener = null; - try { - - // set up the parser - StringReader input = new StringReader( text ); - CharStream antlrInput = CharStreams.fromReader( input ); - JSONLexer lexer = new JSONLexer( antlrInput ); - CommonTokenStream tokens = new CommonTokenStream( lexer ); - JSONParser jsonParser = new JSONParser( tokens ); - JSONBeautyListener listener = new JSONBeautyListener( getUseSoftTabs(), getTabWidth() ); - listener.setBracketStyle( jEdit.getIntegerProperty( "beauty.json.bracketStyle", JSONBeautyListener.BROKEN ) ); - - // add an error handler that stops beautifying on any parsing error - jsonParser.removeErrorListeners(); - errorListener = new ErrorListener(); - jsonParser.addErrorListener( errorListener ); - jsonParser.setErrorHandler( new DefaultErrorStrategy() ); - - // parse and beautify the buffer contents - ParseTreeWalker walker = new ParseTreeWalker(); - ParseTree tree = jsonParser.json(); - walker.walk( listener, tree ); - - return listener.getText(); - } - catch ( Exception e ) { - e.printStackTrace(); - java.util.List<ParserException> errors = errorListener.getErrors(); - - if ( errors != null && errors.size() > 0 ) { - StringBuilder sb = new StringBuilder(); - for (ParserException pe : errors) { - sb.append(pe.getMessage()); - } - throw new ParserException(sb.toString()); - } - else { - throw new ParserException( e ); - } - } - } -} Deleted: plugins/Beauty/trunk/src/beauty/options/JsonOptionPane.java =================================================================== --- plugins/Beauty/trunk/src/beauty/options/JsonOptionPane.java 2023-09-07 19:55:37 UTC (rev 25669) +++ plugins/Beauty/trunk/src/beauty/options/JsonOptionPane.java 2023-09-07 20:14:30 UTC (rev 25670) @@ -1,84 +0,0 @@ - -package beauty.options; - -import beauty.parsers.json.JSONBeautyListener; - -import ise.java.awt.*; - -import java.awt.*; -import java.awt.event.*; -import java.io.*; -import java.util.*; - -import javax.swing.*; -import javax.swing.event.*; -import javax.swing.table.*; - -import org.gjt.sp.jedit.*; -import org.gjt.sp.jedit.msg.*; - - -/** -* An option pane to configure settings for the built-in Json beautifier. -*/ -public class JsonOptionPane extends AbstractOptionPane { - - private JRadioButton attachedBrackets; - private JRadioButton brokenBrackets; - private int bracketStyle; - - public JsonOptionPane() { - super( "beauty.json" ); - bracketStyle = jEdit.getIntegerProperty( "beauty.json.bracketStyle", JSONBeautyListener.ATTACHED ); - } - - // called when this class is first accessed - public void _init() { - installComponents(); - } - - // create the user interface components and do the layout - private void installComponents() { - setLayout( new KappaLayout() ); - setBorder( BorderFactory.createEmptyBorder( 6, 6, 6, 6 ) ); - - // create the components - attachedBrackets = new JRadioButton( "<html>" + jEdit.getProperty( "beauty.msg.Use_attached_brackets,_e.g.", "Use attached brackets, e.g." ) + "<br> object: {" ); - brokenBrackets = new JRadioButton( "<html>" + jEdit.getProperty( "beauty.msg.Use_broken_brackets,_e.g.", "Use broken brackets, e.g." ) + "<br>object:<br>{" ); - - ButtonGroup bg = new ButtonGroup(); - bg.add( attachedBrackets ); - bg.add( brokenBrackets ); - - switch ( bracketStyle ) { - case JSONBeautyListener.ATTACHED: - attachedBrackets.setSelected( true ); - brokenBrackets.setSelected( false ); - break; - case JSONBeautyListener.BROKEN: - attachedBrackets.setSelected( false ); - brokenBrackets.setSelected( true ); - break; - } - - ActionListener al = new ActionListener(){ - - public void actionPerformed( ActionEvent ae ) { - if ( attachedBrackets.equals( ae.getSource() ) ) { - bracketStyle = JSONBeautyListener.ATTACHED; - } - else if ( brokenBrackets.equals( ae.getSource() ) ) { - bracketStyle = JSONBeautyListener.BROKEN; - } - } - }; - attachedBrackets.addActionListener( al ); - brokenBrackets.addActionListener( al ); - add( "0, 1, 1, 1, W, w, 3", attachedBrackets ); - add( "0, 2, 1, 1, W, w, 3", brokenBrackets ); - } - - public void _save() { - jEdit.setIntegerProperty( "beauty.json.bracketStyle", bracketStyle ); - } -} Modified: plugins/Beauty/trunk/src/docs/index.html =================================================================== --- plugins/Beauty/trunk/src/docs/index.html 2023-09-07 19:55:37 UTC (rev 25669) +++ plugins/Beauty/trunk/src/docs/index.html 2023-09-07 20:14:30 UTC (rev 25670) @@ -36,7 +36,7 @@ <li>CSS: works very well. The JSP beautifier delegates to this beautifier to clean up style blocks within JSP files.</li> <li>Java: works very well, supports all Java versions through 17. Formats closely to Sun's formatting standard, with some formatting options available in the plugin settings.</li> <li>JavaCC: needs work, formats to a combination of Sun's Java formatting standard and my own style for javacc files.</li> - <li>JSON: works very well. JSON files are usually machine-generated in a single long line, so it is nice to be able to format them quickly to a more human-readable format.</li> + <li>JSON: Moved to a separate plugin, look for "JSON" in the PluginManager.</li> <li>Beanshell: Works very well. It generally follows Sun's formatting standard for java files, although beanshell code is slightly different from java code, so there are some minor differences.</li> <li>CSV: Works very well. All this one does is align the columns to make them easier to read, or collapses the columns if they are already aligned. Note this is only for COMMA separated files, other separators (e.g. tab or semi-colon) are not supported at this time.</li> </ul> @@ -46,6 +46,7 @@ <li>AStyle: a nice, configurable beautifier for Java, C, and C++ code.</li> <li>CLangBeauty: supports formatting C, C++, and Objective-C code.</li> <li>JSBeautifierBeauty: formats Javascript/Ecmascript, HTML, and CSS.</li> + <li>JSON: formats json files, also provides a SideKick and a json minimizer.</li> <li>XmlIndenter: part of the XML plugin, this beautifier works on all xml-based files. Use this for well-formed xml dialects like docbook files, Ant files, and so on, use the HTML beautifier for those xml-like files that are not necessarily well-formed.</li> </ul> <p> @@ -404,7 +405,7 @@ <br> <SERVICES> <br> - <SERVICE CLASS="beauty.beautifiers.Beautifier" NAME="lispy"> + <SERVICE CLASS="beauty.beautifiers.Beautifier" NAME="lisp:lispy"> <br> new lisp.lispy.Beautify(); <br> @@ -417,7 +418,8 @@ <code> NAME </code> - , either use the name of the editing mode that the beautifier supports, or a unique name for your plugin. The beanshell code must return an object that can be cast to + , either use the name of the editing mode that the beautifier supports, or a <strong>unique</strong> name for your plugin. The preferred naming scheme is mode_name:plugin_name, like "lisp:lispy" above. + This allows the user to choose their desired plugin for formatting, for example, the astyle, beauty, and clang plugins all provide beautifying for java code. The beanshell code must return an object that can be cast to <code> beauty.beautifiers.Beautifier </code> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dal...@us...> - 2023-09-07 19:55:39
|
Revision: 25669 http://sourceforge.net/p/jedit/svn/25669 Author: daleanson Date: 2023-09-07 19:55:37 +0000 (Thu, 07 Sep 2023) Log Message: ----------- Tagging for release. This is the initial release for this plugin, but it is a combination of the JSON sidekick from the XML plugin and the JSON beautifier from the Beauty plugin. Added Paths: ----------- plugins/JSON/tags/4.10/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dal...@us...> - 2023-09-07 19:53:40
|
Revision: 25668 http://sourceforge.net/p/jedit/svn/25668 Author: daleanson Date: 2023-09-07 19:53:38 +0000 (Thu, 07 Sep 2023) Log Message: ----------- PMD is your friend Modified Paths: -------------- plugins/JSON/trunk/src/json/options/JSONOptionPane.java Modified: plugins/JSON/trunk/src/json/options/JSONOptionPane.java =================================================================== --- plugins/JSON/trunk/src/json/options/JSONOptionPane.java 2023-09-07 19:53:17 UTC (rev 25667) +++ plugins/JSON/trunk/src/json/options/JSONOptionPane.java 2023-09-07 19:53:38 UTC (rev 25668) @@ -23,7 +23,6 @@ */ public class JSONOptionPane extends AbstractOptionPane { - private JLabel beautifierLabel; private JRadioButton attachedBrackets; private JRadioButton brokenBrackets; private int bracketStyle; @@ -44,7 +43,7 @@ setBorder( BorderFactory.createEmptyBorder( 6, 6, 6, 6 ) ); // create the components - beautifierLabel = new JLabel("<html><strong>JSON Beautifier"); + JLabel beautifierLabel = new JLabel("<html><strong>JSON Beautifier"); // Note that the Beauty plugin is a dependency, so it's okay to use // these properties from that plugin This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |