You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2019/04/07 12:30:40 UTC

[lucene-solr] branch jira/lucene-2562-luke-swing-3 created (now 846f3d3)

This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a change to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


      at 846f3d3  Merge branch 'master' of https://gitbox.apache.org/repos/asf/lucene-solr into jira/lucene-2562-luke-swing-3

This branch includes the following new commits:

     new f35eb29  Use Objects#equals() instead of String comparison.
     new cce4daf  Remove unused logger configuration, set root log level to INFO
     new d220ee0  Move images, fonts and message files to /org/apache/lucene/luke from the root directory.
     new 890cda8  Remove obsolete dependency (we have no external dependency anmore that uses log4j v1)
     new 0a87a79  Merge branch 'jira/lucene-2562-luke-swing-3' of https://github.com/mocobeta/lucene-solr-mirror into jira/lucene-2562-luke-swing-3
     new 2594f73  Remove log4j2 configuration file, instead configurate programatically
     new 85be0a4  Simplify the TextAreaPrintStream and remove unused params (it's a hack anyways): TODO: Change CheckIndex and Optimize to use Appendable instead of PrintStream
     new aa2aa47  Add javadocs
     new 9e16265  Resolve conflicts
     new 3bb115e  Optimize imports
     new 7670f35  Remove obsolete licenses
     new c2498b6  Remove obsolete ivy-ignore-conflicts entry
     new 78888f4  Fix LoggerFactory to use default LogContext only when running tests
     new 529ded4  Better log setup (test detection was removed). This also passes security manager.
     new cdec24f  Merge branch 'jira/lucene-2562-luke-swing-3' of https://github.com/mocobeta/lucene-solr-mirror into jira/lucene-2562-luke-swing-3
     new 3470951  Change logging a bit: do textarea update async; fix locking; centralize name of log file
     new 12c380b  Fix compile warnings/unused code; fix some of the auxiliary classes (those who compiler complained)
     new 18e175d  Remove dead code
     new b127c0a  make log viewer not editable; change comment in build file
     new 18b28f3  Fix javadocs build
     new d1b40dc  Make auxiliary classes static inner classes
     new ea28ce0  Rename 'launch' target to 'run'
     new e5468ef  Use our classloader instead of system classloader, so we can be sure that all Lucene classes are there
     new 9e37f85  Show implementation version in the About dialog.
     new 89de76a  Show implementation version if it is not null, otherwise empty string.
     new 2276966  Fix broken image path.
     new ad714e5  Set scroll bar position to top of the pane.
     new 3bbf0f8  Improve sample documents indexing: term vectors, index options, doc values
     new 1a32f85  Fix term vectors dialog size.
     new 7fd7698  Add the hyperlink to 20 Newsgroups corpus page
     new 3cd6def  Execute IndexTools#createNewIndex() asynchronously.
     new 5ad6fab  Fix message.
     new 6e424f5  Remove all items when reset searchable fields.
     new 846f3d3  Merge branch 'master' of https://gitbox.apache.org/repos/asf/lucene-solr into jira/lucene-2562-luke-swing-3

The 34 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[lucene-solr] 20/34: Fix javadocs build

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 18b28f3dec93851bf9e2a7126e77d2ca7f7dcaa2
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 20:57:15 2019 +0200

    Fix javadocs build
---
 lucene/luke/build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lucene/luke/build.xml b/lucene/luke/build.xml
index aded5b1..d72fb29 100644
--- a/lucene/luke/build.xml
+++ b/lucene/luke/build.xml
@@ -42,7 +42,7 @@
     <path refid="base.classpath"/>
   </path>
 
-  <target name="javadocs" depends="compile-core,check-javadocs-uptodate"
+  <target name="javadocs" depends="compile-core,javadocs-lucene-core,javadocs-analyzers-common,check-javadocs-uptodate"
           unless="javadocs-uptodate-${name}">
     <invoke-module-javadoc>
       <links>


[lucene-solr] 19/34: make log viewer not editable; change comment in build file

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit b127c0a3f519c3d8d162597f30956c5e2b11f78f
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 20:08:04 2019 +0200

    make log viewer not editable; change comment in build file
---
 lucene/luke/build.xml                                                   | 2 +-
 .../apache/lucene/luke/app/desktop/components/LukeWindowProvider.java   | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/lucene/luke/build.xml b/lucene/luke/build.xml
index 27d999f..aded5b1 100644
--- a/lucene/luke/build.xml
+++ b/lucene/luke/build.xml
@@ -71,7 +71,7 @@
     </java>
   </target>
   
-  <target name="run" depends="launch" description="Launch Luke GUI"/>
+  <target name="run" depends="launch"/><!-- alias -->
 
   <target name="compile-core"
           depends="jar-codecs,jar-backward-codecs,jar-analyzers-common,jar-misc,jar-queryparser,jar-queries,jar-misc,common.compile-core"/>
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LukeWindowProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LukeWindowProvider.java
index 347a8bf..faf5c1c 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LukeWindowProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LukeWindowProvider.java
@@ -76,6 +76,7 @@ public final class LukeWindowProvider implements LukeWindowOperator {
   public LukeWindowProvider() throws IOException {
     // prepare log4j appender for Logs tab.
     JTextArea logTextArea = new JTextArea();
+    logTextArea.setEditable(false);
     TextAreaAppender.setTextArea(logTextArea);
 
     this.prefs = PreferencesFactory.getInstance();


[lucene-solr] 33/34: Remove all items when reset searchable fields.

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 6e424f5124c6f39fc522d7fbc33fa4c25ae974a7
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sun Apr 7 16:07:26 2019 +0900

    Remove all items when reset searchable fields.
---
 .../app/desktop/components/fragments/search/QueryParserPaneProvider.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/QueryParserPaneProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/QueryParserPaneProvider.java
index ab4ab78..f565339 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/QueryParserPaneProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/QueryParserPaneProvider.java
@@ -321,6 +321,7 @@ public final class QueryParserPaneProvider implements QueryParserTabOperator {
 
   @Override
   public void setSearchableFields(Collection<String> searchableFields) {
+    dfCB.removeAllItems();
     for (String field : searchableFields) {
       dfCB.addItem(field);
     }


[lucene-solr] 03/34: Move images, fonts and message files to /org/apache/lucene/luke from the root directory.

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit d220ee06c2d1b21dfc2b9ce630b56c986d4699f7
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Fri Apr 5 12:47:30 2019 +0900

    Move images, fonts and message files to /org/apache/lucene/luke from the root directory.
---
 dev-tools/idea/lucene/luke/luke.iml                         |   1 +
 .../luke/app/desktop/components/LukeWindowProvider.java     |   2 +-
 .../components/dialog/menubar/AboutDialogFactory.java       |   2 +-
 .../components/dialog/menubar/CheckIndexDialogFactory.java  |   2 +-
 .../dialog/menubar/OptimizeIndexDialogFactory.java          |   2 +-
 .../org/apache/lucene/luke/app/desktop/util/FontUtils.java  |   4 +++-
 .../org/apache/lucene/luke/app/desktop/util/ImageUtils.java |  12 +++++-------
 .../apache/lucene/luke/app/desktop/util/MessageUtils.java   |   4 +++-
 .../apache/lucene/luke/app/desktop}/font/ElegantIcons.ttf   | Bin
 .../apache/lucene/luke/app/desktop}/img/indicator.gif       | Bin
 .../apache/lucene/luke/app/desktop}/img/lucene-logo.gif     | Bin
 .../{ => org/apache/lucene/luke/app/desktop}/img/lucene.gif | Bin
 .../apache/lucene/luke/app/desktop}/img/luke-logo.gif       | Bin
 .../lucene/luke/app/desktop/messages}/messages.properties   |   0
 14 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/dev-tools/idea/lucene/luke/luke.iml b/dev-tools/idea/lucene/luke/luke.iml
