From 9d5c717648add384d5badc09e185ac664841814e Mon Sep 17 00:00:00 2001 From: dbaspider Date: Tue, 25 Oct 2022 20:35:27 +0800 Subject: [PATCH 1/3] fix package bug --- .gitignore | 4 +++- pom.xml | 28 +++++++++++++++++++--------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 8557bb1..c4d2c4b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /bin /out /target/ -.* \ No newline at end of file +*.iml +*.log +/.idea/ \ No newline at end of file diff --git a/pom.xml b/pom.xml index c7153ee..bdf06a3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,18 +5,20 @@ 2.0.0 ClassFinder ClassFinder finds Java classes within jar, ear, war and zip files. + + + UTF-8 + 1.8 + 1.8 + + - src + maven-compiler-plugin - 3.1 - - 1.8 - 1.8 - - + maven-assembly-plugin @@ -34,10 +36,18 @@ - src jar-with-dependencies + + + make-assembly + package + + single + + + From 83fbb5f12be88c6cc08cfa0ad8deaaa2f12487b6 Mon Sep 17 00:00:00 2001 From: dbaspider Date: Tue, 25 Oct 2022 20:43:17 +0800 Subject: [PATCH 2/3] code lint --- src/main/java/com/optit/ClassFinder.java | 1 + .../java/com/optit/gui/ClassFinderGui.java | 5 +++- .../wb/swing/FocusTraversalOnArray.java | 25 +++++++++++-------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/optit/ClassFinder.java b/src/main/java/com/optit/ClassFinder.java index 67f78b6..57c0ce1 100644 --- a/src/main/java/com/optit/ClassFinder.java +++ b/src/main/java/com/optit/ClassFinder.java @@ -59,6 +59,7 @@ public static void main(String[] args) { // No exception got thrown, continue EventQueue.invokeLater( new Runnable() { + @Override public void run() { try { new ClassFinderGui(); diff --git a/src/main/java/com/optit/gui/ClassFinderGui.java b/src/main/java/com/optit/gui/ClassFinderGui.java index f2156c2..866d3ff 100644 --- a/src/main/java/com/optit/gui/ClassFinderGui.java +++ b/src/main/java/com/optit/gui/ClassFinderGui.java @@ -1,5 +1,6 @@ package com.optit.gui; +import java.awt.Component; import java.awt.HeadlessException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -24,8 +25,8 @@ import com.optit.Parameters; import com.optit.SearchableFileFilter; import com.optit.logger.GuiLogger; + import org.eclipse.wb.swing.FocusTraversalOnArray; -import java.awt.Component; /** * @@ -91,6 +92,7 @@ private void initialize() JButton btnBrowse = new JButton("Browse"); btnBrowse.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (fc.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) { tfJarFileFolder.setText(fc.getSelectedFile().getAbsolutePath()); @@ -102,6 +104,7 @@ public void actionPerformed(ActionEvent e) { // Make search button default for ENTER key frame.getRootPane().setDefaultButton(btnSearch); btnSearch.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { performSearch(); } diff --git a/src/main/java/org/eclipse/wb/swing/FocusTraversalOnArray.java b/src/main/java/org/eclipse/wb/swing/FocusTraversalOnArray.java index cbdb709..04c62b8 100644 --- a/src/main/java/org/eclipse/wb/swing/FocusTraversalOnArray.java +++ b/src/main/java/org/eclipse/wb/swing/FocusTraversalOnArray.java @@ -1,13 +1,13 @@ -/******************************************************************************* - * Copyright (c) 2011 Google, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Google, Inc. - initial API and implementation - *******************************************************************************/ +/******************************************************************************* + * Copyright (c) 2011 Google, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Google, Inc. - initial API and implementation + *******************************************************************************/ package org.eclipse.wb.swing; import java.awt.Component; @@ -74,18 +74,23 @@ private Component cycle(Component currentComponent, int delta) { // FocusTraversalPolicy // //////////////////////////////////////////////////////////////////////////// + @Override public Component getComponentAfter(Container container, Component component) { return cycle(component, 1); } + @Override public Component getComponentBefore(Container container, Component component) { return cycle(component, -1); } + @Override public Component getFirstComponent(Container container) { return m_Components[0]; } + @Override public Component getLastComponent(Container container) { return m_Components[m_Components.length - 1]; } + @Override public Component getDefaultComponent(Container container) { return getFirstComponent(container); } From 26b7daa9978aa536017a61bd32fbd5f593c862a2 Mon Sep 17 00:00:00 2001 From: dbaspider Date: Wed, 26 Oct 2022 10:54:00 +0800 Subject: [PATCH 3/3] jar size lint --- pom.xml | 5 ++++- src/main/java/com/optit/gui/ClassFinderGui.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index bdf06a3..5ce6a18 100644 --- a/pom.xml +++ b/pom.xml @@ -8,8 +8,10 @@ UTF-8 - 1.8 + UTF-8 + 1.8 1.8 + true @@ -56,6 +58,7 @@ junit junit 4.11 + test \ No newline at end of file diff --git a/src/main/java/com/optit/gui/ClassFinderGui.java b/src/main/java/com/optit/gui/ClassFinderGui.java index 866d3ff..4631083 100644 --- a/src/main/java/com/optit/gui/ClassFinderGui.java +++ b/src/main/java/com/optit/gui/ClassFinderGui.java @@ -71,7 +71,7 @@ public ClassFinderGui() { private void initialize() throws HeadlessException { frame = new JFrame(); - frame.setBounds(100, 100, 640, 480); + frame.setBounds(100, 100, 1200, 600); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setTitle("ClassFinder");