index 22ee541..9bd08ef 100644
--- a/dev-tools/idea/lucene/luke/luke.iml
+++ b/dev-tools/idea/lucene/luke/luke.iml
@@ -6,6 +6,7 @@
     <exclude-output />
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/resources" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
       <excludeFolder url="file://$MODULE_DIR$/work" />
     </content>
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LukeWindowProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LukeWindowProvider.java
index a88e6b9..347a8bf 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LukeWindowProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LukeWindowProvider.java
@@ -159,7 +159,7 @@ public final class LukeWindowProvider implements LukeWindowOperator {
     noReaderIcon.setVisible(false);
     iconPanel.add(noReaderIcon);
 
-    JLabel luceneIcon = new JLabel(ImageUtils.createImageIcon("/img/lucene.gif", "lucene", 16, 16));
+    JLabel luceneIcon = new JLabel(ImageUtils.createImageIcon("lucene.gif", "lucene", 16, 16));
     iconPanel.add(luceneIcon);
 
     c.gridx = 1;
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
index 06f8c8e..2395dee 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
@@ -98,7 +98,7 @@ public final class AboutDialogFactory implements DialogOpener.DialogFactory {
 
     JPanel logo = new JPanel(new FlowLayout(FlowLayout.CENTER));
     logo.setOpaque(false);
-    logo.add(new JLabel(ImageUtils.createImageIcon("/img/luke-logo.gif", 200, 40)));
+    logo.add(new JLabel(ImageUtils.createImageIcon("luke-logo.gif", 200, 40)));
     panel.add(logo);
 
     JPanel project = new JPanel(new FlowLayout(FlowLayout.CENTER));
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
index 5aa78e5..c98faa1 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
@@ -124,7 +124,7 @@ public final class CheckIndexDialogFactory implements DialogOpener.DialogFactory
     repairBtn.setEnabled(false);
     repairBtn.addActionListener(listeners::repairIndex);
 
-    indicatorLbl.setIcon(ImageUtils.createImageIcon("/img/indicator.gif", 20, 20));
+    indicatorLbl.setIcon(ImageUtils.createImageIcon("indicator.gif", 20, 20));
 
     logArea.setEditable(false);
   }
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
index 84c42a8..508e20c 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
@@ -114,7 +114,7 @@ public final class OptimizeIndexDialogFactory implements DialogOpener.DialogFact
     maxSegSpnr.setModel(new SpinnerNumberModel(1, 1, 100, 1));
     maxSegSpnr.setPreferredSize(new Dimension(100, 30));
 
-    indicatorLbl.setIcon(ImageUtils.createImageIcon("/img/indicator.gif", 20, 20));
+    indicatorLbl.setIcon(ImageUtils.createImageIcon("indicator.gif", 20, 20));
 
     logArea.setEditable(false);
   }
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/FontUtils.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/FontUtils.java
index 700f4ad..c4f4758 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/FontUtils.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/FontUtils.java
@@ -28,6 +28,8 @@ import java.util.Map;
 /** Font utilities */
 public class FontUtils {
 
+  public static final String TTF_RESOURCE_NAME = "org/apache/lucene/luke/app/desktop/font/ElegantIcons.ttf";
+
   @SuppressWarnings("unchecked")
   public static JLabel toLinkText(JLabel label) {
     label.setForeground(StyleConstants.LINK_COLOR);
@@ -39,7 +41,7 @@ public class FontUtils {
   }
 
   public static Font createElegantIconFont() throws IOException, FontFormatException {
-    InputStream is = FontUtils.class.getClassLoader().getResourceAsStream("font/ElegantIcons.ttf");
+    InputStream is = FontUtils.class.getClassLoader().getResourceAsStream(TTF_RESOURCE_NAME);
     return Font.createFont(Font.TRUETYPE_FONT, is);
   }
 
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/ImageUtils.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/ImageUtils.java
index fcf299e..d7989f9 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/ImageUtils.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/ImageUtils.java
@@ -23,16 +23,14 @@ import java.awt.Image;
 /** Image utilities */
 public class ImageUtils {
 
-  private static final int DEFAULT_ICON_WIDTH = 20;
+  private static final String IMAGE_BASE_DIR = "org/apache/lucene/luke/app/desktop/img/";
 
-  private static final int DEFAULT_ICON_HEIGHT = 20;
-
-  public static ImageIcon createImageIcon(String path, int width, int height) {
-    return createImageIcon(path, "", width, height);
+  public static ImageIcon createImageIcon(String name, int width, int height) {
+    return createImageIcon(name, "", width, height);
   }
 
-  public static ImageIcon createImageIcon(String path, String description, int width, int height) {
-    java.net.URL imgURL = ImageUtils.class.getResource(path);
+  public static ImageIcon createImageIcon(String name, String description, int width, int height) {
+    java.net.URL imgURL = ImageUtils.class.getClassLoader().getResource(IMAGE_BASE_DIR + name);
     if (imgURL != null) {
       ImageIcon originalIcon = new ImageIcon(imgURL, description);
       ImageIcon icon = new ImageIcon(originalIcon.getImage().getScaledInstance(width, height, Image.SCALE_DEFAULT));
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/MessageUtils.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/MessageUtils.java
index ca80a6c..cc69891 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/MessageUtils.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/MessageUtils.java
@@ -31,6 +31,8 @@ import java.util.ResourceBundle;
  */
 public class MessageUtils {
 
+  public static final String MESSAGE_BUNDLE_BASENAME = "org/apache/lucene/luke/app/desktop/messages/messages";
+
   public static String getLocalizedMessage(String key) {
     return bundle.getString(key);
   }
@@ -52,7 +54,7 @@ public class MessageUtils {
     }
   };
 
-  private static ResourceBundle bundle = ResourceBundle.getBundle("messages", Locale.ENGLISH, UTF8_RESOURCEBUNDLE_CONTROL);
+  private static ResourceBundle bundle = ResourceBundle.getBundle(MESSAGE_BUNDLE_BASENAME, Locale.ENGLISH, UTF8_RESOURCEBUNDLE_CONTROL);
 
   private MessageUtils() {
   }
diff --git a/lucene/luke/src/resources/font/ElegantIcons.ttf b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/font/ElegantIcons.ttf
similarity index 100%
rename from lucene/luke/src/resources/font/ElegantIcons.ttf
rename to lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/font/ElegantIcons.ttf
diff --git a/lucene/luke/src/resources/img/indicator.gif b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/img/indicator.gif
similarity index 100%
rename from lucene/luke/src/resources/img/indicator.gif
rename to lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/img/indicator.gif
diff --git a/lucene/luke/src/resources/img/lucene-logo.gif b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/img/lucene-logo.gif
similarity index 100%
rename from lucene/luke/src/resources/img/lucene-logo.gif
rename to lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/img/lucene-logo.gif
diff --git a/lucene/luke/src/resources/img/lucene.gif b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/img/lucene.gif
similarity index 100%
rename from lucene/luke/src/resources/img/lucene.gif
rename to lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/img/lucene.gif
diff --git a/lucene/luke/src/resources/img/luke-logo.gif b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/img/luke-logo.gif
similarity index 100%
rename from lucene/luke/src/resources/img/luke-logo.gif
rename to lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/img/luke-logo.gif
diff --git a/lucene/luke/src/resources/messages.properties b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties
similarity index 100%
rename from lucene/luke/src/resources/messages.properties
rename to lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties


[lucene-solr] 27/34: Set scroll bar position to top of the pane.

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit ad714e51ca12c3fa0cb44b2ce3c8d01a23252bfd
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sat Apr 6 20:03:53 2019 +0900

    Set scroll bar position to top of the pane.
---
 .../app/desktop/components/dialog/menubar/AboutDialogFactory.java    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
index 4f57c64..e9d9c97 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
@@ -26,6 +26,7 @@ import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.ScrollPaneConstants;
+import javax.swing.SwingUtilities;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkListener;
 import java.awt.BorderLayout;
@@ -144,6 +145,10 @@ public final class AboutDialogFactory implements DialogOpener.DialogFactory {
     editorPane.addHyperlinkListener(hyperlinkListener);
     JScrollPane scrollPane = new JScrollPane(editorPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
     scrollPane.setBorder(BorderFactory.createLineBorder(Color.gray));
+    SwingUtilities.invokeLater(() -> {
+      // Set the scroll bar position to top
+      scrollPane.getVerticalScrollBar().setValue(0);
+    });
     return scrollPane;
   }
 


[lucene-solr] 12/34: Remove obsolete ivy-ignore-conflicts entry

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit c2498b64f10b3537ac8b560d11a8ba206b67fd55
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Fri Apr 5 20:51:49 2019 +0900

    Remove obsolete ivy-ignore-conflicts entry
---
 lucene/ivy-ignore-conflicts.properties | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lucene/ivy-ignore-conflicts.properties b/lucene/ivy-ignore-conflicts.properties
index f6cefa2..df3a2e5 100644
--- a/lucene/ivy-ignore-conflicts.properties
+++ b/lucene/ivy-ignore-conflicts.properties
@@ -11,5 +11,4 @@
 
 /com.google.guava/guava = 16.0.1
 /org.ow2.asm/asm = 5.0_BETA
-/org.slf4j/slf4j-api = 1.7.25
 


[lucene-solr] 18/34: Remove dead code

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 18e175d7704c97fe1bd7671ebfa53913b5e9e266
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 19:28:25 2019 +0200

    Remove dead code
---
 .../lucene/luke/models/tools/IndexTools.java       |  7 ------
 .../lucene/luke/models/tools/IndexToolsImpl.java   | 29 ----------------------
 2 files changed, 36 deletions(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexTools.java b/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexTools.java
index 25e76ed..877646c 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexTools.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexTools.java
@@ -18,11 +18,9 @@
 package org.apache.lucene.luke.models.tools;
 
 import java.io.PrintStream;
-import java.util.Collection;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
 import org.apache.lucene.index.CheckIndex;
 import org.apache.lucene.luke.models.LukeException;
 import org.apache.lucene.search.Query;
@@ -96,9 +94,4 @@ public interface IndexTools {
    * @param dataDir - the directory path which contains sample documents (20 Newsgroups).
    */
   void createNewIndex(String dataDir);
-
-  /**
-   * Returns preset {@link Field} classes.
-   */
-  Collection<Class<? extends Field>> getPresetFields();
 }
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexToolsImpl.java b/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexToolsImpl.java
index 1b9eb55..166958b 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexToolsImpl.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexToolsImpl.java
@@ -21,25 +21,11 @@ import java.io.IOException;
 import java.io.PrintStream;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import java.util.Arrays;
-import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.DoublePoint;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.FloatPoint;
-import org.apache.lucene.document.IntPoint;
-import org.apache.lucene.document.LongPoint;
-import org.apache.lucene.document.NumericDocValuesField;
-import org.apache.lucene.document.SortedDocValuesField;
-import org.apache.lucene.document.SortedNumericDocValuesField;
-import org.apache.lucene.document.SortedSetDocValuesField;
-import org.apache.lucene.document.StoredField;
-import org.apache.lucene.document.StringField;
-import org.apache.lucene.document.TextField;
 import org.apache.lucene.index.CheckIndex;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
@@ -59,15 +45,6 @@ public final class IndexToolsImpl extends LukeModel implements IndexTools {
 
   private final boolean keepAllCommits;
 
-  @SuppressWarnings({"unchecked", "rawtypes"})
-  private final List<Class<? extends Field>> presetFieldClasses = Arrays.asList(
-      TextField.class, StringField.class,
-      IntPoint.class, LongPoint.class, FloatPoint.class, DoublePoint.class,
-      SortedDocValuesField.class, SortedSetDocValuesField.class,
-      NumericDocValuesField.class, SortedNumericDocValuesField.class,
-      StoredField.class
-  );
-
   /**
    * Constructs an IndexToolsImpl that holds given {@link Directory}.
    *
@@ -207,10 +184,4 @@ public final class IndexToolsImpl extends LukeModel implements IndexTools {
       }
     }
   }
-
-  @Override
-  @SuppressWarnings("unchecked")
-  public Collection<Class<? extends Field>> getPresetFields() {
-    return presetFieldClasses;
-  }
 }


[lucene-solr] 04/34: Remove obsolete dependency (we have no external dependency anmore that uses log4j v1)

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 890cda85fd4a8674c5b967c0d53cacee1cf09a1f
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 12:16:13 2019 +0200

    Remove obsolete dependency (we have no external dependency anmore that uses log4j v1)
---
 lucene/licenses/log4j-1.2-api-2.11.2.jar.sha1 | 1 -
 lucene/luke/ivy.xml                           | 4 +---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/lucene/licenses/log4j-1.2-api-2.11.2.jar.sha1 b/lucene/licenses/log4j-1.2-api-2.11.2.jar.sha1
deleted file mode 100644
index 4ad6f96..0000000
--- a/lucene/licenses/log4j-1.2-api-2.11.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-afb9ef0baba766725c3733e6a2626877dba72715
diff --git a/lucene/luke/ivy.xml b/lucene/luke/ivy.xml
index 41ec924..af5d062 100644
--- a/lucene/luke/ivy.xml
+++ b/lucene/luke/ivy.xml
@@ -20,7 +20,7 @@
   <info organisation="org.apache.lucene" module="luke"/>
 
   <configurations defaultconfmapping="compile->default;logging->default">
-    <conf name="compile" transitive="true"/>
+    <conf name="compile" transitive="false"/>
     <conf name="logging" transitive="false"/>
   </configurations>
 
@@ -30,8 +30,6 @@
     <dependency org="org.apache.logging.log4j" name="log4j-core" rev="${/org.apache.logging.log4j/log4j-core}"
                 conf="logging"/>
     <dependency org="org.apache.logging.log4j" name="log4j-slf4j-impl" rev="${/org.apache.logging.log4j/log4j-slf4j-impl}" conf="logging"/>
-    <dependency org="org.apache.logging.log4j" name="log4j-1.2-api" rev="${/org.apache.logging.log4j/log4j-1.2-api}"
-                conf="logging"/>
     <dependency org="org.slf4j" name="slf4j-api" rev="${/org.slf4j/slf4j-api}" conf="logging"/>
 
     <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>


[lucene-solr] 16/34: Change logging a bit: do textarea update async; fix locking; centralize name of log file

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 347095128ba9856f5b907fc5f5c5f7f377c81a4e
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 18:11:16 2019 +0200

    Change logging a bit: do textarea update async; fix locking; centralize name of log file
---
 .../apache/lucene/luke/app/desktop/LukeMain.java   | 10 +++++--
 .../app/desktop/components/LogsPanelProvider.java  |  8 ++---
 .../luke/app/desktop/util/TextAreaAppender.java    | 35 ++++++++++++++--------
 .../org/apache/lucene/luke/util/LoggerFactory.java |  7 +++--
 4 files changed, 37 insertions(+), 23 deletions(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
index 673127d..fae52f2 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
@@ -22,6 +22,7 @@ import javax.swing.UIManager;
 import java.awt.GraphicsEnvironment;
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
+import java.nio.file.FileSystems;
 
 import org.apache.logging.log4j.Logger;
 import org.apache.lucene.luke.app.desktop.components.LukeWindowProvider;
@@ -36,11 +37,15 @@ import static org.apache.lucene.luke.app.desktop.util.ExceptionHandler.handle;
 /** Entry class for desktop Luke */
 public class LukeMain {
 
+  public static final String LOG_FILE = System.getProperty("user.home") +
+      FileSystems.getDefault().getSeparator() + ".luke.d" +
+      FileSystems.getDefault().getSeparator() + "luke.log";
+
   static {
-    LoggerFactory.initGuiLogging();
+    LoggerFactory.initGuiLogging(LOG_FILE);
   }
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
+  
   private static JFrame frame;
 
   public static JFrame getOwnerFrame() {
@@ -48,7 +53,6 @@ public class LukeMain {
   }
 
   private static void createAndShowGUI() {
-
     // uncaught error handler
     MessageBroker messageBroker = MessageBroker.getInstance();
     Thread.setDefaultUncaughtExceptionHandler((thread, cause) ->
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java
index 2cf385f..1d27cea 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java
@@ -24,17 +24,13 @@ import javax.swing.JScrollPane;
 import javax.swing.JTextArea;
 import java.awt.BorderLayout;
 import java.awt.FlowLayout;
-import java.nio.file.FileSystems;
 
+import org.apache.lucene.luke.app.desktop.LukeMain;
 import org.apache.lucene.luke.app.desktop.util.MessageUtils;
 
 /** Provider of the Logs panel */
 public final class LogsPanelProvider {
 
-  private static final String LOG_FILE = System.getProperty("user.home") +
-      FileSystems.getDefault().getSeparator() + ".luke.d" +
-      FileSystems.getDefault().getSeparator() + "luke.log";
-
   private final JTextArea logTextArea;
 
   public LogsPanelProvider(JTextArea logTextArea) {
@@ -50,7 +46,7 @@ public final class LogsPanelProvider {
     header.setOpaque(false);
     header.add(new JLabel(MessageUtils.getLocalizedMessage("logs.label.see_also")));
 
-    JLabel logPathLabel = new JLabel(LOG_FILE);
+    JLabel logPathLabel = new JLabel(LukeMain.LOG_FILE);
     header.add(logPathLabel);
 
     panel.add(header, BorderLayout.PAGE_START);
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
index b577b67..41cab03 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
@@ -18,8 +18,9 @@
 package org.apache.lucene.luke.app.desktop.util;
 
 import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+
 import java.io.Serializable;
-import java.nio.charset.StandardCharsets;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -28,6 +29,7 @@ import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.Core;
 import org.apache.logging.log4j.core.Filter;
 import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.StringLayout;
 import org.apache.logging.log4j.core.appender.AbstractAppender;
 import org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender;
 import org.apache.logging.log4j.core.config.Property;
@@ -40,8 +42,9 @@ public final class TextAreaAppender extends AbstractAppender {
 
   private static JTextArea textArea;
 
-  private final ReadWriteLock rwLock = new ReentrantReadWriteLock();
-  private final Lock readLock = rwLock.readLock();
+  private static final ReadWriteLock rwLock = new ReentrantReadWriteLock();
+  private static final Lock readLock = rwLock.readLock();
+  private static final Lock writeLock = rwLock.writeLock();
 
   protected TextAreaAppender(String name, Filter filter,
                              org.apache.logging.log4j.core.Layout<? extends Serializable> layout, final boolean ignoreExceptions) {
@@ -49,22 +52,30 @@ public final class TextAreaAppender extends AbstractAppender {
   }
 
   public static void setTextArea(JTextArea ta) {
-    if (textArea != null) {
-      throw new IllegalStateException("TextArea already set.");
+    writeLock.lock();
+    try {
+      if (textArea != null) {
+        throw new IllegalStateException("TextArea already set.");
+      }
+      textArea = ta;
+    } finally {
+      writeLock.unlock();
     }
-    textArea = ta;
   }
 
   @Override
   public void append(LogEvent event) {
-    if (textArea == null) {
-      throw new IllegalStateException();
-    }
-
     readLock.lock();
     try {
-      String message = new String(getLayout().toByteArray(event), StandardCharsets.UTF_8);
-      textArea.append(message);
+      if (textArea == null) {
+        // just ignore any events logged before the area is available
+        return;
+      }
+  
+      final String message = ((StringLayout) getLayout()).toSerializable(event);
+      SwingUtilities.invokeLater(() -> {
+        textArea.append(message);
+      });
     } finally {
       readLock.unlock();
     }
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
index 4a383b1..c98d552 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
@@ -17,6 +17,8 @@
 
 package org.apache.lucene.luke.util;
 
+import java.nio.charset.StandardCharsets;
+
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.LogManager;
@@ -35,19 +37,20 @@ import org.apache.lucene.luke.app.desktop.util.TextAreaAppender;
  */
 public class LoggerFactory {
 
-  public static void initGuiLogging() {
+  public static void initGuiLogging(String logFile) {
     ConfigurationBuilder<BuiltConfiguration> builder = ConfigurationBuilderFactory.newConfigurationBuilder();
     builder.add(builder.newRootLogger(Level.INFO));
     LoggerContext context = Configurator.initialize(builder.build());
 
     PatternLayout layout = PatternLayout.newBuilder()
         .withPattern("[%d{ISO8601}] %5p (%F:%L) - %m%n")
+        .withCharset(StandardCharsets.UTF_8)
         .build();
 
     Appender fileAppender = FileAppender.newBuilder()
         .setName("File")
         .setLayout(layout)
-        .withFileName(System.getProperty("user.home") + "/.luke.d/luke.log")
+        .withFileName(logFile)
         .withAppend(false)
           .build();
     fileAppender.start();


[lucene-solr] 30/34: Add the hyperlink to 20 Newsgroups corpus page

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 7fd769889a271e6ded582caae506f59d8901689b
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sun Apr 7 14:06:33 2019 +0900

    Add the hyperlink to 20 Newsgroups corpus page
---
 .../dialog/menubar/CreateIndexDialogFactory.java   | 40 +++++++++++++++++-----
 .../luke/app/desktop/messages/messages.properties  |  5 ++-
 2 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java
index f12198f..0735c09 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java
@@ -53,6 +53,7 @@ import org.apache.lucene.luke.app.desktop.util.DialogOpener;
 import org.apache.lucene.luke.app.desktop.util.FontUtils;
 import org.apache.lucene.luke.app.desktop.util.MessageUtils;
 import org.apache.lucene.luke.app.desktop.util.StyleConstants;
+import org.apache.lucene.luke.app.desktop.util.URLLabel;
 import org.apache.lucene.luke.models.tools.IndexTools;
 import org.apache.lucene.luke.models.tools.IndexToolsFactory;
 import org.apache.lucene.luke.util.LoggerFactory;
@@ -169,15 +170,38 @@ public class CreateIndexDialogFactory implements DialogOpener.DialogFactory {
     JPanel panel = new JPanel(new BorderLayout());
     panel.setOpaque(false);
 
-    JPanel description = new JPanel(new FlowLayout(FlowLayout.LEADING));
+    JPanel description = new JPanel();
+    description.setLayout(new BoxLayout(description, BoxLayout.Y_AXIS));
     description.setOpaque(false);
-    JTextArea descTA = new JTextArea(MessageUtils.getLocalizedMessage("createindex.label.data_help"));
-    descTA.setPreferredSize(new Dimension(550, 100));
-    descTA.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
-    descTA.setOpaque(false);
-    descTA.setLineWrap(true);
-    descTA.setEditable(false);
-    description.add(descTA);
+
+    JPanel name = new JPanel(new FlowLayout(FlowLayout.LEADING));
+    name.setOpaque(false);
+    JLabel nameLbl = new JLabel(MessageUtils.getLocalizedMessage("createindex.label.option"));
+    name.add(nameLbl);
+    description.add(name);
+
+    JTextArea descTA1 = new JTextArea(MessageUtils.getLocalizedMessage("createindex.textarea.data_help1"));
+    descTA1.setPreferredSize(new Dimension(550, 20));
+    descTA1.setBorder(BorderFactory.createEmptyBorder(2, 10, 10, 5));
+    descTA1.setOpaque(false);
+    descTA1.setLineWrap(true);
+    descTA1.setEditable(false);
+    description.add(descTA1);
+
+    JPanel link = new JPanel(new FlowLayout(FlowLayout.LEADING, 10, 1));
+    link.setOpaque(false);
+    JLabel linkLbl = FontUtils.toLinkText(new URLLabel(MessageUtils.getLocalizedMessage("createindex.label.data_link")));
+    link.add(linkLbl);
+    description.add(link);
+
+    JTextArea descTA2 = new JTextArea(MessageUtils.getLocalizedMessage("createindex.textarea.data_help2"));
+    descTA2.setPreferredSize(new Dimension(550, 50));
+    descTA2.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 5));
+    descTA2.setOpaque(false);
+    descTA2.setLineWrap(true);
+    descTA2.setEditable(false);
+    description.add(descTA2);
+
     panel.add(description, BorderLayout.PAGE_START);
 
     JPanel dataDirPath = new JPanel(new FlowLayout(FlowLayout.LEADING));
diff --git a/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties
index 5ce5872..3323f10 100644
--- a/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties
+++ b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties
@@ -78,8 +78,11 @@ openindex.message.dirctory_opened=Directory opened. There is no IndexReader - mo
 createindex.dialog.title=Choose new index directory path
 createindex.label.location=Location:
 createindex.label.dirname=Index directory name:
-createindex.label.data_help=(Optional)\n You can index sample documents from 20 Newsgroups data that is available at here:\n http://kdd.ics.uci.edu/databases/20newsgroups/20newsgroups.html\n Download and extract the tgz file, then select the extracted directory path.\n Creating an index with the sample documents can take 10 seconds or so :)
+createindex.label.option=(Options)
+createindex.label.data_link=http://kdd.ics.uci.edu/databases/20newsgroups/20newsgroups.html
 createindex.label.datadir=Data directory:
+createindex.textarea.data_help1=You can index sample documents from 20 Newsgroups corpus that is available at here:
+createindex.textarea.data_help2=Download and extract the tgz file, then select the extracted directory path.\nCreating an index with the full size corpus can take 30 seconds or so :)
 # Optimize index
 optimize.dialog.title=Optimize index
 optimize.label.index_path=Index directory path:


[lucene-solr] 08/34: Add javadocs

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit aa2aa479f6b74a2daa37f151dd96845a0974f160
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Fri Apr 5 20:14:27 2019 +0900

    Add javadocs
---
 .../org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java    | 5 +++++
 lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java  | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
index 829c43c..b577b67 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
@@ -70,6 +70,11 @@ public final class TextAreaAppender extends AbstractAppender {
     }
   }
 
+  /**
+   * Builds TextAreaAppender instances.
+   *
+   * @param <B> The type to build
+   */
   public static class Builder<B extends Builder<B>> extends AbstractOutputStreamAppender.Builder<B>
       implements org.apache.logging.log4j.core.util.Builder<TextAreaAppender> {
 
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
index 676197d..23fcefe 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
@@ -29,6 +29,9 @@ import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration;
 import org.apache.logging.log4j.core.layout.PatternLayout;
 import org.apache.lucene.luke.app.desktop.util.TextAreaAppender;
 
+/**
+ * Logger factory. This programmatically configurates logger context (Appenders etc.)
+ */
 public class LoggerFactory {
 
   private static LoggerContext context = LoggerContext.getContext();


[lucene-solr] 23/34: Use our classloader instead of system classloader, so we can be sure that all Lucene classes are there

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit e5468ef1412f3540c18209749712bfa173ef4d49
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Sat Apr 6 10:04:10 2019 +0200

    Use our classloader instead of system classloader, so we can be sure that all Lucene classes are there
---
 .../src/java/org/apache/lucene/luke/models/analysis/AnalysisImpl.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/analysis/AnalysisImpl.java b/lucene/luke/src/java/org/apache/lucene/luke/models/analysis/AnalysisImpl.java
index 53179bc..7d76b8f 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/analysis/AnalysisImpl.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/analysis/AnalysisImpl.java
@@ -74,7 +74,7 @@ public final class AnalysisImpl implements Analysis {
 
     // reload available tokenizers, charfilters, and tokenfilters
     URLClassLoader classLoader = new URLClassLoader(
-        urls.toArray(new URL[0]), ClassLoader.getSystemClassLoader());
+        urls.toArray(new URL[0]), this.getClass().getClassLoader());
     CharFilterFactory.reloadCharFilters(classLoader);
     TokenizerFactory.reloadTokenizers(classLoader);
     TokenFilterFactory.reloadTokenFilters(classLoader);


[lucene-solr] 34/34: Merge branch 'master' of https://gitbox.apache.org/repos/asf/lucene-solr into jira/lucene-2562-luke-swing-3

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 846f3d33d0b7fb770d4739aa74b16fd9296ae1f2
Merge: 6e424f5 ef7be67
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Sun Apr 7 13:02:07 2019 +0200

    Merge branch 'master' of https://gitbox.apache.org/repos/asf/lucene-solr into jira/lucene-2562-luke-swing-3

 dev-tools/doap/lucene.rdf                          |   11 +-
 dev-tools/doap/solr.rdf                            |    7 +
 lucene/CHANGES.txt                                 |   30 +
 .../miscellaneous/WordDelimiterGraphFilter.java    |   13 +-
 .../TestWordDelimiterGraphFilter.java              |   19 +-
 .../lucene/index/TestBackwardsCompatibility.java   |    2 +
 .../apache/lucene/index/unsupported.6.6.6-cfs.zip  |  Bin 0 -> 15880 bytes
 .../lucene/index/unsupported.6.6.6-nocfs.zip       |  Bin 0 -> 15856 bytes
 .../simpletext/SimpleTextCompoundFormat.java       |   27 +-
 .../codecs/blocktree/BlockTreeTermsReader.java     |    6 +-
 .../lucene/codecs/blocktree/FieldReader.java       |   34 +-
 .../codecs/lucene50/Lucene50CompoundReader.java    |    6 +
 .../codecs/lucene50/Lucene50PostingsFormat.java    |   53 +-
 .../lucene/codecs/lucene80/Lucene80Codec.java      |   11 +-
 .../apache/lucene/search/ConstantScoreQuery.java   |   27 +-
 .../apache/lucene/search/DoubleValuesSource.java   |   25 +-
 .../org/apache/lucene/search/LongValuesSource.java |   26 +-
 .../apache/lucene/store/ByteBuffersDirectory.java  |    7 +
 .../java/org/apache/lucene/store/Directory.java    |    5 +-
 .../org/apache/lucene/store/FilterDirectory.java   |    2 +-
 .../codecs/lucene50/TestBlockPostingsFormat.java   |  118 +-
 ...tLucene50StoredFieldsFormatHighCompression.java |   12 +-
 .../org/apache/lucene/index/TestIndexWriter.java   |   39 +
 .../lucene/index/TestIndexWriterOnVMError.java     |    2 +-
 .../lucene/search/TestConstantScoreScorer.java     |   38 +
 .../lucene/search/TestDoubleValuesSource.java      |   38 +-
 .../apache/lucene/search/TestLongValuesSource.java |   39 +-
 .../lucene/facet/range/TestRangeFacetCounts.java   |    4 +-
 lucene/ivy-versions.properties                     |   15 +-
 .../lucene/search/join/ToParentBlockJoinQuery.java |   30 +-
 .../apache/lucene/search/join/TestBlockJoin.java   |    6 +-
 .../lucene/search/join/TestBlockJoinScorer.java    |  111 ++
 .../lucene/queries/function/ValueSource.java       |    3 +-
 .../apache/lucene/queries/mlt/MoreLikeThis.java    |   16 +-
 .../lucene/queries/function/TestValueSources.java  |    6 +
 .../lucene/queries/mlt/TestMoreLikeThis.java       |  193 ++-
 .../queryparser/xml/SpanNearQueryWithoutSlop.xml   |   21 +
 .../lucene/queryparser/xml/TestCoreParser.java     |   16 +
 .../search/intervals/BlockIntervalsSource.java     |  142 ++
 .../intervals/ConjunctionIntervalsSource.java      |   53 +-
 .../intervals/ContainedByIntervalsSource.java      |   93 +
 .../intervals/ContainingIntervalsSource.java       |   90 +
 .../intervals/DifferenceIntervalFunction.java      |  235 ---
 .../intervals/DifferenceIntervalsSource.java       |   41 +-
 .../intervals/DisjunctionIntervalsSource.java      |   33 +-
 .../lucene/search/intervals/Disjunctions.java      |  100 ++
 .../search/intervals/ExtendedIntervalsSource.java  |   12 +
 .../search/intervals/FilteredIntervalsSource.java  |   57 +-
 ...sSource.java => FilteringIntervalIterator.java} |   44 +-
 .../intervals/FixedFieldIntervalsSource.java       |   12 +
 .../lucene/search/intervals/IntervalFilter.java    |    2 +-
 .../lucene/search/intervals/IntervalFunction.java  |  501 ------
 .../apache/lucene/search/intervals/Intervals.java  |  109 +-
 .../lucene/search/intervals/IntervalsSource.java   |    8 +
 .../MinimizingConjunctionIntervalsSource.java      |  133 --
 .../MinimizingConjunctionMatchesIterator.java      |  100 ++
 .../MinimumShouldMatchIntervalsSource.java         |    6 +
 .../search/intervals/MultiTermIntervalsSource.java |    7 +
 .../NoRewriteDisjunctionIntervalsSource.java       |   20 +-
 .../intervals/NonOverlappingIntervalsSource.java   |   81 +
 .../intervals/NotContainedByIntervalsSource.java   |   83 +
 .../intervals/NotContainingIntervalsSource.java    |   86 +
 .../search/intervals/OffsetIntervalsSource.java    |    7 +
 .../search/intervals/OrderedIntervalsSource.java   |  155 ++
 .../intervals/OverlappingIntervalsSource.java      |   89 +
 .../PayloadFilteredTermIntervalsSource.java        |    7 +
 .../{IntervalFilter.java => RelativeIterator.java} |   61 +-
 .../search/intervals/TermIntervalsSource.java      |    7 +
 .../search/intervals/UnorderedIntervalsSource.java |  240 +++
 .../search/intervals/TestDisjunctionRewrites.java  |  215 +++
 .../lucene/search/intervals/TestIntervalQuery.java |   56 +-
 .../lucene/search/intervals/TestIntervals.java     |   22 +-
 .../search/intervals/TestSimplifications.java      |   30 +-
 .../codecs/cheapbastard/CheapBastardCodec.java     |    3 +-
 .../mockrandom/MockRandomPostingsFormat.java       |    3 +-
 .../lucene/index/BaseMergePolicyTestCase.java      |    4 +
 .../java/org/apache/lucene/index/RandomCodec.java  |    5 +-
 .../util/TestRuleSetupAndRestoreClassEnv.java      |    4 +-
 .../src/java/org/apache/lucene/util/TestUtil.java  |    4 +-
 solr/CHANGES.txt                                   |   63 +-
 solr/common-build.xml                              |   37 +-
 .../handler/extraction/XLSXResponseWriter.java     |   95 +-
 .../extraction/solr/collection1/conf/schema.xml    |    9 +
 .../handler/extraction/TestXLSXResponseWriter.java |   93 +-
 solr/contrib/velocity/ivy.xml                      |   11 +-
 .../solr/response/SolrParamResourceLoader.java     |   18 +-
 .../apache/solr/response/SolrVelocityLogger.java   |  114 --
 .../solr/response/SolrVelocityResourceLoader.java  |   10 +-
 .../solr/response/VelocityResponseWriter.java      |   39 +-
 solr/contrib/velocity/src/resources/_macros.vm     |    4 +-
 .../velocity/src/resources/velocity/footer.vm      |    2 +-
 .../solr/velocity/VelocityResponseWriterTest.java  |   11 +-
 solr/core/ivy.xml                                  |    1 -
 .../client/solrj/embedded/JettySolrRunner.java     |   98 +-
 .../core/src/java/org/apache/solr/cloud/ZkCLI.java |   47 +-
 .../java/org/apache/solr/cloud/ZkController.java   |   85 +-
 .../cloud/autoscaling/OverseerTriggerThread.java   |   33 +-
 .../java/org/apache/solr/core/ConfigOverlay.java   |    4 -
 .../java/org/apache/solr/core/CoreContainer.java   |   58 +-
 .../org/apache/solr/core/HdfsDirectoryFactory.java |   35 +-
 .../org/apache/solr/core/SchemaCodecFactory.java   |    3 +-
 .../backup/repository/HdfsBackupRepository.java    |   18 +-
 .../solr/core/snapshots/SolrSnapshotsTool.java     |   47 +-
 .../org/apache/solr/index/hdfs/CheckHdfsIndex.java |   15 +-
 .../apache/solr/internal/csv/writer/CSVConfig.java |  283 ---
 .../solr/internal/csv/writer/CSVConfigGuesser.java |  185 --
 .../apache/solr/internal/csv/writer/CSVField.java  |  108 --
 .../apache/solr/internal/csv/writer/CSVWriter.java |  132 --
 .../solr/parser/QueryParserTokenManager.java       |   26 +-
 .../apache/solr/response/CSVResponseWriter.java    |   93 +-
 .../solr/response/TabularResponseWriter.java       |  149 ++
 .../java/org/apache/solr/response/XMLWriter.java   |   18 +-
 .../transform/ExplainAugmenterFactory.java         |   23 +-
 .../org/apache/solr/schema/AbstractEnumField.java  |   12 +
 .../src/java/org/apache/solr/schema/FieldType.java |    3 +
 .../java/org/apache/solr/search/ReturnFields.java  |    7 +
 .../org/apache/solr/search/SolrReturnFields.java   |   28 +-
 .../apache/solr/search/mlt/CloudMLTQParser.java    |    3 +-
 .../java/org/apache/solr/security/AuditEvent.java  |  476 ++++++
 .../apache/solr/security/AuditLoggerPlugin.java    |  400 +++++
 .../solr/security/MultiDestinationAuditLogger.java |  138 ++
 .../security/RuleBasedAuthorizationPlugin.java     |  112 +-
 .../solr/security/SolrLogAuditLoggerPlugin.java    |   79 +
 .../java/org/apache/solr/servlet/HttpSolrCall.java |   44 +-
 .../apache/solr/servlet/SolrDispatchFilter.java    |   21 +
 .../org/apache/solr/store/hdfs/HdfsDirectory.java  |    9 +-
 .../java/org/apache/solr/update/CommitTracker.java |    2 +-
 .../java/org/apache/solr/update/HdfsUpdateLog.java |   13 +-
 .../java/org/apache/solr/update/UpdateHandler.java |   30 +-
 .../update/processor/URLClassifyProcessor.java     |   41 +-
 .../core/src/java/org/apache/solr/util/CLIO.java   |   29 +-
 .../src/java/org/apache/solr/util/CryptoKeys.java  |   10 +-
 .../org/apache/solr/util/RecordingJSONParser.java  |    7 +-
 .../java/org/apache/solr/util/SimplePostTool.java  |  121 +-
 .../src/java/org/apache/solr/util/SolrCLI.java     |  498 +++---
 .../solr/configsets/cloud-dynamic/conf/schema.xml  |    2 +
 .../{cloud-dynamic => sql}/conf/schema.xml         |   24 +-
 .../solr/configsets/sql/conf/solrconfig.xml        |   48 +
 .../solr/security/auditlog_plugin_security.json    |    9 +
 .../apache/solr/analysis/TokenizerChainTest.java   |    1 +
 .../org/apache/solr/cloud/CleanupOldIndexTest.java |    6 +-
 .../org/apache/solr/cloud/DeleteReplicaTest.java   |    2 +-
 .../solr/cloud/LeaderElectionIntegrationTest.java  |   10 +-
 .../org/apache/solr/cloud/LeaderElectionTest.java  |  106 +-
 .../solr/cloud/LegacyCloudClusterPropTest.java     |    2 +-
 .../test/org/apache/solr/cloud/OverseerTest.java   |  196 +--
 .../org/apache/solr/cloud/RollingRestartTest.java  |   12 +-
 .../apache/solr/cloud/SaslZkACLProviderTest.java   |   10 +-
 .../org/apache/solr/cloud/TestPullReplica.java     |  128 +-
 .../org/apache/solr/cloud/TestTlogReplica.java     |  144 +-
 .../org/apache/solr/cloud/TestWithCollection.java  |    2 +-
 .../src/test/org/apache/solr/cloud/ZkCLITest.java  |   54 +-
 .../apache/solr/core/HdfsDirectoryFactoryTest.java |   18 +
 .../org/apache/solr/handler/TestSQLHandler.java    | 1804 +++++++-------------
 .../internal/csv/writer/CSVConfigGuesserTest.java  |   87 -
 .../solr/internal/csv/writer/CSVConfigTest.java    |   98 --
 .../solr/internal/csv/writer/CSVFieldTest.java     |   46 -
 .../solr/internal/csv/writer/CSVWriterTest.java    |   54 -
 .../solr/response/TestCSVResponseWriter.java       |   24 +-
 .../apache/solr/search/facet/TestJsonFacets.java   |   22 +-
 .../solr/security/AuditLoggerIntegrationTest.java  |  398 +++++
 .../solr/security/AuditLoggerPluginTest.java       |  176 ++
 .../solr/security/CallbackAuditLoggerPlugin.java   |   76 +
 .../solr/security/MockAuditLoggerPlugin.java       |   55 +
 .../security/MultiDestinationAuditLoggerTest.java  |   82 +
 .../security/SolrLogAuditLoggerPluginTest.java     |   72 +
 .../security/TestRuleBasedAuthorizationPlugin.java |  145 +-
 .../uninverting/TestDocTermOrdsUninvertLimit.java  |    6 +-
 .../org/apache/solr/update/AddBlockUpdateTest.java |  303 ++--
 .../processor/AtomicUpdateRemovalJavabinTest.java  |  134 ++
 .../test/org/apache/solr/util/AuthToolTest.java    |   76 +
 .../test/org/apache/solr/util/UtilsToolTest.java   |   14 +
 solr/example/files/conf/velocity/hit.vm            |    2 +-
 solr/example/files/conf/velocity/macros.vm         |    4 +-
 solr/licenses/commons-lang-2.6.jar.sha1            |    1 -
 solr/licenses/commons-lang-LICENSE-ASL.txt         |  202 ---
 solr/licenses/commons-lang-NOTICE.txt              |    5 -
 solr/licenses/dom4j-1.6.1.jar.sha1                 |    1 -
 solr/licenses/dom4j-LICENSE-BSD_LIKE.txt           |   40 -
 solr/licenses/dom4j-NOTICE.txt                     |    1 -
 solr/licenses/jackcess-LICENSE-ASL.txt             |  305 ----
 solr/licenses/jackcess-encrypt-LICENSE-ASL.txt     |  305 ----
 solr/licenses/jackson-annotations-2.9.6.jar.sha1   |    1 -
 solr/licenses/jackson-annotations-2.9.8.jar.sha1   |    1 +
 solr/licenses/jackson-core-2.9.6.jar.sha1          |    1 -
 solr/licenses/jackson-core-2.9.8.jar.sha1          |    1 +
 solr/licenses/jackson-databind-2.9.6.jar.sha1      |    1 -
 solr/licenses/jackson-databind-2.9.8.jar.sha1      |    1 +
 .../jackson-dataformat-smile-2.9.6.jar.sha1        |    1 -
 .../jackson-dataformat-smile-2.9.8.jar.sha1        |    1 +
 solr/licenses/poi-LICENSE-ASL.txt                  |  480 +++---
 solr/licenses/poi-NOTICE.txt                       |   23 +-
 solr/licenses/poi-ooxml-LICENSE-ASL.txt            |  480 +++---
 solr/licenses/poi-ooxml-NOTICE.txt                 |   23 +-
 solr/licenses/poi-ooxml-schemas-LICENSE-ASL.txt    |  480 +++---
 solr/licenses/poi-ooxml-schemas-NOTICE.txt         |   23 +-
 solr/licenses/poi-scratchpad-LICENSE-ASL.txt       |  480 +++---
 solr/licenses/poi-scratchpad-NOTICE.txt            |   23 +-
 solr/licenses/velocity-1.7.jar.sha1                |    1 -
 solr/licenses/velocity-engine-core-2.0.jar.sha1    |    1 +
 ...SL.txt => velocity-engine-core-LICENSE-ASL.txt} |    0
 ...-NOTICE.txt => velocity-engine-core-NOTICE.txt} |    0
 solr/licenses/velocity-tools-2.0.jar.sha1          |    1 -
 solr/licenses/velocity-tools-generic-3.0.jar.sha1  |    1 +
 ....txt => velocity-tools-generic-LICENSE-ASL.txt} |    0
 ...OTICE.txt => velocity-tools-generic-NOTICE.txt} |    0
 solr/licenses/velocity-tools-view-3.0.jar.sha1     |    1 +
 ...ASL.txt => velocity-tools-view-LICENSE-ASL.txt} |    0
 ...s-NOTICE.txt => velocity-tools-view-NOTICE.txt} |    0
 solr/licenses/velocity-tools-view-jsp-3.0.jar.sha1 |    1 +
 ...txt => velocity-tools-view-jsp-LICENSE-ASL.txt} |    0
 ...TICE.txt => velocity-tools-view-jsp-NOTICE.txt} |    0
 solr/licenses/zookeeper-3.4.13.jar.sha1            |    1 -
 solr/licenses/zookeeper-3.4.14.jar.sha1            |    1 +
 .../conf/velocity/VM_global_library.vm             |   10 +-
 .../conf/velocity/did_you_mean.vm                  |    2 +-
 .../conf/velocity/footer.vm                        |    4 +-
 .../conf/velocity/richtext_doc.vm                  |    2 +-
 solr/solr-ref-guide/build.xml                      |    2 +-
 solr/solr-ref-guide/src/_config.yml.template       |    2 +-
 solr/solr-ref-guide/src/aliases.adoc               |   14 +-
 solr/solr-ref-guide/src/audit-logging.adoc         |  154 ++
 .../src/basic-authentication-plugin.adoc           |   21 +-
 solr/solr-ref-guide/src/cdcr-architecture.adoc     |    2 +
 solr/solr-ref-guide/src/reindexing.adoc            |   34 +-
 .../src/rule-based-authorization-plugin.adoc       |    5 +
 solr/solr-ref-guide/src/securing-solr.adoc         |    3 +-
 .../src/solr-system-requirements.adoc              |   72 +-
 .../src/stream-decorator-reference.adoc            |    4 +-
 .../src/velocity-response-writer.adoc              |    1 -
 .../solr/client/solrj/cloud/SocketProxy.java       |  124 +-
 .../solr/client/solrj/impl/XMLResponseParser.java  |   84 +-
 .../solr/client/solrj/io/stream/JDBCStream.java    |   24 +-
 .../solr/client/solrj/io/stream/ZplotStream.java   |    1 -
 .../solr/client/solrj/request/LukeRequest.java     |   22 +-
 .../solrj/response/json/HeatmapJsonFacet.java      |   11 +-
 .../org/apache/solr/common/cloud/SolrZkClient.java |   19 +-
 .../solr/common/util/FastJavaBinDecoder.java       |    9 -
 .../client/solrj/io/stream/JDBCStreamTest.java     |    5 +-
 .../client/solrj/request/TestLukeRequest.java}     |   37 +-
 solr/test-framework/build.xml                      |   17 +-
 .../solr/cloud/AbstractDistribZkTestBase.java      |   40 +-
 .../apache/solr/cloud/SolrCloudAuthTestCase.java   |   49 +-
 .../java/org/apache/solr/cloud/ZkTestServer.java   |   62 +-
 244 files changed, 9147 insertions(+), 7057 deletions(-)


[lucene-solr] 07/34: Simplify the TextAreaPrintStream and remove unused params (it's a hack anyways): TODO: Change CheckIndex and Optimize to use Appendable instead of PrintStream

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 85be0a429cb0a0e888b742b8b9611e54c2f00ff3
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 12:58:19 2019 +0200

    Simplify the TextAreaPrintStream and remove unused params (it's a hack anyways): TODO: Change CheckIndex and Optimize to use Appendable instead of PrintStream
---
 .../dialog/menubar/CheckIndexDialogFactory.java    |  4 +--
 .../dialog/menubar/OptimizeIndexDialogFactory.java |  2 +-
 .../luke/app/desktop/util/TextAreaPrintStream.java | 31 ++++++----------------
 3 files changed, 11 insertions(+), 26 deletions(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
index c98faa1..e19d32d 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
@@ -275,7 +275,7 @@ public final class CheckIndexDialogFactory implements DialogOpener.DialogFactory
           indicatorLbl.setVisible(true);
           TextAreaPrintStream ps;
           try {
-            ps = new TextAreaPrintStream(logArea, new ByteArrayOutputStream(), StandardCharsets.UTF_8, log);
+            ps = new TextAreaPrintStream(logArea);
             CheckIndex.Status status = toolsModel.checkIndex(ps);
             ps.flush();
             return status;
@@ -355,7 +355,7 @@ public final class CheckIndexDialogFactory implements DialogOpener.DialogFactory
           logArea.setText("");
           TextAreaPrintStream ps;
           try {
-            ps = new TextAreaPrintStream(logArea, new ByteArrayOutputStream(), StandardCharsets.UTF_8, log);
+            ps = new TextAreaPrintStream(logArea);
             toolsModel.repairIndex(status, ps);
             statusLbl.setText("Done");
             ps.flush();
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
index 508e20c..447b10c 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
@@ -220,7 +220,7 @@ public final class OptimizeIndexDialogFactory implements DialogOpener.DialogFact
           indicatorLbl.setVisible(true);
           TextAreaPrintStream ps;
           try {
-            ps = new TextAreaPrintStream(logArea, new ByteArrayOutputStream(), StandardCharsets.UTF_8, log);
+            ps = new TextAreaPrintStream(logArea);
             toolsModel.optimize(expungeCB.isSelected(), (int) maxSegSpnr.getValue(), ps);
             ps.flush();
           } catch (UnsupportedEncodingException e) {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
index 3f8464c..790c1be 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
@@ -19,10 +19,8 @@ package org.apache.lucene.luke.app.desktop.util;
 
 import javax.swing.JTextArea;
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 import java.io.PrintStream;
 import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 
 import org.slf4j.Logger;
@@ -30,36 +28,23 @@ import org.slf4j.Logger;
 /** PrintStream for text areas */
 public final class TextAreaPrintStream extends PrintStream {
 
-  private Logger log;
+  private final ByteArrayOutputStream baos;
 
-  private ByteArrayOutputStream baos;
+  private final JTextArea textArea;
 
-  private JTextArea textArea;
-
-  public TextAreaPrintStream(JTextArea textArea, ByteArrayOutputStream baos, Charset charset, Logger log) throws UnsupportedEncodingException {
-    super(baos, false, charset.name());
-    this.baos = baos;
+  public TextAreaPrintStream(JTextArea textArea) throws UnsupportedEncodingException {
+    super(new ByteArrayOutputStream(), false, StandardCharsets.UTF_8.name()); // TODO: replace by Charset in Java 11
+    this.baos = (ByteArrayOutputStream) out;
     this.textArea = textArea;
-    this.log = log;
     baos.reset();
   }
 
   @Override
-  public void println(String s) {
-    try {
-      baos.write(s.getBytes(StandardCharsets.UTF_8));
-      baos.write('\n');
-    } catch (IOException e) {
-      log.error(e.getMessage(), e);
-    }
-  }
-
-  @Override
   public void flush() {
     try {
-      textArea.append(baos.toString(StandardCharsets.UTF_8.name()));
-    } catch (IOException e) {
-      log.error(e.getMessage(), e);
+      textArea.append(baos.toString(StandardCharsets.UTF_8.name())); // TODO: replace by Charset in Java 11
+    } catch (UnsupportedEncodingException e) {
+      setError();
     } finally {
       baos.reset();
     }


[lucene-solr] 31/34: Execute IndexTools#createNewIndex() asynchronously.

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 3cd6defa575d4d807893fddb78c1a30593089427
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sun Apr 7 15:18:05 2019 +0900

    Execute IndexTools#createNewIndex() asynchronously.
---
 .../dialog/menubar/CreateIndexDialogFactory.java   | 133 ++++++++++++++-------
 .../luke/app/desktop/messages/messages.properties  |   2 +-
 2 files changed, 91 insertions(+), 44 deletions(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java
index 0735c09..03c6262 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java
@@ -28,6 +28,7 @@ import javax.swing.JPanel;
 import javax.swing.JSeparator;
 import javax.swing.JTextArea;
 import javax.swing.JTextField;
+import javax.swing.SwingWorker;
 import java.awt.BorderLayout;
 import java.awt.Dialog;
 import java.awt.Dimension;
@@ -44,6 +45,8 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.SimpleFileVisitor;
 import java.nio.file.attribute.BasicFileAttributes;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 import org.apache.logging.log4j.Logger;
 import org.apache.lucene.luke.app.IndexHandler;
@@ -51,6 +54,7 @@ import org.apache.lucene.luke.app.desktop.Preferences;
 import org.apache.lucene.luke.app.desktop.PreferencesFactory;
 import org.apache.lucene.luke.app.desktop.util.DialogOpener;
 import org.apache.lucene.luke.app.desktop.util.FontUtils;
+import org.apache.lucene.luke.app.desktop.util.ImageUtils;
 import org.apache.lucene.luke.app.desktop.util.MessageUtils;
 import org.apache.lucene.luke.app.desktop.util.StyleConstants;
 import org.apache.lucene.luke.app.desktop.util.URLLabel;
@@ -59,6 +63,7 @@ import org.apache.lucene.luke.models.tools.IndexToolsFactory;
 import org.apache.lucene.luke.util.LoggerFactory;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.util.NamedThreadFactory;
 import org.apache.lucene.util.SuppressForbidden;
 
 /** Factory of create index dialog */
@@ -82,6 +87,14 @@ public class CreateIndexDialogFactory implements DialogOpener.DialogFactory {
 
   private final JButton dataBrowseBtn = new JButton();
 
+  private final JButton clearBtn = new JButton();
+
+  private final JLabel indicatorLbl = new JLabel();
+
+  private final JButton createBtn = new JButton();
+
+  private final JButton cancelBtn = new JButton();
+
   private final ListenerFunctions listeners = new ListenerFunctions();
 
   private JDialog dialog;
@@ -114,11 +127,23 @@ public class CreateIndexDialogFactory implements DialogOpener.DialogFactory {
     dataDirTF.setPreferredSize(new Dimension(250, 30));
     dataDirTF.setEditable(false);
 
+    clearBtn.setText(MessageUtils.getLocalizedMessage("button.clear"));
+    clearBtn.setPreferredSize(new Dimension(70, 30));
+    clearBtn.addActionListener(listeners::clearDataDir);
+
     dataBrowseBtn.setText(FontUtils.elegantIconHtml("&#x6e;", MessageUtils.getLocalizedMessage("button.browse")));
     dataBrowseBtn.setFont(StyleConstants.FONT_BUTTON_LARGE);
     dataBrowseBtn.setPreferredSize(new Dimension(100, 30));
     dataBrowseBtn.addActionListener(listeners::browseDataDirectory);
 
+    indicatorLbl.setIcon(ImageUtils.createImageIcon("indicator.gif", 20, 20));
+    indicatorLbl.setVisible(false);
+
+    createBtn.setText(MessageUtils.getLocalizedMessage("button.create"));
+    createBtn.addActionListener(listeners::createIndex);
+
+    cancelBtn.setText(MessageUtils.getLocalizedMessage("button.cancel"));
+    cancelBtn.addActionListener(e -> dialog.dispose());
   }
 
   @Override
@@ -209,9 +234,7 @@ public class CreateIndexDialogFactory implements DialogOpener.DialogFactory {
     dataDirPath.add(new JLabel(MessageUtils.getLocalizedMessage("createindex.label.datadir")));
     dataDirPath.add(dataDirTF);
     dataDirPath.add(dataBrowseBtn);
-    JButton clearBtn = new JButton(MessageUtils.getLocalizedMessage("button.clear"));
-    clearBtn.setPreferredSize(new Dimension(70, 30));
-    clearBtn.addActionListener(listeners::clearDataDir);
+
     dataDirPath.add(clearBtn);
     panel.add(dataDirPath, BorderLayout.CENTER);
 
@@ -223,12 +246,8 @@ public class CreateIndexDialogFactory implements DialogOpener.DialogFactory {
     panel.setOpaque(false);
     panel.setBorder(BorderFactory.createEmptyBorder(3, 3, 10, 20));
 
-    JButton okBtn = new JButton(MessageUtils.getLocalizedMessage("button.create"));
-    okBtn.addActionListener(listeners::createIndex);
-    panel.add(okBtn);
-
-    JButton cancelBtn = new JButton(MessageUtils.getLocalizedMessage("button.cancel"));
-    cancelBtn.addActionListener(e -> dialog.dispose());
+    panel.add(indicatorLbl);
+    panel.add(createBtn);
     panel.add(cancelBtn);
 
     return panel;
@@ -258,44 +277,72 @@ public class CreateIndexDialogFactory implements DialogOpener.DialogFactory {
 
     void createIndex(ActionEvent e) {
       Path path = Paths.get(locationTF.getText(), dirnameTF.getText());
-
-      try {
-        if (Files.exists(path)) {
-          String message = "The directory " + path.toAbsolutePath().toString() + " already exists.";
-          JOptionPane.showMessageDialog(dialog, message, "Empty index path", JOptionPane.ERROR_MESSAGE);
-        } else {
-          Directory dir = FSDirectory.open(path);
-          IndexTools toolsModel = new IndexToolsFactory().newInstance(dir);
-
-          if (dataDirTF.getText().isEmpty()) {
-            toolsModel.createNewIndex();
-          } else {
-            Path dataPath = Paths.get(dataDirTF.getText());
-            toolsModel.createNewIndex(dataPath.toAbsolutePath().toString());
+      if (Files.exists(path)) {
+        String message = "The directory " + path.toAbsolutePath().toString() + " already exists.";
+        JOptionPane.showMessageDialog(dialog, message, "Empty index path", JOptionPane.ERROR_MESSAGE);
+      } else {
+        // create new index asynchronously
+        ExecutorService executor = Executors.newFixedThreadPool(1, new NamedThreadFactory("create-index-dialog"));
+
+        SwingWorker<Void, Void> task = new SwingWorker<Void, Void>() {
+
+          @Override
+          protected Void doInBackground() throws Exception {
+            setProgress(0);
+            indicatorLbl.setVisible(true);
+            createBtn.setEnabled(false);
+
+            try {
+              Directory dir = FSDirectory.open(path);
+              IndexTools toolsModel = new IndexToolsFactory().newInstance(dir);
+
+              if (dataDirTF.getText().isEmpty()) {
+                // without sample documents
+                toolsModel.createNewIndex();
+              } else {
+                // with sample documents
+                Path dataPath = Paths.get(dataDirTF.getText());
+                toolsModel.createNewIndex(dataPath.toAbsolutePath().toString());
+              }
+
+              indexHandler.open(path.toAbsolutePath().toString(), null, false, false, false);
+              prefs.addHistory(path.toAbsolutePath().toString());
+
+              dirnameTF.setText("");
+              closeDialog();
+            } catch (Exception ex) {
+              // cleanup
+              try {
+                Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
+                  @Override
+                  public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+                    Files.delete(file);
+                    return FileVisitResult.CONTINUE;
+                  }
+                });
+                Files.deleteIfExists(path);
+              } catch (IOException ex2) {
+              }
+
+              log.error("Cannot create index", ex);
+              String message = "See Logs tab or log file for more details.";
+              JOptionPane.showMessageDialog(dialog, message, "Cannot create index", JOptionPane.ERROR_MESSAGE);
+            } finally {
+              setProgress(100);
+            }
+            return null;
           }
 
-          indexHandler.open(path.toAbsolutePath().toString(), null, false, false, false);
-          prefs.addHistory(path.toAbsolutePath().toString());
-          closeDialog();
-        }
-      } catch (Exception ex) {
-        // cleanup
-        try {
-          Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
-            @Override
-            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
-              Files.delete(file);
-              return FileVisitResult.CONTINUE;
-            }
-          });
-          Files.deleteIfExists(path);
-        } catch (IOException ex2) {}
+          @Override
+          protected void done() {
+            indicatorLbl.setVisible(false);
+            createBtn.setEnabled(true);
+          }
+        };
 
-        log.error("Cannot create index", ex);
-        String message = "See Logs tab or log file for more details.";
-        JOptionPane.showMessageDialog(dialog, message, "Cannot create index", JOptionPane.ERROR_MESSAGE);
+        executor.submit(task);
+        executor.shutdown();
       }
-
     }
 
     private void clearDataDir(ActionEvent e) {
diff --git a/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties
index 3323f10..6b3d8e0 100644
--- a/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties
+++ b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties
@@ -82,7 +82,7 @@ createindex.label.option=(Options)
 createindex.label.data_link=http://kdd.ics.uci.edu/databases/20newsgroups/20newsgroups.html
 createindex.label.datadir=Data directory:
 createindex.textarea.data_help1=You can index sample documents from 20 Newsgroups corpus that is available at here:
-createindex.textarea.data_help2=Download and extract the tgz file, then select the extracted directory path.\nCreating an index with the full size corpus can take 30 seconds or so :)
+createindex.textarea.data_help2=Download and extract the tgz file, then select the extracted directory path.\nCreating an index with the full size corpus can take 10 seconds or so :)
 # Optimize index
 optimize.dialog.title=Optimize index
 optimize.label.index_path=Index directory path:


[lucene-solr] 17/34: Fix compile warnings/unused code; fix some of the auxiliary classes (those who compiler complained)

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 12c380b5e318310d0a7987408390cf36d6021e58
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 19:10:05 2019 +0200

    Fix compile warnings/unused code; fix some of the auxiliary classes (those who compiler complained)
---
 lucene/luke/build.xml                              |   4 +-
 .../desktop/components/SearchPanelProvider.java    |   7 -
 .../dialog/analysis/EditFiltersDialogFactory.java  | 117 +++++-----
 .../analysis/TokenAttributeDialogFactory.java      | 128 +++++------
 .../dialog/documents/AddDocumentDialogFactory.java | 243 +++++++++++----------
 .../dialog/documents/TermVectorDialogFactory.java  | 117 +++++-----
 .../fragments/search/FieldValuesPaneProvider.java  | 103 +++++----
 .../fragments/search/MLTPaneProvider.java          | 104 ++++-----
 .../fragments/search/QueryParserPaneProvider.java  | 115 +++++-----
 .../luke/app/desktop/dto/documents/NewField.java   |  11 +-
 .../lucene/luke/models/tools/IndexToolsImpl.java   |   7 +-
 .../util/twentynewsgroups/MessageFilesParser.java  |   3 +-
 12 files changed, 477 insertions(+), 482 deletions(-)

diff --git a/lucene/luke/build.xml b/lucene/luke/build.xml
index 8908bc1..27d999f 100644
--- a/lucene/luke/build.xml
+++ b/lucene/luke/build.xml
@@ -62,7 +62,7 @@
   </target>
 
   <!-- launch Luke -->
-  <target name="launch" depends="compile-core">
+  <target name="launch" depends="compile-core" description="Launch Luke GUI">
     <java classname="org.apache.lucene.luke.app.desktop.LukeMain"
           classpath="${build.dir}/classes/java"
           fork="true"
@@ -70,6 +70,8 @@
       <classpath refid="classpath"/>
     </java>
   </target>
+  
+  <target name="run" depends="launch" description="Launch Luke GUI"/>
 
   <target name="compile-core"
           depends="jar-codecs,jar-backward-codecs,jar-analyzers-common,jar-misc,jar-queryparser,jar-queries,jar-misc,common.compile-core"/>
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/SearchPanelProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/SearchPanelProvider.java
index 6516230..3e402f7 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/SearchPanelProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/SearchPanelProvider.java
@@ -43,7 +43,6 @@ import java.awt.Insets;
 import java.awt.event.ActionEvent;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.Collections;
@@ -428,12 +427,6 @@ public final class SearchPanelProvider implements SearchTabOperator {
     note.add(new JLabel(MessageUtils.getLocalizedMessage("search.label.results.note")));
     panel.add(note, BorderLayout.PAGE_START);
 
-    MouseListener mouseListener = new MouseAdapter() {
-      @Override
-      public void mousePressed(MouseEvent e) {
-        listeners.showContextMenuInResultsTable(e);
-      }
-    };
     TableUtils.setupTable(resultsTable, ListSelectionModel.SINGLE_SELECTION, new SearchResultsTableModel(),
         new MouseAdapter() {
           @Override
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/EditFiltersDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/EditFiltersDialogFactory.java
index 3bdef62..5a964d6 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/EditFiltersDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/EditFiltersDialogFactory.java
@@ -219,86 +219,85 @@ public final class EditFiltersDialogFactory implements DialogOpener.DialogFactor
       listeners.showEditParamsDialog(e);
     }
   }
-}
 
-final class FiltersTableModel extends TableModelBase<FiltersTableModel.Column> {
+  static final class FiltersTableModel extends TableModelBase<FiltersTableModel.Column> {
+
+    enum Column implements TableColumnInfo {
+      DELETE("Delete", 0, Boolean.class, 50),
+      ORDER("Order", 1, Integer.class, 50),
+      TYPE("Factory class", 2, String.class, Integer.MAX_VALUE);
+
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
+
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
+
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-  enum Column implements TableColumnInfo {
-    DELETE("Delete", 0, Boolean.class, 50),
-    ORDER("Order", 1, Integer.class, 50),
-    TYPE("Factory class", 2, String.class, Integer.MAX_VALUE);
+      @Override
+      public int getIndex() {
+        return index;
+      }
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public String getColName() {
-      return colName;
+    FiltersTableModel() {
+      super();
     }
 
-    @Override
-    public int getIndex() {
-      return index;
+    FiltersTableModel(List<String> selectedFilters) {
+      super(selectedFilters.size());
+      for (int i = 0; i < selectedFilters.size(); i++) {
+        data[i][Column.DELETE.getIndex()] = false;
+        data[i][Column.ORDER.getIndex()] = i + 1;
+        data[i][Column.TYPE.getIndex()] = selectedFilters.get(i);
+      }
     }
 
     @Override
-    public Class<?> getType() {
-      return type;
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+      return columnIndex == Column.DELETE.getIndex();
     }
 
     @Override
-    public int getColumnWidth() {
-      return width;
+    public void setValueAt(Object value, int rowIndex, int columnIndex) {
+      data[rowIndex][columnIndex] = value;
     }
-  }
-
-  FiltersTableModel() {
-    super();
-  }
 
-  FiltersTableModel(List<String> selectedFilters) {
-    super(selectedFilters.size());
-    for (int i = 0; i < selectedFilters.size(); i++) {
-      data[i][Column.DELETE.getIndex()] = false;
-      data[i][Column.ORDER.getIndex()] = i + 1;
-      data[i][Column.TYPE.getIndex()] = selectedFilters.get(i);
+    @Override
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
 
-  @Override
-  public boolean isCellEditable(int rowIndex, int columnIndex) {
-    return columnIndex == Column.DELETE.getIndex();
-  }
-
-  @Override
-  public void setValueAt(Object value, int rowIndex, int columnIndex) {
-    data[rowIndex][columnIndex] = value;
-  }
+  static final class TypeCellRenderer implements TableCellRenderer {
 
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
-}
-
-final class TypeCellRenderer implements TableCellRenderer {
+    @Override
+    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+      String[] tmp = ((String) value).split("\\.");
+      String type = tmp[tmp.length - 1];
+      return new JLabel(type);
+    }
 
-  @Override
-  public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
-    String[] tmp = ((String) value).split("\\.");
-    String type = tmp[tmp.length - 1];
-    return new JLabel(type);
   }
 
 }
-
-
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/TokenAttributeDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/TokenAttributeDialogFactory.java
index 5ba07a4..4112699 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/TokenAttributeDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/TokenAttributeDialogFactory.java
@@ -114,83 +114,83 @@ public final class TokenAttributeDialogFactory implements DialogOpener.DialogFac
     return panel;
   }
 
-}
-
-final class AttributeTableModel extends TableModelBase<AttributeTableModel.Column> {
-
-  enum Column implements TableColumnInfo {
-
-    ATTR("Attribute", 0, String.class),
-    NAME("Name", 1, String.class),
-    VALUE("Value", 2, String.class);
-
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-
-    Column(String colName, int index, Class<?> type) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
+  static final class AttributeTableModel extends TableModelBase<AttributeTableModel.Column> {
+
+    enum Column implements TableColumnInfo {
+
+      ATTR("Attribute", 0, String.class),
+      NAME("Name", 1, String.class),
+      VALUE("Value", 2, String.class);
+
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+
+      Column(String colName, int index, Class<?> type) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+      }
+
+      @Override
+      public String getColName() {
+        return colName;
+      }
+
+      @Override
+      public int getIndex() {
+        return index;
+      }
+
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
     }
 
-    @Override
-    public String getColName() {
-      return colName;
-    }
-
-    @Override
-    public int getIndex() {
-      return index;
+    AttributeTableModel(List<TokenAttValue> attrValues) {
+      super(attrValues.size());
+      for (int i = 0; i < attrValues.size(); i++) {
+        TokenAttValue attrValue = attrValues.get(i);
+        data[i][Column.ATTR.getIndex()] = attrValue.getAttClass();
+        data[i][Column.NAME.getIndex()] = attrValue.getName();
+        data[i][Column.VALUE.getIndex()] = attrValue.getValue();
+      }
     }
 
     @Override
-    public Class<?> getType() {
-      return type;
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
 
-  AttributeTableModel(List<TokenAttValue> attrValues) {
-    super(attrValues.size());
-    for (int i = 0; i < attrValues.size(); i++) {
-      TokenAttValue attrValue = attrValues.get(i);
-      data[i][Column.ATTR.getIndex()] = attrValue.getAttClass();
-      data[i][Column.NAME.getIndex()] = attrValue.getName();
-      data[i][Column.VALUE.getIndex()] = attrValue.getValue();
+  static final class TokenAttValue {
+    private String attClass;
+    private String name;
+    private String value;
+
+    public static TokenAttValue of(String attClass, String name, String value) {
+      TokenAttValue attValue = new TokenAttValue();
+      attValue.attClass = attClass;
+      attValue.name = name;
+      attValue.value = value;
+      return attValue;
     }
-  }
 
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
-}
-
-final class TokenAttValue {
-  private String attClass;
-  private String name;
-  private String value;
-
-  public static TokenAttValue of(String attClass, String name, String value) {
-    TokenAttValue attValue = new TokenAttValue();
-    attValue.attClass = attClass;
-    attValue.name = name;
-    attValue.value = value;
-    return attValue;
-  }
+    private TokenAttValue() {
+    }
 
-  private TokenAttValue() {
-  }
+    String getAttClass() {
+      return attClass;
+    }
 
-  String getAttClass() {
-    return attClass;
-  }
+    String getName() {
+      return name;
+    }
 
-  String getName() {
-    return name;
+    String getValue() {
+      return value;
+    }
   }
 
-  String getValue() {
-    return value;
-  }
 }
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/AddDocumentDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/AddDocumentDialogFactory.java
index 6bb7307..0bbeb3e 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/AddDocumentDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/AddDocumentDialogFactory.java
@@ -247,7 +247,7 @@ public final class AddDocumentDialogFactory implements DialogOpener.DialogFactor
     JTable fieldsTable = new JTable();
     TableUtils.setupTable(fieldsTable, ListSelectionModel.SINGLE_SELECTION, new FieldsTableModel(newFieldList), null, 30, 150, 120, 80);
     fieldsTable.setShowGrid(true);
-    JComboBox<Class> typesCombo = new JComboBox<>(presetFieldClasses);
+    JComboBox<Class<? extends IndexableField>> typesCombo = new JComboBox<>(presetFieldClasses);
     typesCombo.setRenderer((list, value, index, isSelected, cellHasFocus) -> new JLabel(value.getSimpleName()));
     fieldsTable.getColumnModel().getColumn(FieldsTableModel.Column.TYPE.getIndex()).setCellEditor(new DefaultCellEditor(typesCombo));
     for (int i = 0; i < fieldsTable.getModel().getRowCount(); i++) {
@@ -324,7 +324,8 @@ public final class AddDocumentDialogFactory implements DialogOpener.DialogFactor
     return panel;
   }
 
-  private final Class[] presetFieldClasses = new Class[]{
+  @SuppressWarnings({"unchecked", "rawtypes"})
+  private final Class<? extends IndexableField>[] presetFieldClasses = new Class[]{
       TextField.class, StringField.class,
       IntPoint.class, LongPoint.class, FloatPoint.class, DoublePoint.class,
       SortedDocValuesField.class, SortedSetDocValuesField.class,
@@ -369,40 +370,41 @@ public final class AddDocumentDialogFactory implements DialogOpener.DialogFactor
 
     @SuppressWarnings("unchecked")
     private IndexableField toIndexableField(NewField nf) throws Exception {
+      final Constructor<? extends IndexableField> constr;
       if (nf.getType().equals(TextField.class) || nf.getType().equals(StringField.class)) {
         Field.Store store = nf.isStored() ? Field.Store.YES : Field.Store.NO;
-        Constructor<IndexableField> constr = nf.getType().getConstructor(String.class, String.class, Field.Store.class);
+        constr = nf.getType().getConstructor(String.class, String.class, Field.Store.class);
         return constr.newInstance(nf.getName(), nf.getValue(), store);
       } else if (nf.getType().equals(IntPoint.class)) {
-        Constructor<IndexableField> constr = nf.getType().getConstructor(String.class, int[].class);
+        constr = nf.getType().getConstructor(String.class, int[].class);
         int[] values = NumericUtils.convertToIntArray(nf.getValue(), false);
         return constr.newInstance(nf.getName(), values);
       } else if (nf.getType().equals(LongPoint.class)) {
-        Constructor<IndexableField> constr = nf.getType().getConstructor(String.class, long[].class);
+        constr = nf.getType().getConstructor(String.class, long[].class);
         long[] values = NumericUtils.convertToLongArray(nf.getValue(), false);
         return constr.newInstance(nf.getName(), values);
       } else if (nf.getType().equals(FloatPoint.class)) {
-        Constructor<IndexableField> constr = nf.getType().getConstructor(String.class, float[].class);
+        constr = nf.getType().getConstructor(String.class, float[].class);
         float[] values = NumericUtils.convertToFloatArray(nf.getValue(), false);
         return constr.newInstance(nf.getName(), values);
       } else if (nf.getType().equals(DoublePoint.class)) {
-        Constructor<IndexableField> constr = nf.getType().getConstructor(String.class, double[].class);
+        constr = nf.getType().getConstructor(String.class, double[].class);
         double[] values = NumericUtils.convertToDoubleArray(nf.getValue(), false);
         return constr.newInstance(nf.getName(), values);
       } else if (nf.getType().equals(SortedDocValuesField.class) ||
           nf.getType().equals(SortedSetDocValuesField.class)) {
-        Constructor<IndexableField> constr = nf.getType().getConstructor(String.class, BytesRef.class);
+        constr = nf.getType().getConstructor(String.class, BytesRef.class);
         return constr.newInstance(nf.getName(), new BytesRef(nf.getValue()));
       } else if (nf.getType().equals(NumericDocValuesField.class) ||
           nf.getType().equals(SortedNumericDocValuesField.class)) {
-        Constructor<IndexableField> constr = nf.getType().getConstructor(String.class, long.class);
+        constr = nf.getType().getConstructor(String.class, long.class);
         long value = NumericUtils.tryConvertToLongValue(nf.getValue());
         return constr.newInstance(nf.getName(), value);
       } else if (nf.getType().equals(StoredField.class)) {
-        Constructor<IndexableField> constr = nf.getType().getConstructor(String.class, String.class);
+        constr = nf.getType().getConstructor(String.class, String.class);
         return constr.newInstance(nf.getName(), nf.getValue());
       } else if (nf.getType().equals(Field.class)) {
-        Constructor<IndexableField> constr = nf.getType().getConstructor(String.class, String.class, IndexableFieldType.class);
+        constr = nf.getType().getConstructor(String.class, String.class, IndexableFieldType.class);
         return constr.newInstance(nf.getName(), nf.getValue(), nf.getFieldType());
       } else {
         // TODO: unknown field
@@ -446,145 +448,146 @@ public final class AddDocumentDialogFactory implements DialogOpener.DialogFactor
     }
   }
 
-}
+  static final class FieldsTableModel extends TableModelBase<FieldsTableModel.Column> {
 
-final class FieldsTableModel extends TableModelBase<FieldsTableModel.Column> {
+    enum Column implements TableColumnInfo {
+      DEL("Del", 0, Boolean.class),
+      NAME("Name", 1, String.class),
+      TYPE("Type", 2, Class.class),
+      OPTIONS("Options", 3, String.class),
+      VALUE("Value", 4, String.class);
 
-  enum Column implements TableColumnInfo {
-    DEL("Del", 0, Boolean.class),
-    NAME("Name", 1, String.class),
-    TYPE("Type", 2, Class.class),
-    OPTIONS("Options", 3, String.class),
-    VALUE("Value", 4, String.class);
+      private String colName;
+      private int index;
+      private Class<?> type;
 
-    private String colName;
-    private int index;
-    private Class<?> type;
+      Column(String colName, int index, Class<?> type) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+      }
+
+      @Override
+      public String getColName() {
+        return colName;
+      }
+
+      @Override
+      public int getIndex() {
+        return index;
+      }
+
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
 
-    Column(String colName, int index, Class<?> type) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
     }
 
-    @Override
-    public String getColName() {
-      return colName;
+    private final List<NewField> newFieldList;
+
+    FieldsTableModel(List<NewField> newFieldList) {
+      super(newFieldList.size());
+      this.newFieldList = newFieldList;
     }
 
     @Override
-    public int getIndex() {
-      return index;
+    public Object getValueAt(int rowIndex, int columnIndex) {
+      if (columnIndex == Column.OPTIONS.getIndex()) {
+        return "";
+      }
+      return data[rowIndex][columnIndex];
     }
 
     @Override
-    public Class<?> getType() {
-      return type;
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+      return columnIndex != Column.OPTIONS.getIndex();
     }
 
-  }
-
-  private final List<NewField> newFieldList;
-
-  FieldsTableModel(List<NewField> newFieldList) {
-    super(newFieldList.size());
-    this.newFieldList = newFieldList;
-  }
-
-  @Override
-  public Object getValueAt(int rowIndex, int columnIndex) {
-    if (columnIndex == Column.OPTIONS.getIndex()) {
-      return "";
+    @SuppressWarnings("unchecked")
+    @Override
+    public void setValueAt(Object value, int rowIndex, int columnIndex) {
+      data[rowIndex][columnIndex] = value;
+      fireTableCellUpdated(rowIndex, columnIndex);
+      NewField selectedField = newFieldList.get(rowIndex);
+      if (columnIndex == Column.DEL.getIndex()) {
+        selectedField.setDeleted((Boolean) value);
+      } else if (columnIndex == Column.NAME.getIndex()) {
+        selectedField.setName((String) value);
+      } else if (columnIndex == Column.TYPE.getIndex()) {
+        selectedField.setType((Class<? extends IndexableField>) value);
+        selectedField.resetFieldType((Class<? extends IndexableField>) value);
+        selectedField.setStored(selectedField.getFieldType().stored());
+      } else if (columnIndex == Column.VALUE.getIndex()) {
+        selectedField.setValue((String) value);
+      }
     }
-    return data[rowIndex][columnIndex];
-  }
-
-  @Override
-  public boolean isCellEditable(int rowIndex, int columnIndex) {
-    return columnIndex != Column.OPTIONS.getIndex();
-  }
 
-  @Override
-  public void setValueAt(Object value, int rowIndex, int columnIndex) {
-    data[rowIndex][columnIndex] = value;
-    fireTableCellUpdated(rowIndex, columnIndex);
-    NewField selectedField = newFieldList.get(rowIndex);
-    if (columnIndex == Column.DEL.getIndex()) {
-      selectedField.setDeleted((Boolean) value);
-    } else if (columnIndex == Column.NAME.getIndex()) {
-      selectedField.setName((String) value);
-    } else if (columnIndex == Column.TYPE.getIndex()) {
-      selectedField.setType((Class) value);
-      selectedField.resetFieldType((Class) value);
-      selectedField.setStored(selectedField.getFieldType().stored());
-    } else if (columnIndex == Column.VALUE.getIndex()) {
-      selectedField.setValue((String) value);
+    @Override
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
 
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
-}
+  static final class TypeCellRenderer implements TableCellRenderer {
 
-final class TypeCellRenderer implements TableCellRenderer {
-
-  @Override
-  public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
-    String simpleName = ((Class) value).getSimpleName();
-    return new JLabel(simpleName);
+    @SuppressWarnings("unchecked")
+    @Override
+    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+      String simpleName = ((Class<? extends IndexableField>) value).getSimpleName();
+      return new JLabel(simpleName);
+    }
   }
-}
 
-final class OptionsCellRenderer implements TableCellRenderer {
+  static final class OptionsCellRenderer implements TableCellRenderer {
 
-  private JDialog dialog;
+    private JDialog dialog;
 
-  private final IndexOptionsDialogFactory indexOptionsDialogFactory;
+    private final IndexOptionsDialogFactory indexOptionsDialogFactory;
 
-  private final List<NewField> newFieldList;
+    private final List<NewField> newFieldList;
 
-  private final JPanel panel = new JPanel();
+    private final JPanel panel = new JPanel();
 
-  private JTable table;
+    private JTable table;
 
-  public OptionsCellRenderer(JDialog dialog, IndexOptionsDialogFactory indexOptionsDialogFactory, List<NewField> newFieldList) {
-    this.dialog = dialog;
-    this.indexOptionsDialogFactory = indexOptionsDialogFactory;
-    this.newFieldList = newFieldList;
-  }
+    public OptionsCellRenderer(JDialog dialog, IndexOptionsDialogFactory indexOptionsDialogFactory, List<NewField> newFieldList) {
+      this.dialog = dialog;
+      this.indexOptionsDialogFactory = indexOptionsDialogFactory;
+      this.newFieldList = newFieldList;
+    }
 
-  @Override
-  @SuppressWarnings("unchecked")
-  public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
-    if (table != null && this.table != table) {
-      this.table = table;
-      final JTableHeader header = table.getTableHeader();
-      if (header != null) {
-        panel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
-        panel.setBorder(UIManager.getBorder("TableHeader.cellBorder"));
-        panel.add(new JLabel(value.toString()));
-
-        JLabel optionsLbl = new JLabel("options");
-        table.addMouseListener(new MouseAdapter() {
-          @Override
-          public void mouseClicked(MouseEvent e) {
-            int row = table.rowAtPoint(e.getPoint());
-            int col = table.columnAtPoint(e.getPoint());
-            if (row >= 0 && col == FieldsTableModel.Column.OPTIONS.getIndex()) {
-              String title = "Index options for:";
-              new DialogOpener<>(indexOptionsDialogFactory).open(dialog, title, 500, 500,
-                  (factory) -> {
-                    factory.setNewField(newFieldList.get(row));
-                  });
+    @Override
+    @SuppressWarnings("unchecked")
+    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+      if (table != null && this.table != table) {
+        this.table = table;
+        final JTableHeader header = table.getTableHeader();
+        if (header != null) {
+          panel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
+          panel.setBorder(UIManager.getBorder("TableHeader.cellBorder"));
+          panel.add(new JLabel(value.toString()));
+
+          JLabel optionsLbl = new JLabel("options");
+          table.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseClicked(MouseEvent e) {
+              int row = table.rowAtPoint(e.getPoint());
+              int col = table.columnAtPoint(e.getPoint());
+              if (row >= 0 && col == FieldsTableModel.Column.OPTIONS.getIndex()) {
+                String title = "Index options for:";
+                new DialogOpener<>(indexOptionsDialogFactory).open(dialog, title, 500, 500,
+                    (factory) -> {
+                      factory.setNewField(newFieldList.get(row));
+                    });
+              }
             }
-          }
-        });
-        panel.add(FontUtils.toLinkText(optionsLbl));
+          });
+          panel.add(FontUtils.toLinkText(optionsLbl));
+        }
       }
+      return panel;
     }
-    return panel;
-  }
 
-}
\ No newline at end of file
+  }
+}
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/TermVectorDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/TermVectorDialogFactory.java
index bbbb46f..2e7da58 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/TermVectorDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/TermVectorDialogFactory.java
@@ -118,73 +118,72 @@ public final class TermVectorDialogFactory implements DialogOpener.DialogFactory
     return panel;
   }
 
-}
+  static final class TermVectorTableModel extends TableModelBase<TermVectorTableModel.Column> {
+
+    enum Column implements TableColumnInfo {
+
+      TERM("Term", 0, String.class),
+      FREQ("Freq", 1, Long.class),
+      POSITIONS("Positions", 2, String.class),
+      OFFSETS("Offsets", 3, String.class);
+
+      private String colName;
+      private int index;
+      private Class<?> type;
+
+      Column(String colName, int index, Class<?> type) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+      }
+
+      @Override
+      public String getColName() {
+        return colName;
+      }
+
+      @Override
+      public int getIndex() {
+        return index;
+      }
+
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
+    }
 
-final class TermVectorTableModel extends TableModelBase<TermVectorTableModel.Column> {
+    TermVectorTableModel() {
+      super();
+    }
 
-  enum Column implements TableColumnInfo {
+    TermVectorTableModel(List<TermVectorEntry> tvEntries) {
+      super(tvEntries.size());
 
-    TERM("Term", 0, String.class),
-    FREQ("Freq", 1, Long.class),
-    POSITIONS("Positions", 2, String.class),
-    OFFSETS("Offsets", 3, String.class);
+      for (int i = 0; i < tvEntries.size(); i++) {
+        TermVectorEntry entry = tvEntries.get(i);
 
-    private String colName;
-    private int index;
-    private Class<?> type;
+        String termText = entry.getTermText();
+        long freq = tvEntries.get(i).getFreq();
+        String positions = String.join(",",
+            entry.getPositions().stream()
+                .map(pos -> Integer.toString(pos.getPosition()))
+                .collect(Collectors.toList()));
+        String offsets = String.join(",",
+            entry.getPositions().stream()
+                .filter(pos -> pos.getStartOffset().isPresent() && pos.getEndOffset().isPresent())
+                .map(pos -> Integer.toString(pos.getStartOffset().orElse(-1)) + "-" + Integer.toString(pos.getEndOffset().orElse(-1)))
+                .collect(Collectors.toList())
+        );
 
-    Column(String colName, int index, Class<?> type) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-    }
+        data[i] = new Object[]{termText, freq, positions, offsets};
+      }
 
-    @Override
-    public String getColName() {
-      return colName;
     }
 
     @Override
-    public int getIndex() {
-      return index;
-    }
-
-    @Override
-    public Class<?> getType() {
-      return type;
-    }
-  }
-
-  TermVectorTableModel() {
-    super();
-  }
-
-  TermVectorTableModel(List<TermVectorEntry> tvEntries) {
-    super(tvEntries.size());
-
-    for (int i = 0; i < tvEntries.size(); i++) {
-      TermVectorEntry entry = tvEntries.get(i);
-
-      String termText = entry.getTermText();
-      long freq = tvEntries.get(i).getFreq();
-      String positions = String.join(",",
-          entry.getPositions().stream()
-              .map(pos -> Integer.toString(pos.getPosition()))
-              .collect(Collectors.toList()));
-      String offsets = String.join(",",
-          entry.getPositions().stream()
-              .filter(pos -> pos.getStartOffset().isPresent() && pos.getEndOffset().isPresent())
-              .map(pos -> Integer.toString(pos.getStartOffset().orElse(-1)) + "-" + Integer.toString(pos.getEndOffset().orElse(-1)))
-              .collect(Collectors.toList())
-      );
-
-      data[i] = new Object[]{termText, freq, positions, offsets};
+    protected Column[] columnInfos() {
+      return Column.values();
     }
-
   }
-
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
-}
\ No newline at end of file
+}
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/FieldValuesPaneProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/FieldValuesPaneProvider.java
index 5869fcf..1217bf9 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/FieldValuesPaneProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/FieldValuesPaneProvider.java
@@ -134,74 +134,73 @@ public final class FieldValuesPaneProvider implements FieldValuesTabOperator {
     }
   }
 
-}
+  static final class FieldsTableModel extends TableModelBase<FieldsTableModel.Column> {
+
+    enum Column implements TableColumnInfo {
+      LOAD("Load", 0, Boolean.class, 50),
+      FIELD("Field", 1, String.class, Integer.MAX_VALUE);
+
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
+
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
 
-final class FieldsTableModel extends TableModelBase<FieldsTableModel.Column> {
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-  enum Column implements TableColumnInfo {
-    LOAD("Load", 0, Boolean.class, 50),
-    FIELD("Field", 1, String.class, Integer.MAX_VALUE);
+      @Override
+      public int getIndex() {
+        return index;
+      }
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public String getColName() {
-      return colName;
+    FieldsTableModel() {
+      super();
     }
 
-    @Override
-    public int getIndex() {
-      return index;
+    FieldsTableModel(Collection<String> fields) {
+      super(fields.size());
+      int i = 0;
+      for (String field : fields) {
+        data[i][Column.LOAD.getIndex()] = true;
+        data[i][Column.FIELD.getIndex()] = field;
+        i++;
+      }
     }
 
     @Override
-    public Class<?> getType() {
-      return type;
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+      return columnIndex == Column.LOAD.getIndex();
     }
 
     @Override
-    public int getColumnWidth() {
-      return width;
+    public void setValueAt(Object value, int rowIndex, int columnIndex) {
+      data[rowIndex][columnIndex] = value;
+      fireTableCellUpdated(rowIndex, columnIndex);
     }
-  }
-
-  FieldsTableModel() {
-    super();
-  }
 
-  FieldsTableModel(Collection<String> fields) {
-    super(fields.size());
-    int i = 0;
-    for (String field : fields) {
-      data[i][Column.LOAD.getIndex()] = true;
-      data[i][Column.FIELD.getIndex()] = field;
-      i++;
+    @Override
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
-
-  @Override
-  public boolean isCellEditable(int rowIndex, int columnIndex) {
-    return columnIndex == Column.LOAD.getIndex();
-  }
-
-  @Override
-  public void setValueAt(Object value, int rowIndex, int columnIndex) {
-    data[rowIndex][columnIndex] = value;
-    fireTableCellUpdated(rowIndex, columnIndex);
-  }
-
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
 }
\ No newline at end of file
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/MLTPaneProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/MLTPaneProvider.java
index 168abe0..ad791a4 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/MLTPaneProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/MLTPaneProvider.java
@@ -46,6 +46,7 @@ import org.apache.lucene.luke.app.desktop.components.TabSwitcherProxy;
 import org.apache.lucene.luke.app.desktop.components.TabbedPaneProvider;
 import org.apache.lucene.luke.app.desktop.components.TableColumnInfo;
 import org.apache.lucene.luke.app.desktop.components.TableModelBase;
+import org.apache.lucene.luke.app.desktop.components.fragments.search.FieldValuesPaneProvider.FieldsTableModel;
 import org.apache.lucene.luke.app.desktop.util.FontUtils;
 import org.apache.lucene.luke.app.desktop.util.MessageUtils;
 import org.apache.lucene.luke.app.desktop.util.TableUtils;
@@ -230,74 +231,73 @@ public final class MLTPaneProvider implements MLTTabOperator {
     }
   }
 
-}
+  static final class MLTFieldsTableModel extends TableModelBase<MLTFieldsTableModel.Column> {
 
-final class MLTFieldsTableModel extends TableModelBase<MLTFieldsTableModel.Column> {
+    enum Column implements TableColumnInfo {
+      SELECT("Select", 0, Boolean.class, 50),
+      FIELD("Field", 1, String.class, Integer.MAX_VALUE);
 
-  enum Column implements TableColumnInfo {
-    SELECT("Select", 0, Boolean.class, 50),
-    FIELD("Field", 1, String.class, Integer.MAX_VALUE);
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
+
+      @Override
+      public String getColName() {
+        return colName;
+      }
+
+      @Override
+      public int getIndex() {
+        return index;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
+
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public String getColName() {
-      return colName;
+    MLTFieldsTableModel() {
+      super();
     }
 
-    @Override
-    public int getIndex() {
-      return index;
+    MLTFieldsTableModel(Collection<String> fields) {
+      super(fields.size());
+      int i = 0;
+      for (String field : fields) {
+        data[i][Column.SELECT.getIndex()] = true;
+        data[i][Column.FIELD.getIndex()] = field;
+        i++;
+      }
     }
 
     @Override
-    public Class<?> getType() {
-      return type;
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+      return columnIndex == Column.SELECT.getIndex();
     }
 
     @Override
-    public int getColumnWidth() {
-      return width;
+    public void setValueAt(Object value, int rowIndex, int columnIndex) {
+      data[rowIndex][columnIndex] = value;
+      fireTableCellUpdated(rowIndex, columnIndex);
     }
-  }
-
-  MLTFieldsTableModel() {
-    super();
-  }
 
-  MLTFieldsTableModel(Collection<String> fields) {
-    super(fields.size());
-    int i = 0;
-    for (String field : fields) {
-      data[i][Column.SELECT.getIndex()] = true;
-      data[i][Column.FIELD.getIndex()] = field;
-      i++;
+    @Override
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
-
-  @Override
-  public boolean isCellEditable(int rowIndex, int columnIndex) {
-    return columnIndex == Column.SELECT.getIndex();
-  }
-
-  @Override
-  public void setValueAt(Object value, int rowIndex, int columnIndex) {
-    data[rowIndex][columnIndex] = value;
-    fireTableCellUpdated(rowIndex, columnIndex);
-  }
-
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
 }
\ No newline at end of file
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/QueryParserPaneProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/QueryParserPaneProvider.java
index fcd6ea4..ab4ab78 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/QueryParserPaneProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/search/QueryParserPaneProvider.java
@@ -51,8 +51,6 @@ import org.apache.lucene.luke.app.desktop.util.MessageUtils;
 import org.apache.lucene.luke.app.desktop.util.TableUtils;
 import org.apache.lucene.luke.models.search.QueryParserConfig;
 
-import static org.apache.lucene.luke.app.desktop.components.fragments.search.PointTypesTableModel.NumType.INT;
-
 /** Provider of the QueryParser pane (tab) */
 public final class QueryParserPaneProvider implements QueryParserTabOperator {
 
@@ -346,7 +344,7 @@ public final class QueryParserPaneProvider implements QueryParserTabOperator {
 
     // set default type to Integer
     for (int i = 0; i < rangeSearchableFields.size(); i++) {
-      pointRangeQueryTable.setValueAt(INT.name(), i, PointTypesTableModel.Column.TYPE.getIndex());
+      pointRangeQueryTable.setValueAt(PointTypesTableModel.NumType.INT.name(), i, PointTypesTableModel.Column.TYPE.getIndex());
     }
 
   }
@@ -436,80 +434,79 @@ public final class QueryParserPaneProvider implements QueryParserTabOperator {
 
   }
 
-}
+  static final class PointTypesTableModel extends TableModelBase<PointTypesTableModel.Column> {
 
-final class PointTypesTableModel extends TableModelBase<PointTypesTableModel.Column> {
+    enum Column implements TableColumnInfo {
 
-  enum Column implements TableColumnInfo {
+      FIELD("Field", 0, String.class, 300),
+      TYPE("Numeric Type", 1, NumType.class, 150);
 
-    FIELD("Field", 0, String.class, 300),
-    TYPE("Numeric Type", 1, NumType.class, 150);
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
-    }
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-    @Override
-    public String getColName() {
-      return colName;
-    }
+      @Override
+      public int getIndex() {
+        return index;
+      }
 
-    @Override
-    public int getIndex() {
-      return index;
-    }
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
 
-    @Override
-    public Class<?> getType() {
-      return type;
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public int getColumnWidth() {
-      return width;
-    }
-  }
+    enum NumType {
 
-  enum NumType {
+      INT, LONG, FLOAT, DOUBLE
 
-    INT, LONG, FLOAT, DOUBLE
+    }
 
-  }
+    PointTypesTableModel() {
+      super();
+    }
 
-  PointTypesTableModel() {
-    super();
-  }
+    PointTypesTableModel(Collection<String> rangeSearchableFields) {
+      super(rangeSearchableFields.size());
+      int i = 0;
+      for (String field : rangeSearchableFields) {
+        data[i++][Column.FIELD.getIndex()] = field;
+      }
+    }
 
-  PointTypesTableModel(Collection<String> rangeSearchableFields) {
-    super(rangeSearchableFields.size());
-    int i = 0;
-    for (String field : rangeSearchableFields) {
-      data[i++][Column.FIELD.getIndex()] = field;
+    @Override
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+      return columnIndex == Column.TYPE.getIndex();
     }
-  }
 
-  @Override
-  public boolean isCellEditable(int rowIndex, int columnIndex) {
-    return columnIndex == Column.TYPE.getIndex();
-  }
+    @Override
+    public void setValueAt(Object value, int rowIndex, int columnIndex) {
+      data[rowIndex][columnIndex] = value;
+      fireTableCellUpdated(rowIndex, columnIndex);
+    }
 
-  @Override
-  public void setValueAt(Object value, int rowIndex, int columnIndex) {
-    data[rowIndex][columnIndex] = value;
-    fireTableCellUpdated(rowIndex, columnIndex);
+    @Override
+    protected Column[] columnInfos() {
+      return Column.values();
+    }
   }
 
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
 }
-
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/dto/documents/NewField.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/dto/documents/NewField.java
index 2080eb5..44162a0 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/dto/documents/NewField.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/dto/documents/NewField.java
@@ -32,6 +32,7 @@ import org.apache.lucene.document.SortedSetDocValuesField;
 import org.apache.lucene.document.StoredField;
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.IndexableFieldType;
 import org.apache.lucene.luke.app.desktop.util.NumericUtils;
 
@@ -42,7 +43,7 @@ public final class NewField {
 
   private String name;
 
-  private Class<?> type;
+  private Class<? extends IndexableField> type;
 
   private String value;
 
@@ -84,19 +85,19 @@ public final class NewField {
     this.name = Objects.requireNonNull(name);
   }
 
-  public Class<?> getTypeProperty() {
+  public Class<? extends IndexableField> getTypeProperty() {
     return type;
   }
 
-  public Class getType() {
+  public Class<? extends IndexableField> getType() {
     return type;
   }
 
-  public void setType(Class type) {
+  public void setType(Class<? extends IndexableField> type) {
     this.type = Objects.requireNonNull(type);
   }
 
-  public void resetFieldType(Class type) {
+  public void resetFieldType(Class<?> type) {
     if (type.equals(TextField.class)) {
       fieldType = new TextField("", "", Field.Store.NO).fieldType();
     } else if (type.equals(StringField.class)) {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexToolsImpl.java b/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexToolsImpl.java
index 67ef6cd..1b9eb55 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexToolsImpl.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/tools/IndexToolsImpl.java
@@ -59,13 +59,14 @@ public final class IndexToolsImpl extends LukeModel implements IndexTools {
 
   private final boolean keepAllCommits;
 
-  private static final Class[] presetFieldClasses = new Class[]{
+  @SuppressWarnings({"unchecked", "rawtypes"})
+  private final List<Class<? extends Field>> presetFieldClasses = Arrays.asList(
       TextField.class, StringField.class,
       IntPoint.class, LongPoint.class, FloatPoint.class, DoublePoint.class,
       SortedDocValuesField.class, SortedSetDocValuesField.class,
       NumericDocValuesField.class, SortedNumericDocValuesField.class,
       StoredField.class
-  };
+  );
 
   /**
    * Constructs an IndexToolsImpl that holds given {@link Directory}.
@@ -210,6 +211,6 @@ public final class IndexToolsImpl extends LukeModel implements IndexTools {
   @Override
   @SuppressWarnings("unchecked")
   public Collection<Class<? extends Field>> getPresetFields() {
-    return Arrays.asList(presetFieldClasses);
+    return presetFieldClasses;
   }
 }
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/MessageFilesParser.java b/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/MessageFilesParser.java
index ab41d32..5a2fe73 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/MessageFilesParser.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/MessageFilesParser.java
@@ -95,8 +95,9 @@ public class MessageFilesParser  extends SimpleFileVisitor<Path> {
             try {
               message.setLines(Integer.parseInt(ary[1].trim()));
             } catch (NumberFormatException e) {}
+            break;
           default:
-              break;
+            break;
         }
 
         line = br.readLine();


[lucene-solr] 21/34: Make auxiliary classes static inner classes

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit d1b40dcab4c663c8cdcaa5ebe9ede9f6fbaba12f
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sat Apr 6 09:19:17 2019 +0900

    Make auxiliary classes static inner classes
---
 .../desktop/components/AnalysisPanelProvider.java  |  97 ++---
 .../desktop/components/CommitsPanelProvider.java   | 190 ++++-----
 .../desktop/components/DocumentsPanelProvider.java | 437 +++++++++++----------
 .../desktop/components/OverviewPanelProvider.java  | 179 +++++----
 .../desktop/components/SearchPanelProvider.java    | 111 +++---
 .../dialog/analysis/EditParamsDialogFactory.java   | 107 ++---
 .../luke/app/desktop/util/TextAreaAppender.java    |   1 -
 .../org/apache/lucene/luke/util/LoggerFactory.java |   2 +-
 8 files changed, 562 insertions(+), 562 deletions(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/AnalysisPanelProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/AnalysisPanelProvider.java
index c38272a..70c2291 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/AnalysisPanelProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/AnalysisPanelProvider.java
@@ -375,66 +375,67 @@ public final class AnalysisPanelProvider implements AnalysisTabOperator {
 
   }
 
-}
-
-final class TokensTableModel extends TableModelBase<TokensTableModel.Column> {
+  static final class TokensTableModel extends TableModelBase<TokensTableModel.Column> {
+
+    enum Column implements TableColumnInfo {
+      TERM("Term", 0, String.class, 150),
+      ATTR("Attributes", 1, String.class, 1000);
+
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
+
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
 
-  enum Column implements TableColumnInfo {
-    TERM("Term", 0, String.class, 150),
-    ATTR("Attributes", 1, String.class, 1000);
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      @Override
+      public int getIndex() {
+        return index;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
-    }
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
 
-    @Override
-    public String getColName() {
-      return colName;
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public int getIndex() {
-      return index;
+    TokensTableModel() {
+      super();
     }
 
-    @Override
-    public Class<?> getType() {
-      return type;
+    TokensTableModel(List<Analysis.Token> tokens) {
+      super(tokens.size());
+      for (int i = 0; i < tokens.size(); i++) {
+        Analysis.Token token = tokens.get(i);
+        data[i][Column.TERM.getIndex()] = token.getTerm();
+        List<String> attValues = token.getAttributes().stream()
+            .flatMap(att -> att.getAttValues().entrySet().stream()
+                .map(e -> e.getKey() + "=" + e.getValue()))
+            .collect(Collectors.toList());
+        data[i][Column.ATTR.getIndex()] = String.join(",", attValues);
+      }
     }
 
     @Override
-    public int getColumnWidth() {
-      return width;
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
 
-  TokensTableModel() {
-    super();
-  }
-
-  TokensTableModel(List<Analysis.Token> tokens) {
-    super(tokens.size());
-    for (int i = 0; i < tokens.size(); i++) {
-      Analysis.Token token = tokens.get(i);
-      data[i][Column.TERM.getIndex()] = token.getTerm();
-      List<String> attValues = token.getAttributes().stream()
-          .flatMap(att -> att.getAttValues().entrySet().stream()
-              .map(e -> e.getKey() + "=" + e.getValue()))
-          .collect(Collectors.toList());
-      data[i][Column.ATTR.getIndex()] = String.join(",", attValues);
-    }
-  }
+}
 
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
-}
\ No newline at end of file
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/CommitsPanelProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/CommitsPanelProvider.java
index e7a2333..d06abcc 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/CommitsPanelProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/CommitsPanelProvider.java
@@ -444,132 +444,132 @@ public final class CommitsPanelProvider {
     DIAGNOSTICS, ATTRIBUTES, CODEC;
   }
 
-}
+  static final class FilesTableModel extends TableModelBase<FilesTableModel.Column> {
 
-final class FilesTableModel extends TableModelBase<FilesTableModel.Column> {
+    enum Column implements TableColumnInfo {
 
-  enum Column implements TableColumnInfo {
+      FILENAME("Filename", 0, String.class, 200),
+      SIZE("Size", 1, String.class, Integer.MAX_VALUE);
 
-    FILENAME("Filename", 0, String.class, 200),
-    SIZE("Size", 1, String.class, Integer.MAX_VALUE);
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
-    }
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-    @Override
-    public String getColName() {
-      return colName;
+      @Override
+      public int getIndex() {
+        return index;
+      }
+
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
+
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public int getIndex() {
-      return index;
+    FilesTableModel() {
+      super();
     }
 
-    @Override
-    public Class<?> getType() {
-      return type;
+    FilesTableModel(List<File> files) {
+      super(files.size());
+      for (int i = 0; i < files.size(); i++) {
+        File file = files.get(i);
+        data[i][Column.FILENAME.getIndex()] = file.getFileName();
+        data[i][Column.SIZE.getIndex()] = file.getDisplaySize();
+      }
     }
 
     @Override
-    public int getColumnWidth() {
-      return width;
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
 
-  FilesTableModel() {
-    super();
-  }
+  static final class SegmentsTableModel extends TableModelBase<SegmentsTableModel.Column> {
 
-  FilesTableModel(List<File> files) {
-    super(files.size());
-    for (int i = 0; i < files.size(); i++) {
-      File file = files.get(i);
-      data[i][Column.FILENAME.getIndex()] = file.getFileName();
-      data[i][Column.SIZE.getIndex()] = file.getDisplaySize();
-    }
-  }
+    enum Column implements TableColumnInfo {
 
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
-}
+      NAME("Name", 0, String.class, 60),
+      MAXDOCS("Max docs", 1, Integer.class, 60),
+      DELS("Dels", 2, Integer.class, 60),
+      DELGEN("Del gen", 3, Long.class, 60),
+      VERSION("Lucene ver.", 4, String.class, 60),
+      CODEC("Codec", 5, String.class, 100),
+      SIZE("Size", 6, String.class, 150);
 
-final class SegmentsTableModel extends TableModelBase<SegmentsTableModel.Column> {
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
 
-  enum Column implements TableColumnInfo {
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
 
-    NAME("Name", 0, String.class, 60),
-    MAXDOCS("Max docs", 1, Integer.class, 60),
-    DELS("Dels", 2, Integer.class, 60),
-    DELGEN("Del gen", 3, Long.class, 60),
-    VERSION("Lucene ver.", 4, String.class, 60),
-    CODEC("Codec", 5, String.class, 100),
-    SIZE("Size", 6, String.class, 150);
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      @Override
+      public int getIndex() {
+        return index;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
-    }
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
 
-    @Override
-    public String getColName() {
-      return colName;
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public int getIndex() {
-      return index;
+    SegmentsTableModel() {
+      super();
     }
 
-    @Override
-    public Class<?> getType() {
-      return type;
+    SegmentsTableModel(List<Segment> segments) {
+      super(segments.size());
+      for (int i = 0; i < segments.size(); i++) {
+        Segment segment = segments.get(i);
+        data[i][Column.NAME.getIndex()] = segment.getName();
+        data[i][Column.MAXDOCS.getIndex()] = segment.getMaxDoc();
+        data[i][Column.DELS.getIndex()] = segment.getDelCount();
+        data[i][Column.DELGEN.getIndex()] = segment.getDelGen();
+        data[i][Column.VERSION.getIndex()] = segment.getLuceneVer();
+        data[i][Column.CODEC.getIndex()] = segment.getCodecName();
+        data[i][Column.SIZE.getIndex()] = segment.getDisplaySize();
+      }
     }
 
     @Override
-    public int getColumnWidth() {
-      return width;
-    }
-  }
-
-  SegmentsTableModel() {
-    super();
-  }
-
-  SegmentsTableModel(List<Segment> segments) {
-    super(segments.size());
-    for (int i = 0; i < segments.size(); i++) {
-      Segment segment = segments.get(i);
-      data[i][Column.NAME.getIndex()] = segment.getName();
-      data[i][Column.MAXDOCS.getIndex()] = segment.getMaxDoc();
-      data[i][Column.DELS.getIndex()] = segment.getDelCount();
-      data[i][Column.DELGEN.getIndex()] = segment.getDelGen();
-      data[i][Column.VERSION.getIndex()] = segment.getLuceneVer();
-      data[i][Column.CODEC.getIndex()] = segment.getCodecName();
-      data[i][Column.SIZE.getIndex()] = segment.getDisplaySize();
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
+}
 
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
-}
\ No newline at end of file
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/DocumentsPanelProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/DocumentsPanelProvider.java
index 299c3f5..144941b 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/DocumentsPanelProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/DocumentsPanelProvider.java
@@ -851,264 +851,265 @@ public final class DocumentsPanelProvider implements DocumentsTabOperator {
     }
   }
 
-}
+  static final class PosTableModel extends TableModelBase<PosTableModel.Column> {
 
-final class PosTableModel extends TableModelBase<PosTableModel.Column> {
+    enum Column implements TableColumnInfo {
 
-  enum Column implements TableColumnInfo {
+      POSITION("Position", 0, Integer.class, 80),
+      OFFSETS("Offsets", 1, String.class, 120),
+      PAYLOAD("Payload", 2, String.class, 300);
 
-    POSITION("Position", 0, Integer.class, 80),
-    OFFSETS("Offsets", 1, String.class, 120),
-    PAYLOAD("Payload", 2, String.class, 300);
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
-    }
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-    @Override
-    public String getColName() {
-      return colName;
-    }
+      @Override
+      public int getIndex() {
+        return index;
+      }
 
-    @Override
-    public int getIndex() {
-      return index;
-    }
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
 
-    @Override
-    public Class<?> getType() {
-      return type;
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public int getColumnWidth() {
-      return width;
+    PosTableModel() {
+      super();
     }
-  }
 
-  PosTableModel() {
-    super();
-  }
+    PosTableModel(List<TermPosting> postings) {
+      super(postings.size());
 
-  PosTableModel(List<TermPosting> postings) {
-    super(postings.size());
+      for (int i = 0; i < postings.size(); i++) {
+        TermPosting p = postings.get(i);
 
-    for (int i = 0; i < postings.size(); i++) {
-      TermPosting p = postings.get(i);
+        int position = postings.get(i).getPosition();
+        String offset = null;
+        if (p.getStartOffset() >= 0 && p.getEndOffset() >= 0) {
+          offset = p.getStartOffset() + "-" + p.getEndOffset();
+        }
+        String payload = null;
+        if (p.getPayload() != null) {
+          payload = BytesRefUtils.decode(p.getPayload());
+        }
 
-      int position = postings.get(i).getPosition();
-      String offset = null;
-      if (p.getStartOffset() >= 0 && p.getEndOffset() >= 0) {
-        offset = p.getStartOffset() + "-" + p.getEndOffset();
-      }
-      String payload = null;
-      if (p.getPayload() != null) {
-        payload = BytesRefUtils.decode(p.getPayload());
+        data[i] = new Object[]{position, offset, payload};
       }
+    }
 
-      data[i] = new Object[]{position, offset, payload};
+    @Override
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
 
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
-}
+  static final class DocumentsTableModel extends TableModelBase<DocumentsTableModel.Column> {
 
-final class DocumentsTableModel extends TableModelBase<DocumentsTableModel.Column> {
+    enum Column implements TableColumnInfo {
+      FIELD("Field", 0, String.class, 150),
+      FLAGS("Flags", 1, String.class, 200),
+      NORM("Norm", 2, Long.class, 80),
+      VALUE("Value", 3, String.class, 500);
 
-  enum Column implements TableColumnInfo {
-    FIELD("Field", 0, String.class, 150),
-    FLAGS("Flags", 1, String.class, 200),
-    NORM("Norm", 2, Long.class, 80),
-    VALUE("Value", 3, String.class, 500);
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
-    }
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-    @Override
-    public String getColName() {
-      return colName;
-    }
+      @Override
+      public int getIndex() {
+        return index;
+      }
 
-    @Override
-    public int getIndex() {
-      return index;
-    }
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
 
-    @Override
-    public Class<?> getType() {
-      return type;
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public int getColumnWidth() {
-      return width;
+    DocumentsTableModel() {
+      super();
     }
-  }
-
-  DocumentsTableModel() {
-    super();
-  }
 
-  DocumentsTableModel(List<DocumentField> doc) {
-    super(doc.size());
-
-    for (int i = 0; i < doc.size(); i++) {
-      DocumentField docField = doc.get(i);
-      String field = docField.getName();
-      String flags = flags(docField);
-      long norm = docField.getNorm();
-      String value = null;
-      if (docField.getStringValue() != null) {
-        value = docField.getStringValue();
-      } else if (docField.getNumericValue() != null) {
-        value = String.valueOf(docField.getNumericValue());
-      } else if (docField.getBinaryValue() != null) {
-        value = String.valueOf(docField.getBinaryValue());
+    DocumentsTableModel(List<DocumentField> doc) {
+      super(doc.size());
+
+      for (int i = 0; i < doc.size(); i++) {
+        DocumentField docField = doc.get(i);
+        String field = docField.getName();
+        String flags = flags(docField);
+        long norm = docField.getNorm();
+        String value = null;
+        if (docField.getStringValue() != null) {
+          value = docField.getStringValue();
+        } else if (docField.getNumericValue() != null) {
+          value = String.valueOf(docField.getNumericValue());
+        } else if (docField.getBinaryValue() != null) {
+          value = String.valueOf(docField.getBinaryValue());
+        }
+        data[i] = new Object[]{field, flags, norm, value};
       }
-      data[i] = new Object[]{field, flags, norm, value};
     }
-  }
 
-  private static String flags(org.apache.lucene.luke.models.documents.DocumentField f) {
-    StringBuilder sb = new StringBuilder();
-    // index options
-    if (f.getIdxOptions() == null || f.getIdxOptions() == IndexOptions.NONE) {
-      sb.append("-----");
-    } else {
-      sb.append("I");
-      switch (f.getIdxOptions()) {
-        case DOCS:
-          sb.append("d---");
-          break;
-        case DOCS_AND_FREQS:
-          sb.append("df--");
-          break;
-        case DOCS_AND_FREQS_AND_POSITIONS:
-          sb.append("dfp-");
-          break;
-        case DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS:
-          sb.append("dfpo");
-          break;
-        default:
-          sb.append("----");
+    private static String flags(org.apache.lucene.luke.models.documents.DocumentField f) {
+      StringBuilder sb = new StringBuilder();
+      // index options
+      if (f.getIdxOptions() == null || f.getIdxOptions() == IndexOptions.NONE) {
+        sb.append("-----");
+      } else {
+        sb.append("I");
+        switch (f.getIdxOptions()) {
+          case DOCS:
+            sb.append("d---");
+            break;
+          case DOCS_AND_FREQS:
+            sb.append("df--");
+            break;
+          case DOCS_AND_FREQS_AND_POSITIONS:
+            sb.append("dfp-");
+            break;
+          case DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS:
+            sb.append("dfpo");
+            break;
+          default:
+            sb.append("----");
+        }
       }
-    }
-    // has norm?
-    if (f.hasNorms()) {
-      sb.append("N");
-    } else {
-      sb.append("-");
-    }
-    // has payloads?
-    if (f.hasPayloads()) {
-      sb.append("P");
-    } else {
-      sb.append("-");
-    }
-    // stored?
-    if (f.isStored()) {
-      sb.append("S");
-    } else {
-      sb.append("-");
-    }
-    // binary?
-    if (f.getBinaryValue() != null) {
-      sb.append("B");
-    } else {
-      sb.append("-");
-    }
-    // numeric?
-    if (f.getNumericValue() == null) {
-      sb.append("----");
-    } else {
-      sb.append("#");
-      // try faking it
-      Number numeric = f.getNumericValue();
-      if (numeric instanceof Integer) {
-        sb.append("i32");
-      } else if (numeric instanceof Long) {
-        sb.append("i64");
-      } else if (numeric instanceof Float) {
-        sb.append("f32");
-      } else if (numeric instanceof Double) {
-        sb.append("f64");
-      } else if (numeric instanceof Short) {
-        sb.append("i16");
-      } else if (numeric instanceof Byte) {
-        sb.append("i08");
-      } else if (numeric instanceof BigDecimal) {
-        sb.append("b^d");
-      } else if (numeric instanceof BigInteger) {
-        sb.append("b^i");
+      // has norm?
+      if (f.hasNorms()) {
+        sb.append("N");
       } else {
-        sb.append("???");
+        sb.append("-");
       }
-    }
-    // has term vector?
-    if (f.hasTermVectors()) {
-      sb.append("V");
-    } else {
-      sb.append("-");
-    }
-    // doc values
-    if (f.getDvType() == null || f.getDvType() == DocValuesType.NONE) {
-      sb.append("-------");
-    } else {
-      sb.append("D");
-      switch (f.getDvType()) {
-        case NUMERIC:
-          sb.append("number");
-          break;
-        case BINARY:
-          sb.append("binary");
-          break;
-        case SORTED:
-          sb.append("sorted");
-          break;
-        case SORTED_NUMERIC:
-          sb.append("srtnum");
-          break;
-        case SORTED_SET:
-          sb.append("srtset");
-          break;
-        default:
-          sb.append("??????");
+      // has payloads?
+      if (f.hasPayloads()) {
+        sb.append("P");
+      } else {
+        sb.append("-");
       }
+      // stored?
+      if (f.isStored()) {
+        sb.append("S");
+      } else {
+        sb.append("-");
+      }
+      // binary?
+      if (f.getBinaryValue() != null) {
+        sb.append("B");
+      } else {
+        sb.append("-");
+      }
+      // numeric?
+      if (f.getNumericValue() == null) {
+        sb.append("----");
+      } else {
+        sb.append("#");
+        // try faking it
+        Number numeric = f.getNumericValue();
+        if (numeric instanceof Integer) {
+          sb.append("i32");
+        } else if (numeric instanceof Long) {
+          sb.append("i64");
+        } else if (numeric instanceof Float) {
+          sb.append("f32");
+        } else if (numeric instanceof Double) {
+          sb.append("f64");
+        } else if (numeric instanceof Short) {
+          sb.append("i16");
+        } else if (numeric instanceof Byte) {
+          sb.append("i08");
+        } else if (numeric instanceof BigDecimal) {
+          sb.append("b^d");
+        } else if (numeric instanceof BigInteger) {
+          sb.append("b^i");
+        } else {
+          sb.append("???");
+        }
+      }
+      // has term vector?
+      if (f.hasTermVectors()) {
+        sb.append("V");
+      } else {
+        sb.append("-");
+      }
+      // doc values
+      if (f.getDvType() == null || f.getDvType() == DocValuesType.NONE) {
+        sb.append("-------");
+      } else {
+        sb.append("D");
+        switch (f.getDvType()) {
+          case NUMERIC:
+            sb.append("number");
+            break;
+          case BINARY:
+            sb.append("binary");
+            break;
+          case SORTED:
+            sb.append("sorted");
+            break;
+          case SORTED_NUMERIC:
+            sb.append("srtnum");
+            break;
+          case SORTED_SET:
+            sb.append("srtset");
+            break;
+          default:
+            sb.append("??????");
+        }
+      }
+      // point values
+      if (f.getPointDimensionCount() == 0) {
+        sb.append("----");
+      } else {
+        sb.append("T");
+        sb.append(f.getPointNumBytes());
+        sb.append("/");
+        sb.append(f.getPointDimensionCount());
+      }
+      return sb.toString();
     }
-    // point values
-    if (f.getPointDimensionCount() == 0) {
-      sb.append("----");
-    } else {
-      sb.append("T");
-      sb.append(f.getPointNumBytes());
-      sb.append("/");
-      sb.append(f.getPointDimensionCount());
+
+    @Override
+    protected Column[] columnInfos() {
+      return Column.values();
     }
-    return sb.toString();
   }
 
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
 }
+
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/OverviewPanelProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/OverviewPanelProvider.java
index 2dd91ea..c85e93b 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/OverviewPanelProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/OverviewPanelProvider.java
@@ -521,125 +521,124 @@ public final class OverviewPanelProvider {
 
   }
 
-}
+  static final class TermCountsTableModel extends TableModelBase<TermCountsTableModel.Column> {
 
-final class TermCountsTableModel extends TableModelBase<TermCountsTableModel.Column> {
+    enum Column implements TableColumnInfo {
 
-  enum Column implements TableColumnInfo {
+      NAME("Name", 0, String.class, 150),
+      TERM_COUNT("Term count", 1, Long.class, 100),
+      RATIO("%", 2, String.class, Integer.MAX_VALUE);
 
-    NAME("Name", 0, String.class, 150),
-    TERM_COUNT("Term count", 1, Long.class, 100),
-    RATIO("%", 2, String.class, Integer.MAX_VALUE);
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
-    }
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-    @Override
-    public String getColName() {
-      return colName;
+      @Override
+      public int getIndex() {
+        return index;
+      }
+
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
+
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public int getIndex() {
-      return index;
+    TermCountsTableModel() {
+      super();
     }
 
-    @Override
-    public Class<?> getType() {
-      return type;
+    TermCountsTableModel(double numTerms, Map<String, Long> termCounts) {
+      super(termCounts.size());
+      int i = 0;
+      for (Map.Entry<String, Long> e : termCounts.entrySet()) {
+        String term = e.getKey();
+        Long count = e.getValue();
+        data[i++] = new Object[]{term, count, String.format(Locale.ENGLISH, "%.2f %%", count / numTerms * 100)};
+      }
     }
 
     @Override
-    public int getColumnWidth() {
-      return width;
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
 
-  TermCountsTableModel() {
-    super();
-  }
+  static final class TopTermsTableModel extends TableModelBase<TopTermsTableModel.Column> {
 
-  TermCountsTableModel(double numTerms, Map<String, Long> termCounts) {
-    super(termCounts.size());
-    int i = 0;
-    for (Map.Entry<String, Long> e : termCounts.entrySet()) {
-      String term = e.getKey();
-      Long count = e.getValue();
-      data[i++] = new Object[]{term, count, String.format(Locale.ENGLISH, "%.2f %%", count / numTerms * 100)};
-    }
-  }
+    enum Column implements TableColumnInfo {
+      RANK("Rank", 0, Integer.class, 50),
+      FREQ("Freq", 1, Integer.class, 80),
+      TEXT("Text", 2, String.class, Integer.MAX_VALUE);
 
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
-}
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
 
-final class TopTermsTableModel extends TableModelBase<TopTermsTableModel.Column> {
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
 
-  enum Column implements TableColumnInfo {
-    RANK("Rank", 0, Integer.class, 50),
-    FREQ("Freq", 1, Integer.class, 80),
-    TEXT("Text", 2, String.class, Integer.MAX_VALUE);
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      @Override
+      public int getIndex() {
+        return index;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
-    }
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
 
-    @Override
-    public String getColName() {
-      return colName;
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public int getIndex() {
-      return index;
+    TopTermsTableModel() {
+      super();
     }
 
-    @Override
-    public Class<?> getType() {
-      return type;
+    TopTermsTableModel(List<TermStats> termStats, int numTerms) {
+      super(Math.min(numTerms, termStats.size()));
+      for (int i = 0; i < data.length; i++) {
+        int rank = i + 1;
+        int freq = termStats.get(i).getDocFreq();
+        String termText = termStats.get(i).getDecodedTermText();
+        data[i] = new Object[]{rank, freq, termText};
+      }
     }
 
     @Override
-    public int getColumnWidth() {
-      return width;
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
-
-  TopTermsTableModel() {
-    super();
-  }
-
-  TopTermsTableModel(List<TermStats> termStats, int numTerms) {
-    super(Math.min(numTerms, termStats.size()));
-    for (int i = 0; i < data.length; i++) {
-      int rank = i + 1;
-      int freq = termStats.get(i).getDocFreq();
-      String termText = termStats.get(i).getDecodedTermText();
-      data[i] = new Object[]{rank, freq, termText};
-    }
-  }
-
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
-}
\ No newline at end of file
+}
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/SearchPanelProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/SearchPanelProvider.java
index 3e402f7..f94517a 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/SearchPanelProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/SearchPanelProvider.java
@@ -764,72 +764,71 @@ public final class SearchPanelProvider implements SearchTabOperator {
     }
   }
 
-}
-
-final class SearchResultsTableModel extends TableModelBase<SearchResultsTableModel.Column> {
+  static final class SearchResultsTableModel extends TableModelBase<SearchResultsTableModel.Column> {
+
+    enum Column implements TableColumnInfo {
+      DOCID("Doc ID", 0, Integer.class, 50),
+      SCORE("Score", 1, Float.class, 100),
+      VALUE("Field Values", 2, String.class, 800);
+
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
+
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
 
-  enum Column implements TableColumnInfo {
-    DOCID("Doc ID", 0, Integer.class, 50),
-    SCORE("Score", 1, Float.class, 100),
-    VALUE("Field Values", 2, String.class, 800);
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      @Override
+      public int getIndex() {
+        return index;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
-    }
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
 
-    @Override
-    public String getColName() {
-      return colName;
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
     }
 
-    @Override
-    public int getIndex() {
-      return index;
+    SearchResultsTableModel() {
+      super();
     }
 
-    @Override
-    public Class<?> getType() {
-      return type;
+    SearchResultsTableModel(SearchResults results) {
+      super(results.size());
+      for (int i = 0; i < results.size(); i++) {
+        SearchResults.Doc doc = results.getHits().get(i);
+        data[i][Column.DOCID.getIndex()] = doc.getDocId();
+        if (!Float.isNaN(doc.getScore())) {
+          data[i][Column.SCORE.getIndex()] = doc.getScore();
+        } else {
+          data[i][Column.SCORE.getIndex()] = 1.0f;
+        }
+        List<String> concatValues = doc.getFieldValues().entrySet().stream().map(e -> {
+          String v = String.join(",", Arrays.asList(e.getValue()));
+          return e.getKey() + "=" + v + ";";
+        }).collect(Collectors.toList());
+        data[i][Column.VALUE.getIndex()] = String.join(" ", concatValues);
+      }
     }
 
     @Override
-    public int getColumnWidth() {
-      return width;
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
-
-  SearchResultsTableModel() {
-    super();
-  }
-
-  SearchResultsTableModel(SearchResults results) {
-    super(results.size());
-    for (int i = 0; i < results.size(); i++) {
-      SearchResults.Doc doc = results.getHits().get(i);
-      data[i][Column.DOCID.getIndex()] = doc.getDocId();
-      if (!Float.isNaN(doc.getScore())) {
-        data[i][Column.SCORE.getIndex()] = doc.getScore();
-      } else {
-        data[i][Column.SCORE.getIndex()] = 1.0f;
-      }
-      List<String> concatValues = doc.getFieldValues().entrySet().stream().map(e -> {
-        String v = String.join(",", Arrays.asList(e.getValue()));
-        return e.getKey() + "=" + v + ";";
-      }).collect(Collectors.toList());
-      data[i][Column.VALUE.getIndex()] = String.join(" ", concatValues);
-    }
-  }
-
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
-}
\ No newline at end of file
+}
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/EditParamsDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/EditParamsDialogFactory.java
index 67d0a6d..f9a30da 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/EditParamsDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/analysis/EditParamsDialogFactory.java
@@ -179,75 +179,76 @@ public final class EditParamsDialogFactory implements DialogOpener.DialogFactory
     });
   }
 
-}
+  static final class ParamsTableModel extends TableModelBase<ParamsTableModel.Column> {
+
+    enum Column implements TableColumnInfo {
+      DELETE("Delete", 0, Boolean.class, 50),
+      NAME("Name", 1, String.class, 150),
+      VALUE("Value", 2, String.class, Integer.MAX_VALUE);
+
+      private final String colName;
+      private final int index;
+      private final Class<?> type;
+      private final int width;
+
+      Column(String colName, int index, Class<?> type, int width) {
+        this.colName = colName;
+        this.index = index;
+        this.type = type;
+        this.width = width;
+      }
 
-final class ParamsTableModel extends TableModelBase<ParamsTableModel.Column> {
+      @Override
+      public String getColName() {
+        return colName;
+      }
 
-  enum Column implements TableColumnInfo {
-    DELETE("Delete", 0, Boolean.class, 50),
-    NAME("Name", 1, String.class, 150),
-    VALUE("Value", 2, String.class, Integer.MAX_VALUE);
+      @Override
+      public int getIndex() {
+        return index;
+      }
 
-    private final String colName;
-    private final int index;
-    private final Class<?> type;
-    private final int width;
+      @Override
+      public Class<?> getType() {
+        return type;
+      }
 
-    Column(String colName, int index, Class<?> type, int width) {
-      this.colName = colName;
-      this.index = index;
-      this.type = type;
-      this.width = width;
-    }
+      @Override
+      public int getColumnWidth() {
+        return width;
+      }
 
-    @Override
-    public String getColName() {
-      return colName;
     }
 
-    @Override
-    public int getIndex() {
-      return index;
+    private static final int PARAM_SIZE = 20;
+
+    ParamsTableModel(Map<String, String> params) {
+      super(PARAM_SIZE);
+      List<String> keys = new ArrayList<>(params.keySet());
+      for (int i = 0; i < keys.size(); i++) {
+        data[i][Column.NAME.getIndex()] = keys.get(i);
+        data[i][Column.VALUE.getIndex()] = params.get(keys.get(i));
+      }
+      for (int i = 0; i < data.length; i++) {
+        data[i][Column.DELETE.getIndex()] = false;
+      }
     }
 
     @Override
-    public Class<?> getType() {
-      return type;
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+      return true;
     }
 
     @Override
-    public int getColumnWidth() {
-      return width;
+    public void setValueAt(Object value, int rowIndex, int columnIndex) {
+      data[rowIndex][columnIndex] = value;
     }
 
-  }
-
-  private static final int PARAM_SIZE = 20;
-
-  ParamsTableModel(Map<String, String> params) {
-    super(PARAM_SIZE);
-    List<String> keys = new ArrayList<>(params.keySet());
-    for (int i = 0; i < keys.size(); i++) {
-      data[i][Column.NAME.getIndex()] = keys.get(i);
-      data[i][Column.VALUE.getIndex()] = params.get(keys.get(i));
-    }
-    for (int i = 0; i < data.length; i++) {
-      data[i][Column.DELETE.getIndex()] = false;
+    @Override
+    protected Column[] columnInfos() {
+      return Column.values();
     }
   }
 
-  @Override
-  public boolean isCellEditable(int rowIndex, int columnIndex) {
-    return true;
-  }
-
-  @Override
-  public void setValueAt(Object value, int rowIndex, int columnIndex) {
-    data[rowIndex][columnIndex] = value;
-  }
-
-  @Override
-  protected Column[] columnInfos() {
-    return Column.values();
-  }
 }
+
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
index 41cab03..b7b1d42 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
@@ -19,7 +19,6 @@ package org.apache.lucene.luke.app.desktop.util;
 
 import javax.swing.JTextArea;
 import javax.swing.SwingUtilities;
-
 import java.io.Serializable;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
index c98d552..4735d64 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
@@ -20,8 +20,8 @@ package org.apache.lucene.luke.util;
 import java.nio.charset.StandardCharsets;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.LoggerContext;
 import org.apache.logging.log4j.core.appender.FileAppender;


[lucene-solr] 25/34: Show implementation version if it is not null, otherwise empty string.

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 89de76a64b07268df19fce74e694174c920d289e
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sat Apr 6 18:27:23 2019 +0900

    Show implementation version if it is not null, otherwise empty string.
---
 .../app/desktop/components/dialog/menubar/AboutDialogFactory.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
index d6e418a..c90bf9f 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
@@ -40,6 +40,7 @@ import java.awt.Insets;
 import java.awt.Window;
 import java.io.IOException;
 import java.net.URISyntaxException;
+import java.util.Objects;
 
 import org.apache.lucene.LucenePackage;
 import org.apache.lucene.luke.app.desktop.Preferences;
@@ -158,9 +159,11 @@ public final class AboutDialogFactory implements DialogOpener.DialogFactory {
     return panel;
   }
 
+  private static final String LUCENE_IMPLEMENTATION_VERSION = LucenePackage.get().getImplementationVersion();
+
   private static final String LICENSE_NOTICE =
       "<p>[Implementation Version]</p>" +
-          "<p>" + LucenePackage.get().getImplementationVersion() + "</p>" +
+          "<p>" + (Objects.nonNull(LUCENE_IMPLEMENTATION_VERSION) ? LUCENE_IMPLEMENTATION_VERSION : "") + "</p>" +
           "<p>[License]</p>" +
           "<p>Luke is distributed under <a href=\"http://www.apache.org/licenses/LICENSE-2.0\">Apache License Version 2.0</a> (http://www.apache.org/licenses/LICENSE-2.0) " +
           "and includes <a href=\"https://www.elegantthemes.com/blog/resources/elegant-icon-font\">The Elegant Icon Font</a> (https://www.elegantthemes.com/blog/resources/elegant-icon-font) " +


[lucene-solr] 14/34: Better log setup (test detection was removed). This also passes security manager.

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 529ded44b2581c0e7a7fb43ac3908e36eba7b51e
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 15:22:49 2019 +0200

    Better log setup (test detection was removed). This also passes security manager.
---
 .../apache/lucene/luke/app/desktop/LukeMain.java   |  3 ++
 .../org/apache/lucene/luke/util/LoggerFactory.java | 52 ++++++++++------------
 lucene/tools/junit4/tests.policy                   |  1 -
 3 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
index 4339ed0..673127d 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
@@ -36,6 +36,9 @@ import static org.apache.lucene.luke.app.desktop.util.ExceptionHandler.handle;
 /** Entry class for desktop Luke */
 public class LukeMain {
 
+  static {
+    LoggerFactory.initGuiLogging();
+  }
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private static JFrame frame;
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
index ff7e7e4..4a383b1 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
@@ -19,6 +19,7 @@ package org.apache.lucene.luke.util;
 
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.LoggerContext;
 import org.apache.logging.log4j.core.appender.FileAppender;
@@ -34,41 +35,36 @@ import org.apache.lucene.luke.app.desktop.util.TextAreaAppender;
  */
 public class LoggerFactory {
 
-  private static final LoggerContext context;
-  static {
-    if (System.getProperty("tests.LUCENE_VERSION") != null) {
-      context= LoggerContext.getContext();
-    } else {
-      ConfigurationBuilder<BuiltConfiguration> builder = ConfigurationBuilderFactory.newConfigurationBuilder();
-      builder.add(builder.newRootLogger(Level.INFO));
-      context = Configurator.initialize(builder.build());
+  public static void initGuiLogging() {
+    ConfigurationBuilder<BuiltConfiguration> builder = ConfigurationBuilderFactory.newConfigurationBuilder();
+    builder.add(builder.newRootLogger(Level.INFO));
+    LoggerContext context = Configurator.initialize(builder.build());
 
-      PatternLayout layout = PatternLayout.newBuilder()
-          .withPattern("[%d{ISO8601}] %5p (%F:%L) - %m%n")
-          .build();
-
-      Appender fileAppender = FileAppender.newBuilder()
-          .setName("File")
-          .setLayout(layout)
-          .withFileName(System.getProperty("user.home") + "/.luke.d/luke.log")
-          .withAppend(false)
-            .build();
-      fileAppender.start();
+    PatternLayout layout = PatternLayout.newBuilder()
+        .withPattern("[%d{ISO8601}] %5p (%F:%L) - %m%n")
+        .build();
 
-      Appender textAreaAppender = TextAreaAppender.newBuilder()
-          .setName("TextArea")
-          .setLayout(layout)
+    Appender fileAppender = FileAppender.newBuilder()
+        .setName("File")
+        .setLayout(layout)
+        .withFileName(System.getProperty("user.home") + "/.luke.d/luke.log")
+        .withAppend(false)
           .build();
-      textAreaAppender.start();
+    fileAppender.start();
+
+    Appender textAreaAppender = TextAreaAppender.newBuilder()
+        .setName("TextArea")
+        .setLayout(layout)
+        .build();
+    textAreaAppender.start();
 
-      context.getRootLogger().addAppender(fileAppender);
-      context.getRootLogger().addAppender(textAreaAppender);
-      context.updateLoggers();
-    }
+    context.getRootLogger().addAppender(fileAppender);
+    context.getRootLogger().addAppender(textAreaAppender);
+    context.updateLoggers();
   }
 
   public static Logger getLogger(Class<?> clazz) {
-    return context.getLogger(clazz.getName());
+    return LogManager.getLogger(clazz);
   }
 
 }
diff --git a/lucene/tools/junit4/tests.policy b/lucene/tools/junit4/tests.policy
index 0209bff..7494981 100644
--- a/lucene/tools/junit4/tests.policy
+++ b/lucene/tools/junit4/tests.policy
@@ -70,7 +70,6 @@ grant {
   permission java.lang.RuntimePermission "getenv.*";
   permission java.lang.RuntimePermission "getClassLoader";
   permission java.lang.RuntimePermission "setContextClassLoader";
-  permission javax.management.MBeanServerPermission "createMBeanServer";
 
   // read access to all system properties:
   permission java.util.PropertyPermission "*", "read";


[lucene-solr] 06/34: Remove log4j2 configuration file, instead configurate programatically

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 2594f735142d332c9780f3dfc8d1b7e9e7bd4225
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Fri Apr 5 19:20:37 2019 +0900

    Remove log4j2 configuration file, instead configurate programatically
---
 lucene/luke/ivy.xml                                |  5 --
 .../apache/lucene/luke/app/AbstractHandler.java    |  4 +-
 .../org/apache/lucene/luke/app/IndexHandler.java   |  4 +-
 .../apache/lucene/luke/app/desktop/LukeMain.java   |  5 +-
 .../dialog/documents/AddDocumentDialogFactory.java |  4 +-
 .../dialog/menubar/CheckIndexDialogFactory.java    |  4 +-
 .../dialog/menubar/CreateIndexDialogFactory.java   |  4 +-
 .../dialog/menubar/OpenIndexDialogFactory.java     |  4 +-
 .../dialog/menubar/OptimizeIndexDialogFactory.java |  4 +-
 .../luke/app/desktop/util/ExceptionHandler.java    |  4 +-
 .../luke/app/desktop/util/TextAreaAppender.java    | 35 +++++------
 .../luke/app/desktop/util/TextAreaPrintStream.java |  2 +-
 .../lucene/luke/models/commits/CommitsImpl.java    |  4 +-
 .../luke/models/documents/DocumentsImpl.java       |  4 +-
 .../luke/models/documents/TermVectorsAdapter.java  |  4 +-
 .../lucene/luke/models/search/SearchImpl.java      |  4 +-
 .../apache/lucene/luke/models/util/IndexUtils.java |  4 +-
 .../util/twentynewsgroups/MessageFilesParser.java  |  4 +-
 .../org/apache/lucene/luke/util/LoggerFactory.java | 68 ++++++++++++++++++++++
 .../lucene/luke/util/reflection/ClassScanner.java  |  4 +-
 .../luke/util/reflection/SubtypeCollector.java     |  4 +-
 lucene/luke/src/resources/log4j2.xml               | 44 --------------
 lucene/luke/src/test/log4j2-test.xml               | 24 --------
 23 files changed, 119 insertions(+), 128 deletions(-)

diff --git a/lucene/luke/ivy.xml b/lucene/luke/ivy.xml
index 41ec924..b560926 100644
--- a/lucene/luke/ivy.xml
+++ b/lucene/luke/ivy.xml
@@ -29,11 +29,6 @@
                 conf="logging"/>
     <dependency org="org.apache.logging.log4j" name="log4j-core" rev="${/org.apache.logging.log4j/log4j-core}"
                 conf="logging"/>
-    <dependency org="org.apache.logging.log4j" name="log4j-slf4j-impl" rev="${/org.apache.logging.log4j/log4j-slf4j-impl}" conf="logging"/>
-    <dependency org="org.apache.logging.log4j" name="log4j-1.2-api" rev="${/org.apache.logging.log4j/log4j-1.2-api}"
-                conf="logging"/>
-    <dependency org="org.slf4j" name="slf4j-api" rev="${/org.slf4j/slf4j-api}" conf="logging"/>
-
     <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
   </dependencies>
 </ivy-module>
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/AbstractHandler.java b/lucene/luke/src/java/org/apache/lucene/luke/app/AbstractHandler.java
index 9ce673c..ab967a8 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/AbstractHandler.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/AbstractHandler.java
@@ -21,8 +21,8 @@ import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.lucene.luke.util.LoggerFactory;
 
 /** Abstract handler class */
 public abstract class AbstractHandler<T extends Observer> {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/IndexHandler.java b/lucene/luke/src/java/org/apache/lucene/luke/app/IndexHandler.java
index 5c91918..17e4070 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/IndexHandler.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/IndexHandler.java
@@ -20,12 +20,12 @@ package org.apache.lucene.luke.app;
 import java.lang.invoke.MethodHandles;
 import java.util.Objects;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.luke.app.desktop.util.MessageUtils;
 import org.apache.lucene.luke.models.LukeException;
 import org.apache.lucene.luke.models.util.IndexUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.lucene.luke.util.LoggerFactory;
 
 /** Index open/close handler */
 public final class IndexHandler extends AbstractHandler<IndexObserver> {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
index f731d99..7926d94 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
@@ -23,13 +23,13 @@ import java.awt.GraphicsEnvironment;
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.luke.app.desktop.components.LukeWindowProvider;
 import org.apache.lucene.luke.app.desktop.components.dialog.menubar.OpenIndexDialogFactory;
 import org.apache.lucene.luke.app.desktop.util.DialogOpener;
 import org.apache.lucene.luke.app.desktop.util.FontUtils;
 import org.apache.lucene.luke.app.desktop.util.MessageUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.lucene.luke.util.LoggerFactory;
 
 import static org.apache.lucene.luke.app.desktop.util.ExceptionHandler.handle;
 
@@ -71,6 +71,7 @@ public class LukeMain {
   }
 
   public static void main(String[] args) throws Exception {
+    LoggerFactory.initializeContext();
 
     String lookAndFeelClassName = UIManager.getSystemLookAndFeelClassName();
     if (!lookAndFeelClassName.contains("AquaLookAndFeel") && !lookAndFeelClassName.contains("PlasticXPLookAndFeel")) {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/AddDocumentDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/AddDocumentDialogFactory.java
index 69e6aac..6bb7307 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/AddDocumentDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/documents/AddDocumentDialogFactory.java
@@ -52,6 +52,7 @@ import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
@@ -93,9 +94,8 @@ import org.apache.lucene.luke.app.desktop.util.TableUtils;
 import org.apache.lucene.luke.models.LukeException;
 import org.apache.lucene.luke.models.tools.IndexTools;
 import org.apache.lucene.luke.models.tools.IndexToolsFactory;
+import org.apache.lucene.luke.util.LoggerFactory;
 import org.apache.lucene.util.BytesRef;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /** Factory of add document dialog */
 public final class AddDocumentDialogFactory implements DialogOpener.DialogFactory, AddDocumentDialogOperator {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
index c98faa1..9778acb 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
@@ -43,6 +43,7 @@ import java.nio.charset.StandardCharsets;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.index.CheckIndex;
 import org.apache.lucene.luke.app.DirectoryHandler;
 import org.apache.lucene.luke.app.DirectoryObserver;
@@ -59,9 +60,8 @@ import org.apache.lucene.luke.app.desktop.util.StyleConstants;
 import org.apache.lucene.luke.app.desktop.util.TextAreaPrintStream;
 import org.apache.lucene.luke.models.tools.IndexTools;
 import org.apache.lucene.luke.models.tools.IndexToolsFactory;
+import org.apache.lucene.luke.util.LoggerFactory;
 import org.apache.lucene.util.NamedThreadFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /** Factory of check index dialog */
 public final class CheckIndexDialogFactory implements DialogOpener.DialogFactory {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java
index 4542cb5..f12198f 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CreateIndexDialogFactory.java
@@ -45,6 +45,7 @@ import java.nio.file.Paths;
 import java.nio.file.SimpleFileVisitor;
 import java.nio.file.attribute.BasicFileAttributes;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.luke.app.IndexHandler;
 import org.apache.lucene.luke.app.desktop.Preferences;
 import org.apache.lucene.luke.app.desktop.PreferencesFactory;
@@ -54,11 +55,10 @@ import org.apache.lucene.luke.app.desktop.util.MessageUtils;
 import org.apache.lucene.luke.app.desktop.util.StyleConstants;
 import org.apache.lucene.luke.models.tools.IndexTools;
 import org.apache.lucene.luke.models.tools.IndexToolsFactory;
+import org.apache.lucene.luke.util.LoggerFactory;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
 import org.apache.lucene.util.SuppressForbidden;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /** Factory of create index dialog */
 public class CreateIndexDialogFactory implements DialogOpener.DialogFactory {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OpenIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OpenIndexDialogFactory.java
index 04769ac..782827d 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OpenIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OpenIndexDialogFactory.java
@@ -49,6 +49,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.stream.Collectors;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.luke.app.DirectoryHandler;
 import org.apache.lucene.luke.app.IndexHandler;
 import org.apache.lucene.luke.app.desktop.Preferences;
@@ -58,12 +59,11 @@ import org.apache.lucene.luke.app.desktop.util.FontUtils;
 import org.apache.lucene.luke.app.desktop.util.MessageUtils;
 import org.apache.lucene.luke.app.desktop.util.StyleConstants;
 import org.apache.lucene.luke.models.LukeException;
+import org.apache.lucene.luke.util.LoggerFactory;
 import org.apache.lucene.luke.util.reflection.ClassScanner;
 import org.apache.lucene.store.FSDirectory;
 import org.apache.lucene.util.NamedThreadFactory;
 import org.apache.lucene.util.SuppressForbidden;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /** Factory of open index dialog */
 public final class OpenIndexDialogFactory implements DialogOpener.DialogFactory {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
index 508e20c..0cbd239 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
@@ -46,6 +46,7 @@ import java.nio.charset.StandardCharsets;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.luke.app.IndexHandler;
 import org.apache.lucene.luke.app.IndexObserver;
 import org.apache.lucene.luke.app.LukeState;
@@ -59,9 +60,8 @@ import org.apache.lucene.luke.app.desktop.util.StyleConstants;
 import org.apache.lucene.luke.app.desktop.util.TextAreaPrintStream;
 import org.apache.lucene.luke.models.tools.IndexTools;
 import org.apache.lucene.luke.models.tools.IndexToolsFactory;
+import org.apache.lucene.luke.util.LoggerFactory;
 import org.apache.lucene.util.NamedThreadFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /** Factory of optimize index dialog */
 public final class OptimizeIndexDialogFactory implements DialogOpener.DialogFactory {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/ExceptionHandler.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/ExceptionHandler.java
index da43c63..b989748 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/ExceptionHandler.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/ExceptionHandler.java
@@ -19,10 +19,10 @@ package org.apache.lucene.luke.app.desktop.util;
 
 import java.lang.invoke.MethodHandles;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.luke.app.desktop.MessageBroker;
 import org.apache.lucene.luke.models.LukeException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.lucene.luke.util.LoggerFactory;
 
 /** An utility class for handling exception */
 public final class ExceptionHandler {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
index 8f6caa2..829c43c 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaAppender.java
@@ -24,19 +24,18 @@ import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
+import org.apache.logging.log4j.core.Appender;
+import org.apache.logging.log4j.core.Core;
 import org.apache.logging.log4j.core.Filter;
-import org.apache.logging.log4j.core.Layout;
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.appender.AbstractAppender;
+import org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender;
 import org.apache.logging.log4j.core.config.Property;
 import org.apache.logging.log4j.core.config.plugins.Plugin;
-import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
-import org.apache.logging.log4j.core.config.plugins.PluginElement;
-import org.apache.logging.log4j.core.config.plugins.PluginFactory;
-import org.apache.logging.log4j.core.layout.PatternLayout;
+import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
 
 /** Log appender for text areas */
-@Plugin(name = "TextAreaAppender", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "TextArea", category = Core.CATEGORY_NAME, elementType = Appender.ELEMENT_TYPE, printObject = true)
 public final class TextAreaAppender extends AbstractAppender {
 
   private static JTextArea textArea;
@@ -71,22 +70,18 @@ public final class TextAreaAppender extends AbstractAppender {
     }
   }
 
-  @PluginFactory
-  public static TextAreaAppender createAppender(
-      @PluginAttribute("name") String name,
-      @PluginElement("Layout") Layout<? extends Serializable> layout,
-      @PluginElement("Filter") final Filter filter,
-      @PluginAttribute("otherAttribute") String otherAttribute
-  ) {
-    if (name == null) {
-      LOGGER.error("No name provided for MyCustomAppenderImpl");
-      return null;
-    }
-    if (layout == null) {
-      layout = PatternLayout.createDefaultLayout();
+  public static class Builder<B extends Builder<B>> extends AbstractOutputStreamAppender.Builder<B>
+      implements org.apache.logging.log4j.core.util.Builder<TextAreaAppender> {
+
+    @Override
+    public TextAreaAppender build() {
+      return new TextAreaAppender(getName(), getFilter(), getOrCreateLayout(), true);
     }
+  }
 
-    return new TextAreaAppender(name, filter, layout, true);
+  @PluginBuilderFactory
+  public static <B extends Builder<B>> B newBuilder() {
+    return new Builder<B>().asBuilder();
   }
 
 }
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
index 3f8464c..4ce7dfd 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
@@ -25,7 +25,7 @@ import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 
-import org.slf4j.Logger;
+import org.apache.logging.log4j.Logger;
 
 /** PrintStream for text areas */
 public final class TextAreaPrintStream extends PrintStream {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/commits/CommitsImpl.java b/lucene/luke/src/java/org/apache/lucene/luke/models/commits/CommitsImpl.java
index ecc774d..d29fecc 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/commits/CommitsImpl.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/commits/CommitsImpl.java
@@ -28,15 +28,15 @@ import java.util.Optional;
 import java.util.TreeMap;
 import java.util.stream.Collectors;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.codecs.Codec;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexCommit;
 import org.apache.lucene.index.SegmentInfos;
 import org.apache.lucene.luke.models.LukeException;
 import org.apache.lucene.luke.models.LukeModel;
+import org.apache.lucene.luke.util.LoggerFactory;
 import org.apache.lucene.store.Directory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /** Default implementation of {@link Commits} */
 public final class CommitsImpl extends LukeModel implements Commits {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/documents/DocumentsImpl.java b/lucene/luke/src/java/org/apache/lucene/luke/models/documents/DocumentsImpl.java
index 0dd5e1b..e4b2529 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/documents/DocumentsImpl.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/documents/DocumentsImpl.java
@@ -26,6 +26,7 @@ import java.util.Locale;
 import java.util.Objects;
 import java.util.Optional;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.IndexReader;
@@ -38,9 +39,8 @@ import org.apache.lucene.luke.models.LukeException;
 import org.apache.lucene.luke.models.LukeModel;
 import org.apache.lucene.luke.models.util.IndexUtils;
 import org.apache.lucene.luke.util.BytesRefUtils;
+import org.apache.lucene.luke.util.LoggerFactory;
 import org.apache.lucene.util.BytesRef;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /** Default implementation of {@link Documents} */
 public final class DocumentsImpl extends LukeModel implements Documents {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/documents/TermVectorsAdapter.java b/lucene/luke/src/java/org/apache/lucene/luke/models/documents/TermVectorsAdapter.java
index bee9ec1..accdf25 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/documents/TermVectorsAdapter.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/documents/TermVectorsAdapter.java
@@ -24,11 +24,11 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.lucene.luke.util.LoggerFactory;
 
 /**
  * An utility class to access to the term vectors.
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/search/SearchImpl.java b/lucene/luke/src/java/org/apache/lucene/luke/models/search/SearchImpl.java
index d4dcaba..aa25a67 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/search/SearchImpl.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/search/SearchImpl.java
@@ -32,6 +32,7 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.index.DocValuesType;
 import org.apache.lucene.index.FieldInfo;
@@ -40,6 +41,7 @@ import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.luke.models.LukeException;
 import org.apache.lucene.luke.models.LukeModel;
 import org.apache.lucene.luke.models.util.IndexUtils;
+import org.apache.lucene.luke.util.LoggerFactory;
 import org.apache.lucene.queries.mlt.MoreLikeThis;
 import org.apache.lucene.queryparser.classic.ParseException;
 import org.apache.lucene.queryparser.classic.QueryParser;
@@ -62,8 +64,6 @@ import org.apache.lucene.search.similarities.BM25Similarity;
 import org.apache.lucene.search.similarities.ClassicSimilarity;
 import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.util.ArrayUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /** Default implementation of {@link Search} */
 public final class SearchImpl extends LukeModel implements Search {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/util/IndexUtils.java b/lucene/luke/src/java/org/apache/lucene/luke/models/util/IndexUtils.java
index 53e43bc..e59689a 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/util/IndexUtils.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/util/IndexUtils.java
@@ -37,18 +37,18 @@ import java.util.Objects;
 import java.util.stream.Collectors;
 import java.util.stream.StreamSupport;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
 import org.apache.lucene.codecs.CodecUtil;
 import org.apache.lucene.index.*;
+import org.apache.lucene.luke.util.LoggerFactory;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.store.LockFactory;
 import org.apache.lucene.util.Bits;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Utilities for various raw index operations.
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/MessageFilesParser.java b/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/MessageFilesParser.java
index 8764902..ab41d32 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/MessageFilesParser.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/MessageFilesParser.java
@@ -29,8 +29,8 @@ import java.nio.file.attribute.BasicFileAttributes;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.lucene.luke.util.LoggerFactory;
 
 /** 20 Newsgroups (http://kdd.ics.uci.edu/databases/20newsgroups/20newsgroups.html) message files parser */
 public class MessageFilesParser  extends SimpleFileVisitor<Path> {
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
new file mode 100644
index 0000000..676197d
--- /dev/null
+++ b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.lucene.luke.util;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.Appender;
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.appender.FileAppender;
+import org.apache.logging.log4j.core.config.Configurator;
+import org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilder;
+import org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilderFactory;
+import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration;
+import org.apache.logging.log4j.core.layout.PatternLayout;
+import org.apache.lucene.luke.app.desktop.util.TextAreaAppender;
+
+public class LoggerFactory {
+
+  private static LoggerContext context = LoggerContext.getContext();
+
+  public static Logger getLogger(Class<?> clazz) {
+    return context.getLogger(clazz.getName());
+  }
+
+  public synchronized static void initializeContext() {
+    ConfigurationBuilder<BuiltConfiguration> builder = ConfigurationBuilderFactory.newConfigurationBuilder();
+    builder.add(builder.newRootLogger(Level.INFO));
+    context = Configurator.initialize(builder.build());
+
+    PatternLayout layout = PatternLayout.newBuilder()
+        .withPattern("[%d{ISO8601}] %5p (%F:%L) - %m%n")
+        .build();
+
+    Appender fileAppender = FileAppender.newBuilder()
+        .setName("File")
+        .setLayout(layout)
+        .withFileName(System.getProperty("user.home") + "/.luke.d/luke.log")
+        .withAppend(false)
+          .build();
+    fileAppender.start();
+
+    Appender textAreaAppender = TextAreaAppender.newBuilder()
+        .setName("TextArea")
+        .setLayout(layout)
+        .build();
+    textAreaAppender.start();
+
+    context.getRootLogger().addAppender(fileAppender);
+    context.getRootLogger().addAppender(textAreaAppender);
+    context.updateLoggers();
+  }
+
+}
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/ClassScanner.java b/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/ClassScanner.java
index c5f0d36..2937298 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/ClassScanner.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/ClassScanner.java
@@ -30,9 +30,9 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.logging.log4j.Logger;
+import org.apache.lucene.luke.util.LoggerFactory;
 import org.apache.lucene.util.NamedThreadFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Utility class for scanning class files in jars.
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/SubtypeCollector.java b/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/SubtypeCollector.java
index 64ef333..f10d131 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/SubtypeCollector.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/SubtypeCollector.java
@@ -27,8 +27,8 @@ import java.util.Set;
 import java.util.jar.JarInputStream;
 import java.util.zip.ZipEntry;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.lucene.luke.util.LoggerFactory;
 
 final class SubtypeCollector<T> implements Runnable {
 
diff --git a/lucene/luke/src/resources/log4j2.xml b/lucene/luke/src/resources/log4j2.xml
deleted file mode 100644
index 0b4c0e0..0000000
--- a/lucene/luke/src/resources/log4j2.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-
-<Configuration packages="org.apache.lucene.luke">
-  <Properties>
-    <Property name="PATTERN">[%d{ISO8601}] %5p (%F:%L) - %m%n</Property>
-  </Properties>
-
-  <Appenders>
-    <Console name="STDOUT" target="SYSTEM_OUT">
-      <PatternLayout pattern="${PATTERN}"/>
-    </Console>
-    <File name="FILE" fileName="${sys:user.home}/.luke.d/luke.log">
-      <Append>false</Append>
-      <PatternLayout pattern="${PATTERN}"/>
-    </File>
-    <TextAreaAppender name="TEXTAREA">
-      <PatternLayout pattern="${PATTERN}"/>
-    </TextAreaAppender>
-  </Appenders>
-
-  <Loggers>
-    <Root level="info">
-      <AppenderRef ref="FILE"/>
-      <AppenderRef ref="TEXTAREA"/>
-    </Root>
-  </Loggers>
-</Configuration>
\ No newline at end of file
diff --git a/lucene/luke/src/test/log4j2-test.xml b/lucene/luke/src/test/log4j2-test.xml
deleted file mode 100644
index a260392..0000000
--- a/lucene/luke/src/test/log4j2-test.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-
-<Configuration packages="org.apache.lucene.luke">
-  <Loggers>
-    <Root level="off"/>
-  </Loggers>
-</Configuration>
\ No newline at end of file


[lucene-solr] 11/34: Remove obsolete licenses

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 7670f35a15b0e8bdcd6d4c125651249893eada5c
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 13:29:44 2019 +0200

    Remove obsolete licenses
---
 lucene/licenses/log4j-slf4j-LICENSE-ASL.txt      | 201 -----------------------
 lucene/licenses/log4j-slf4j-NOTICE.txt           |  17 --
 lucene/licenses/log4j-slf4j-impl-2.11.2.jar.sha1 |   1 -
 3 files changed, 219 deletions(-)

diff --git a/lucene/licenses/log4j-slf4j-LICENSE-ASL.txt b/lucene/licenses/log4j-slf4j-LICENSE-ASL.txt
deleted file mode 100644
index f49a4e1..0000000
--- a/lucene/licenses/log4j-slf4j-LICENSE-ASL.txt
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
\ No newline at end of file
diff --git a/lucene/licenses/log4j-slf4j-NOTICE.txt b/lucene/licenses/log4j-slf4j-NOTICE.txt
deleted file mode 100644
index ebba5ac..0000000
--- a/lucene/licenses/log4j-slf4j-NOTICE.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-Apache Log4j
-Copyright 1999-2017 Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-ResolverUtil.java
-Copyright 2005-2006 Tim Fennell
-
-Dumbster SMTP test server
-Copyright 2004 Jason Paul Kitchen
-
-TypeUtil.java
-Copyright 2002-2012 Ramnivas Laddad, Juergen Hoeller, Chris Beams
-
-picocli (http://picocli.info)
-Copyright 2017 Remko Popma
\ No newline at end of file
diff --git a/lucene/licenses/log4j-slf4j-impl-2.11.2.jar.sha1 b/lucene/licenses/log4j-slf4j-impl-2.11.2.jar.sha1
deleted file mode 100644
index 69bca4b..0000000
--- a/lucene/licenses/log4j-slf4j-impl-2.11.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-4d44e4edc4a7fb39f09b95b09f560a15976fa1ba


[lucene-solr] 22/34: Rename 'launch' target to 'run'

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit ea28ce02275407bf482b6e472a245c50f2d81fd8
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sat Apr 6 09:38:56 2019 +0900

    Rename 'launch' target to 'run'
---
 lucene/luke/build.xml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lucene/luke/build.xml b/lucene/luke/build.xml
index d72fb29..9064d26 100644
--- a/lucene/luke/build.xml
+++ b/lucene/luke/build.xml
@@ -62,7 +62,7 @@
   </target>
 
   <!-- launch Luke -->
-  <target name="launch" depends="compile-core" description="Launch Luke GUI">
+  <target name="run" depends="compile-core" description="Launch Luke GUI">
     <java classname="org.apache.lucene.luke.app.desktop.LukeMain"
           classpath="${build.dir}/classes/java"
           fork="true"
@@ -71,8 +71,6 @@
     </java>
   </target>
   
-  <target name="run" depends="launch"/><!-- alias -->
-
   <target name="compile-core"
           depends="jar-codecs,jar-backward-codecs,jar-analyzers-common,jar-misc,jar-queryparser,jar-queries,jar-misc,common.compile-core"/>
 


[lucene-solr] 05/34: Merge branch 'jira/lucene-2562-luke-swing-3' of https://github.com/mocobeta/lucene-solr-mirror into jira/lucene-2562-luke-swing-3

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 0a87a79338a4780c2e932fd5ba31979810bfd075
Merge: 890cda8 d220ee0
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 12:16:44 2019 +0200

    Merge branch 'jira/lucene-2562-luke-swing-3' of https://github.com/mocobeta/lucene-solr-mirror into jira/lucene-2562-luke-swing-3

 dev-tools/idea/lucene/luke/luke.iml                         |   1 +
 .../luke/app/desktop/components/LukeWindowProvider.java     |   2 +-
 .../components/dialog/menubar/AboutDialogFactory.java       |   2 +-
 .../components/dialog/menubar/CheckIndexDialogFactory.java  |   2 +-
 .../dialog/menubar/OptimizeIndexDialogFactory.java          |   2 +-
 .../org/apache/lucene/luke/app/desktop/util/FontUtils.java  |   4 +++-
 .../org/apache/lucene/luke/app/desktop/util/ImageUtils.java |  12 +++++-------
 .../apache/lucene/luke/app/desktop/util/MessageUtils.java   |   4 +++-
 .../apache/lucene/luke/app/desktop}/font/ElegantIcons.ttf   | Bin
 .../apache/lucene/luke/app/desktop}/img/indicator.gif       | Bin
 .../apache/lucene/luke/app/desktop}/img/lucene-logo.gif     | Bin
 .../{ => org/apache/lucene/luke/app/desktop}/img/lucene.gif | Bin
 .../apache/lucene/luke/app/desktop}/img/luke-logo.gif       | Bin
 .../lucene/luke/app/desktop/messages}/messages.properties   |   0
 14 files changed, 16 insertions(+), 13 deletions(-)


[lucene-solr] 32/34: Fix message.

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 5ad6fabae384612f9891fc9a44c16ee8e6717ab2
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sun Apr 7 15:38:20 2019 +0900

    Fix message.
---
 .../org/apache/lucene/luke/app/desktop/messages/messages.properties     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties
index 6b3d8e0..94fe406 100644
--- a/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties
+++ b/lucene/luke/src/resources/org/apache/lucene/luke/app/desktop/messages/messages.properties
@@ -82,7 +82,7 @@ createindex.label.option=(Options)
 createindex.label.data_link=http://kdd.ics.uci.edu/databases/20newsgroups/20newsgroups.html
 createindex.label.datadir=Data directory:
 createindex.textarea.data_help1=You can index sample documents from 20 Newsgroups corpus that is available at here:
-createindex.textarea.data_help2=Download and extract the tgz file, then select the extracted directory path.\nCreating an index with the full size corpus can take 10 seconds or so :)
+createindex.textarea.data_help2=Download and extract the tgz file, then select the extracted directory path.\nCreating an index with the full size corpus takes some time... :)
 # Optimize index
 optimize.dialog.title=Optimize index
 optimize.label.index_path=Index directory path:


[lucene-solr] 01/34: Use Objects#equals() instead of String comparison.

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit f35eb29b0b34f00ebec55905d877a68d75917a46
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Fri Apr 5 01:03:52 2019 +0900

    Use Objects#equals() instead of String comparison.
---
 .../java/org/apache/lucene/luke/util/reflection/SubtypeCollector.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/SubtypeCollector.java b/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/SubtypeCollector.java
index 9bacede..64ef333 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/SubtypeCollector.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/util/reflection/SubtypeCollector.java
@@ -22,6 +22,7 @@ import java.lang.invoke.MethodHandles;
 import java.net.URL;
 import java.util.Collections;
 import java.util.HashSet;
+import java.util.Objects;
 import java.util.Set;
 import java.util.jar.JarInputStream;
 import java.util.zip.ZipEntry;
@@ -74,7 +75,7 @@ final class SubtypeCollector<T> implements Runnable {
             for (ClassLoader cl : classLoaders) {
               try {
                 Class<?> clazz = Class.forName(fqcn, false, cl);
-                if (superType.isAssignableFrom(clazz) && !superType.getName().equals(clazz.getName())) {
+                if (superType.isAssignableFrom(clazz) && !Objects.equals(superType, clazz)) {
                   types.add(clazz.asSubclass(superType));
                 }
                 break;


[lucene-solr] 10/34: Optimize imports

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 3bb115e5ccfc7aa4d6588c31e49a090683588aa1
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Fri Apr 5 20:19:43 2019 +0900

    Optimize imports
---
 .../app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java  | 2 --
 .../desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java   | 2 --
 .../org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java    | 2 --
 3 files changed, 6 deletions(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
index ea8d56d..3928ba6 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/CheckIndexDialogFactory.java
@@ -35,11 +35,9 @@ import java.awt.GridLayout;
 import java.awt.Insets;
 import java.awt.Window;
 import java.awt.event.ActionEvent;
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.lang.invoke.MethodHandles;
-import java.nio.charset.StandardCharsets;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
index d95c226..e5543d8 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/OptimizeIndexDialogFactory.java
@@ -38,11 +38,9 @@ import java.awt.GridLayout;
 import java.awt.Insets;
 import java.awt.Window;
 import java.awt.event.ActionEvent;
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.lang.invoke.MethodHandles;
-import java.nio.charset.StandardCharsets;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
index 5421d87..7c1f7ca 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
@@ -23,8 +23,6 @@ import java.io.PrintStream;
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.StandardCharsets;
 
-import org.apache.logging.log4j.Logger;
-
 /** PrintStream for text areas */
 public final class TextAreaPrintStream extends PrintStream {
 


[lucene-solr] 15/34: Merge branch 'jira/lucene-2562-luke-swing-3' of https://github.com/mocobeta/lucene-solr-mirror into jira/lucene-2562-luke-swing-3

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit cdec24f0267700e7212ab173fc38a77e0b8e3581
Merge: 529ded4 c2498b6
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 15:23:11 2019 +0200

    Merge branch 'jira/lucene-2562-luke-swing-3' of https://github.com/mocobeta/lucene-solr-mirror into jira/lucene-2562-luke-swing-3

 lucene/ivy-ignore-conflicts.properties | 1 -
 1 file changed, 1 deletion(-)


[lucene-solr] 02/34: Remove unused logger configuration, set root log level to INFO

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit cce4dafb92a3a612d9a9d3411096938b1a41f09e
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Fri Apr 5 01:07:18 2019 +0900

    Remove unused logger configuration, set root log level to INFO
---
 lucene/luke/src/resources/log4j2.xml | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lucene/luke/src/resources/log4j2.xml b/lucene/luke/src/resources/log4j2.xml
index a2fbff1..0b4c0e0 100644
--- a/lucene/luke/src/resources/log4j2.xml
+++ b/lucene/luke/src/resources/log4j2.xml
@@ -36,11 +36,7 @@
   </Appenders>
 
   <Loggers>
-    <Logger name="org.reflections" level="error">
-      <AppenderRef ref="FILE"/>
-      <AppenderRef ref="TEXTAREA"/>
-    </Logger>
-    <Root level="debug">
+    <Root level="info">
       <AppenderRef ref="FILE"/>
       <AppenderRef ref="TEXTAREA"/>
     </Root>


[lucene-solr] 13/34: Fix LoggerFactory to use default LogContext only when running tests

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 78888f44b042555678de616287f7db46cf8b6433
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Apr 5 13:52:48 2019 +0200

    Fix LoggerFactory to use default LogContext only when running tests
---
 .../apache/lucene/luke/app/desktop/LukeMain.java   |  2 -
 .../org/apache/lucene/luke/util/LoggerFactory.java | 55 ++++++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
index 7926d94..4339ed0 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
@@ -71,8 +71,6 @@ public class LukeMain {
   }
 
   public static void main(String[] args) throws Exception {
-    LoggerFactory.initializeContext();
-
     String lookAndFeelClassName = UIManager.getSystemLookAndFeelClassName();
     if (!lookAndFeelClassName.contains("AquaLookAndFeel") && !lookAndFeelClassName.contains("PlasticXPLookAndFeel")) {
       // may be running on linux platform
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
index 23fcefe..ff7e7e4 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/util/LoggerFactory.java
@@ -34,38 +34,41 @@ import org.apache.lucene.luke.app.desktop.util.TextAreaAppender;
  */
 public class LoggerFactory {
 
-  private static LoggerContext context = LoggerContext.getContext();
+  private static final LoggerContext context;
+  static {
+    if (System.getProperty("tests.LUCENE_VERSION") != null) {
+      context= LoggerContext.getContext();
+    } else {
+      ConfigurationBuilder<BuiltConfiguration> builder = ConfigurationBuilderFactory.newConfigurationBuilder();
+      builder.add(builder.newRootLogger(Level.INFO));
+      context = Configurator.initialize(builder.build());
 
-  public static Logger getLogger(Class<?> clazz) {
-    return context.getLogger(clazz.getName());
-  }
-
-  public synchronized static void initializeContext() {
-    ConfigurationBuilder<BuiltConfiguration> builder = ConfigurationBuilderFactory.newConfigurationBuilder();
-    builder.add(builder.newRootLogger(Level.INFO));
-    context = Configurator.initialize(builder.build());
+      PatternLayout layout = PatternLayout.newBuilder()
+          .withPattern("[%d{ISO8601}] %5p (%F:%L) - %m%n")
+          .build();
 
-    PatternLayout layout = PatternLayout.newBuilder()
-        .withPattern("[%d{ISO8601}] %5p (%F:%L) - %m%n")
-        .build();
+      Appender fileAppender = FileAppender.newBuilder()
+          .setName("File")
+          .setLayout(layout)
+          .withFileName(System.getProperty("user.home") + "/.luke.d/luke.log")
+          .withAppend(false)
+            .build();
+      fileAppender.start();
 
-    Appender fileAppender = FileAppender.newBuilder()
-        .setName("File")
-        .setLayout(layout)
-        .withFileName(System.getProperty("user.home") + "/.luke.d/luke.log")
-        .withAppend(false)
+      Appender textAreaAppender = TextAreaAppender.newBuilder()
+          .setName("TextArea")
+          .setLayout(layout)
           .build();
-    fileAppender.start();
+      textAreaAppender.start();
 
-    Appender textAreaAppender = TextAreaAppender.newBuilder()
-        .setName("TextArea")
-        .setLayout(layout)
-        .build();
-    textAreaAppender.start();
+      context.getRootLogger().addAppender(fileAppender);
+      context.getRootLogger().addAppender(textAreaAppender);
+      context.updateLoggers();
+    }
+  }
 
-    context.getRootLogger().addAppender(fileAppender);
-    context.getRootLogger().addAppender(textAreaAppender);
-    context.updateLoggers();
+  public static Logger getLogger(Class<?> clazz) {
+    return context.getLogger(clazz.getName());
   }
 
 }


[lucene-solr] 28/34: Improve sample documents indexing: term vectors, index options, doc values

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 3bbf0f868d2a0b8ee484066d84bd55c0ce524b29
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sun Apr 7 13:28:31 2019 +0900

    Improve sample documents indexing: term vectors, index options, doc values
---
 .../luke/models/util/twentynewsgroups/Message.java | 28 ++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/Message.java b/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/Message.java
index 85aaaa6..e62d2c0 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/Message.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/util/twentynewsgroups/Message.java
@@ -27,11 +27,15 @@ import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.analysis.standard.UAX29URLEmailAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.IntPoint;
 import org.apache.lucene.document.SortedNumericDocValuesField;
+import org.apache.lucene.document.SortedSetDocValuesField;
 import org.apache.lucene.document.StoredField;
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.index.IndexOptions;
+import org.apache.lucene.util.BytesRef;
 
 /** Data holder class for a newsgroups message */
 public class Message {
@@ -119,11 +123,12 @@ public class Message {
     if (Objects.nonNull(getNewsgroups())) {
       for (String newsgroup : getNewsgroups()) {
         doc.add(new StringField("newsgroup", newsgroup, Field.Store.YES));
+        doc.add(new SortedSetDocValuesField("newsgroup_sort", new BytesRef(newsgroup)));
       }
     }
 
     if (Objects.nonNull(getSubject())) {
-      doc.add(new TextField("subject", getSubject(), Field.Store.YES));
+      doc.add(new Field("subject", getSubject(), SUBJECT_FIELD_TYPE));
     }
 
     if (Objects.nonNull(getMessageId())) {
@@ -144,7 +149,7 @@ public class Message {
     doc.add(new StoredField("lines_raw", String.valueOf(getLines())));
 
     if (Objects.nonNull(getBody())) {
-      doc.add(new TextField("body", getBody(), Field.Store.YES));
+      doc.add(new Field("body", getBody(), BODY_FIELD_TYPE));
     }
 
     return doc;
@@ -155,4 +160,23 @@ public class Message {
     map.put("from", new UAX29URLEmailAnalyzer());
     return new PerFieldAnalyzerWrapper(new StandardAnalyzer(), map);
   }
+
+  private final static FieldType SUBJECT_FIELD_TYPE;
+
+  private final static FieldType BODY_FIELD_TYPE;
+
+  static {
+    SUBJECT_FIELD_TYPE = new FieldType();
+    SUBJECT_FIELD_TYPE.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS);
+    SUBJECT_FIELD_TYPE.setTokenized(true);
+    SUBJECT_FIELD_TYPE.setStored(true);
+
+    BODY_FIELD_TYPE = new FieldType();
+    BODY_FIELD_TYPE.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
+    BODY_FIELD_TYPE.setTokenized(true);
+    BODY_FIELD_TYPE.setStored(true);
+    BODY_FIELD_TYPE.setStoreTermVectors(true);
+    BODY_FIELD_TYPE.setStoreTermVectorPositions(true);
+    BODY_FIELD_TYPE.setStoreTermVectorOffsets(true);
+  }
 }


[lucene-solr] 24/34: Show implementation version in the About dialog.

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 9e37f858dc93676bdfde0ed66f0700707debf773
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sat Apr 6 17:23:29 2019 +0900

    Show implementation version in the About dialog.
---
 .../app/desktop/components/dialog/menubar/AboutDialogFactory.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
index 2395dee..d6e418a 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
@@ -41,6 +41,7 @@ import java.awt.Window;
 import java.io.IOException;
 import java.net.URISyntaxException;
 
+import org.apache.lucene.LucenePackage;
 import org.apache.lucene.luke.app.desktop.Preferences;
 import org.apache.lucene.luke.app.desktop.PreferencesFactory;
 import org.apache.lucene.luke.app.desktop.util.DialogOpener;
@@ -135,14 +136,13 @@ public final class AboutDialogFactory implements DialogOpener.DialogFactory {
   private JScrollPane center() {
     JEditorPane editorPane = new JEditorPane();
     editorPane.setOpaque(false);
-    editorPane.setMargin(new Insets(5, 5, 5, 5));
+    editorPane.setMargin(new Insets(0, 5, 2, 5));
     editorPane.setContentType("text/html");
     editorPane.setText(LICENSE_NOTICE);
     editorPane.setEditable(false);
     editorPane.addHyperlinkListener(hyperlinkListener);
     JScrollPane scrollPane = new JScrollPane(editorPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
     scrollPane.setBorder(BorderFactory.createLineBorder(Color.gray));
-    //scrollPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
     return scrollPane;
   }
 
@@ -159,7 +159,9 @@ public final class AboutDialogFactory implements DialogOpener.DialogFactory {
   }
 
   private static final String LICENSE_NOTICE =
-      "<p>[License]</p>" +
+      "<p>[Implementation Version]</p>" +
+          "<p>" + LucenePackage.get().getImplementationVersion() + "</p>" +
+          "<p>[License]</p>" +
           "<p>Luke is distributed under <a href=\"http://www.apache.org/licenses/LICENSE-2.0\">Apache License Version 2.0</a> (http://www.apache.org/licenses/LICENSE-2.0) " +
           "and includes <a href=\"https://www.elegantthemes.com/blog/resources/elegant-icon-font\">The Elegant Icon Font</a> (https://www.elegantthemes.com/blog/resources/elegant-icon-font) " +
           "licensed under <a href=\"https://opensource.org/licenses/MIT\">MIT</a> (https://opensource.org/licenses/MIT)</p>" +


[lucene-solr] 09/34: Resolve conflicts

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 9e162657363afdd9c0b49cbf5da9d40bb57867e8
Merge: aa2aa47 85be0a4
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Fri Apr 5 20:16:57 2019 +0900

    Resolve conflicts

 lucene/licenses/log4j-1.2-api-2.11.2.jar.sha1      |  1 -
 lucene/luke/ivy.xml                                |  2 +-
 .../dialog/menubar/CheckIndexDialogFactory.java    |  4 +--
 .../dialog/menubar/OptimizeIndexDialogFactory.java |  2 +-
 .../luke/app/desktop/util/TextAreaPrintStream.java | 31 ++++++----------------
 5 files changed, 12 insertions(+), 28 deletions(-)

diff --cc lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
index 4ce7dfd,790c1be..5421d87
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java
@@@ -19,13 -19,11 +19,11 @@@ package org.apache.lucene.luke.app.desk
  
  import javax.swing.JTextArea;
  import java.io.ByteArrayOutputStream;
- import java.io.IOException;
  import java.io.PrintStream;
  import java.io.UnsupportedEncodingException;
- import java.nio.charset.Charset;
  import java.nio.charset.StandardCharsets;
  
 -import org.slf4j.Logger;
 +import org.apache.logging.log4j.Logger;
  
  /** PrintStream for text areas */
  public final class TextAreaPrintStream extends PrintStream {


[lucene-solr] 29/34: Fix term vectors dialog size.

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 1a32f8552c455fa2a5b8df32ebccac339afaec8b
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sun Apr 7 13:34:57 2019 +0900

    Fix term vectors dialog size.
---
 .../lucene/luke/app/desktop/components/DocumentsPanelProvider.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/DocumentsPanelProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/DocumentsPanelProvider.java
index 144941b..e9daece 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/DocumentsPanelProvider.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/DocumentsPanelProvider.java
@@ -618,7 +618,7 @@ public final class DocumentsPanelProvider implements DocumentsTabOperator {
     }
 
     new DialogOpener<>(tvDialogFactory).open(
-        "Term Vector", 400, 300,
+        "Term Vector", 600, 400,
         (factory) -> {
           factory.setField(field);
           factory.setTvEntries(tvEntries);


[lucene-solr] 26/34: Fix broken image path.

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 22769662683c3e8581f3bcf3e06cc2b0a2bf1a68
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sat Apr 6 19:44:05 2019 +0900

    Fix broken image path.
---
 .../luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
index c90bf9f..4f57c64 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
@@ -120,7 +120,7 @@ public final class AboutDialogFactory implements DialogOpener.DialogFactory {
     JLabel subTitleLbl = new JLabel("GUI client of the best Java search library Apache Lucene");
     subTitleLbl.setFont(new Font(subTitleLbl.getFont().getFontName(), Font.PLAIN, 20));
     subTitle.add(subTitleLbl);
-    subTitle.add(new JLabel(ImageUtils.createImageIcon("/img/lucene-logo.gif", 100, 15)));
+    subTitle.add(new JLabel(ImageUtils.createImageIcon("lucene-logo.gif", 100, 15)));
     desc.add(subTitle);
 
     JPanel link = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 5));