diff --git a/assertj-swing/pom.xml b/assertj-swing/pom.xml index f4a4c7bf..56b7cf4a 100644 --- a/assertj-swing/pom.xml +++ b/assertj-swing/pom.xml @@ -68,7 +68,7 @@ org.assertj assertj-core - 2.2.0 + 2.8.0 diff --git a/assertj-swing/src/main/java/org/assertj/swing/applet/BasicAppletContext.java b/assertj-swing/src/main/java/org/assertj/swing/applet/BasicAppletContext.java index d1db91d8..13b30051 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/applet/BasicAppletContext.java +++ b/assertj-swing/src/main/java/org/assertj/swing/applet/BasicAppletContext.java @@ -14,7 +14,6 @@ import static java.util.Collections.enumeration; import static org.assertj.core.util.Lists.newArrayList; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import java.applet.Applet; @@ -24,6 +23,7 @@ import java.io.InputStream; import java.net.URL; import java.util.Enumeration; +import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -54,7 +54,7 @@ public boolean hasMoreElements() { } } - private final Map streamMap = newHashMap(); + private final Map streamMap = new HashMap<>(); private final StatusDisplay statusDisplay; /** diff --git a/assertj-swing/src/main/java/org/assertj/swing/applet/BasicAppletStub.java b/assertj-swing/src/main/java/org/assertj/swing/applet/BasicAppletStub.java index 8597387a..b625cef6 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/applet/BasicAppletStub.java +++ b/assertj-swing/src/main/java/org/assertj/swing/applet/BasicAppletStub.java @@ -12,13 +12,13 @@ */ package org.assertj.swing.applet; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import java.applet.AppletContext; import java.applet.AppletStub; import java.awt.Window; import java.net.URL; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; @@ -33,7 +33,7 @@ public class BasicAppletStub implements AppletStub { private final Window viewer; private final AppletContext context; - private final Map parameters = newHashMap(); + private final Map parameters = new HashMap<>(); /** * Creates a new {@link BasicAppletStub}. diff --git a/assertj-swing/src/main/java/org/assertj/swing/driver/JOptionPaneMessageTypes.java b/assertj-swing/src/main/java/org/assertj/swing/driver/JOptionPaneMessageTypes.java index 91b0c917..4a740f44 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/driver/JOptionPaneMessageTypes.java +++ b/assertj-swing/src/main/java/org/assertj/swing/driver/JOptionPaneMessageTypes.java @@ -17,11 +17,11 @@ import static javax.swing.JOptionPane.PLAIN_MESSAGE; import static javax.swing.JOptionPane.QUESTION_MESSAGE; import static javax.swing.JOptionPane.WARNING_MESSAGE; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Preconditions.checkNotNullOrEmpty; import static org.assertj.core.util.Strings.concat; import static org.assertj.swing.exception.ActionFailedException.actionFailure; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; @@ -32,7 +32,7 @@ * @author Alex Ruiz */ final class JOptionPaneMessageTypes { - private static final Map messageMap = newHashMap(); + private static final Map messageMap = new HashMap<>(); static { messageMap.put(ERROR_MESSAGE, "Error Message"); messageMap.put(INFORMATION_MESSAGE, "Information Message"); diff --git a/assertj-swing/src/main/java/org/assertj/swing/driver/JScrollBarLocation.java b/assertj-swing/src/main/java/org/assertj/swing/driver/JScrollBarLocation.java index 96d6ebd8..b5669df4 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/driver/JScrollBarLocation.java +++ b/assertj-swing/src/main/java/org/assertj/swing/driver/JScrollBarLocation.java @@ -14,10 +14,10 @@ import static java.awt.Adjustable.HORIZONTAL; import static java.awt.Adjustable.VERTICAL; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import java.awt.Point; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; @@ -36,7 +36,7 @@ public final class JScrollBarLocation { private static final int BLOCK_OFFSET = 4; - private static final Map LOCATIONS = newHashMap(); + private static final Map LOCATIONS = new HashMap<>(); static { LOCATIONS.put(HORIZONTAL, new HorizontalJScrollBarLocation()); diff --git a/assertj-swing/src/main/java/org/assertj/swing/driver/JSliderLocation.java b/assertj-swing/src/main/java/org/assertj/swing/driver/JSliderLocation.java index ac0e91e6..d66b9d9d 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/driver/JSliderLocation.java +++ b/assertj-swing/src/main/java/org/assertj/swing/driver/JSliderLocation.java @@ -14,11 +14,11 @@ import static javax.swing.SwingConstants.HORIZONTAL; import static javax.swing.SwingConstants.VERTICAL; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import java.awt.Insets; import java.awt.Point; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; @@ -33,7 +33,7 @@ * @author Yvonne Wang */ public final class JSliderLocation { - private static final Map LOCATIONS = newHashMap(); + private static final Map LOCATIONS = new HashMap<>(); static { LOCATIONS.put(HORIZONTAL, new JSliderHorizontalLocation()); diff --git a/assertj-swing/src/main/java/org/assertj/swing/driver/JSplitPaneLocationCalculator.java b/assertj-swing/src/main/java/org/assertj/swing/driver/JSplitPaneLocationCalculator.java index 6282a612..ed7cb689 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/driver/JSplitPaneLocationCalculator.java +++ b/assertj-swing/src/main/java/org/assertj/swing/driver/JSplitPaneLocationCalculator.java @@ -16,12 +16,12 @@ import static java.lang.Math.min; import static javax.swing.JSplitPane.HORIZONTAL_SPLIT; import static javax.swing.JSplitPane.VERTICAL_SPLIT; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import static org.assertj.swing.edt.GuiActionRunner.execute; import java.awt.Component; import java.awt.Insets; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; @@ -39,7 +39,7 @@ * @author Alex Ruiz */ final class JSplitPaneLocationCalculator { - private static Map FINDERS = newHashMap(); + private static Map FINDERS = new HashMap<>(); static { add(new VerticalOrientationLocationFinder(), new HorizontalOrientationLocationFinder()); diff --git a/assertj-swing/src/main/java/org/assertj/swing/edt/GuiActionRunner.java b/assertj-swing/src/main/java/org/assertj/swing/edt/GuiActionRunner.java index f952df9a..15a9195a 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/edt/GuiActionRunner.java +++ b/assertj-swing/src/main/java/org/assertj/swing/edt/GuiActionRunner.java @@ -14,7 +14,7 @@ import static javax.swing.SwingUtilities.invokeLater; import static javax.swing.SwingUtilities.isEventDispatchThread; -import static org.assertj.core.util.Throwables.appendStackTraceInCurentThreadToThrowable; +import static org.assertj.core.util.Throwables.appendStackTraceInCurrentThreadToThrowable; import static org.assertj.swing.exception.UnexpectedException.unexpected; import java.util.concurrent.CountDownLatch; @@ -146,7 +146,7 @@ private static void rethrowCaughtExceptionIn(@Nonnull GuiAction action) { return; } if (caughtException instanceof RuntimeException) { - appendStackTraceInCurentThreadToThrowable(caughtException, "execute"); + appendStackTraceInCurrentThreadToThrowable(caughtException, "execute"); throw (RuntimeException) caughtException; } if (caughtException instanceof Error) { diff --git a/assertj-swing/src/main/java/org/assertj/swing/format/Formatting.java b/assertj-swing/src/main/java/org/assertj/swing/format/Formatting.java index c1da7bfb..d7b52a0f 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/format/Formatting.java +++ b/assertj-swing/src/main/java/org/assertj/swing/format/Formatting.java @@ -12,7 +12,6 @@ */ package org.assertj.swing.format; -import static org.assertj.core.util.Maps.newConcurrentHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import static org.assertj.core.util.Strings.isNullOrEmpty; import static org.assertj.swing.edt.GuiActionRunner.execute; @@ -20,6 +19,7 @@ import java.awt.Component; import java.awt.Dialog; import java.awt.Frame; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.logging.Logger; @@ -66,7 +66,7 @@ public class Formatting { private static final String VALUE = "value"; private static final String VISIBLE = "visible"; - private static final ConcurrentMap, ComponentFormatter> FORMATTERS = newConcurrentHashMap(); + private static final ConcurrentMap, ComponentFormatter> FORMATTERS = new ConcurrentHashMap<>(); private static Logger logger = Logger.getLogger(Formatting.class.getCanonicalName()); diff --git a/assertj-swing/src/main/java/org/assertj/swing/format/IntEnum.java b/assertj-swing/src/main/java/org/assertj/swing/format/IntEnum.java index fe8d8311..55ef9280 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/format/IntEnum.java +++ b/assertj-swing/src/main/java/org/assertj/swing/format/IntEnum.java @@ -13,8 +13,8 @@ package org.assertj.swing.format; import static java.lang.String.valueOf; -import static org.assertj.core.util.Maps.newHashMap; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; @@ -26,7 +26,7 @@ * @author Alex Ruiz */ final class IntEnum { - private final Map map = newHashMap(); + private final Map map = new HashMap<>(); @Nullable String get(int key) { diff --git a/assertj-swing/src/main/java/org/assertj/swing/format/IntrospectionComponentFormatter.java b/assertj-swing/src/main/java/org/assertj/swing/format/IntrospectionComponentFormatter.java index bc36aef6..74224cc3 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/format/IntrospectionComponentFormatter.java +++ b/assertj-swing/src/main/java/org/assertj/swing/format/IntrospectionComponentFormatter.java @@ -13,7 +13,6 @@ package org.assertj.swing.format; import static org.assertj.core.util.Lists.newArrayList; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import static org.assertj.core.util.Strings.concat; import static org.assertj.core.util.Strings.quote; @@ -23,6 +22,7 @@ import java.beans.BeanInfo; import java.beans.Introspector; import java.beans.PropertyDescriptor; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -44,7 +44,7 @@ public final class IntrospectionComponentFormatter extends ComponentFormatterTem private final Class targetType; private final List propertyNames; - private final Map descriptors = newHashMap(); + private final Map descriptors = new HashMap<>(); /** * Creates a new {@link IntrospectionComponentFormatter}. diff --git a/assertj-swing/src/main/java/org/assertj/swing/hierarchy/WindowFilter.java b/assertj-swing/src/main/java/org/assertj/swing/hierarchy/WindowFilter.java index d9a5ac83..ba34d7c2 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/hierarchy/WindowFilter.java +++ b/assertj-swing/src/main/java/org/assertj/swing/hierarchy/WindowFilter.java @@ -12,13 +12,13 @@ */ package org.assertj.swing.hierarchy; -import static org.assertj.core.util.Maps.newWeakHashMap; import static org.assertj.swing.awt.AWT.isSharedInvisibleFrame; import java.awt.Component; import java.awt.Window; import java.util.Collection; import java.util.Map; +import java.util.WeakHashMap; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -44,10 +44,10 @@ class WindowFilter { } // Map of components to ignore - final Map ignored = newWeakHashMap(); + final Map ignored = new WeakHashMap<>(); // Map of components implicitly ignored; these will be removed if they are re-shown. - final Map implicitlyIgnored = newWeakHashMap(); + final Map implicitlyIgnored = new WeakHashMap<>(); boolean isImplicitlyIgnored(@Nonnull Component c) { return implicitlyIgnored.containsKey(c); diff --git a/assertj-swing/src/main/java/org/assertj/swing/input/DisposedWindowMonitor.java b/assertj-swing/src/main/java/org/assertj/swing/input/DisposedWindowMonitor.java index cda2d2a8..53a3f450 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/input/DisposedWindowMonitor.java +++ b/assertj-swing/src/main/java/org/assertj/swing/input/DisposedWindowMonitor.java @@ -14,12 +14,12 @@ import static java.awt.event.WindowEvent.WINDOW_CLOSED; import static java.awt.event.WindowEvent.WINDOW_CLOSING; -import static org.assertj.core.util.Maps.newWeakHashMap; import java.awt.AWTEvent; import java.awt.Window; import java.awt.event.WindowEvent; import java.util.Map; +import java.util.WeakHashMap; /** * Verifies that a notification of the disposal of an AWT or Swing {@code Window} is not duplicated. @@ -27,7 +27,7 @@ * @author Alex Ruiz */ class DisposedWindowMonitor { - final Map disposedWindows = newWeakHashMap(); + final Map disposedWindows = new WeakHashMap<>(); // We want to ignore consecutive event indicating window disposal; it needs to be an intervening SHOWN/OPEN before // we're interested again. diff --git a/assertj-swing/src/main/java/org/assertj/swing/keystroke/KeyStrokeMapCollection.java b/assertj-swing/src/main/java/org/assertj/swing/keystroke/KeyStrokeMapCollection.java index 8f20f2b5..9e6bbbe0 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/keystroke/KeyStrokeMapCollection.java +++ b/assertj-swing/src/main/java/org/assertj/swing/keystroke/KeyStrokeMapCollection.java @@ -12,8 +12,7 @@ */ package org.assertj.swing.keystroke; -import static org.assertj.core.util.Maps.newHashMap; - +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; @@ -26,8 +25,8 @@ * @author Alex Ruiz */ class KeyStrokeMapCollection { - private final Map charToKeyStroke = newHashMap(); - private final Map keyStrokeToChar = newHashMap(); + private final Map charToKeyStroke = new HashMap<>(); + private final Map keyStrokeToChar = new HashMap<>(); void add(@Nonnull Character character, @Nonnull KeyStroke keyStroke) { charToKeyStroke.put(character, keyStroke); diff --git a/assertj-swing/src/main/java/org/assertj/swing/keystroke/KeyStrokeMappingsParser.java b/assertj-swing/src/main/java/org/assertj/swing/keystroke/KeyStrokeMappingsParser.java index 949cac5b..30b3850c 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/keystroke/KeyStrokeMappingsParser.java +++ b/assertj-swing/src/main/java/org/assertj/swing/keystroke/KeyStrokeMappingsParser.java @@ -16,7 +16,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.util.Closeables.closeQuietly; import static org.assertj.core.util.Lists.newArrayList; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import static org.assertj.core.util.Preconditions.checkNotNullOrEmpty; import static org.assertj.core.util.Strings.concat; @@ -34,6 +33,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -96,7 +96,7 @@ * @author Alex Ruiz */ public class KeyStrokeMappingsParser { - private static final Map SPECIAL_MAPPINGS = newHashMap(); + private static final Map SPECIAL_MAPPINGS = new HashMap<>(); static { SPECIAL_MAPPINGS.put("COMMA", ','); diff --git a/assertj-swing/src/main/java/org/assertj/swing/launcher/AppletLauncher.java b/assertj-swing/src/main/java/org/assertj/swing/launcher/AppletLauncher.java index 7c878299..64e7b519 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/launcher/AppletLauncher.java +++ b/assertj-swing/src/main/java/org/assertj/swing/launcher/AppletLauncher.java @@ -12,13 +12,13 @@ */ package org.assertj.swing.launcher; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import static org.assertj.core.util.Preconditions.checkNotNullOrEmpty; import static org.assertj.swing.edt.GuiActionRunner.execute; import static org.assertj.swing.launcher.NewAppletViewerQuery.showAppletViewerWith; import java.applet.Applet; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; @@ -81,7 +81,7 @@ */ public class AppletLauncher { private final Applet applet; - private final Map parameters = newHashMap(); + private final Map parameters = new HashMap<>(); /** * Creates a new {@link AppletLauncher}. The {@code Applet} to launch is a new instance of the given type. It is diff --git a/assertj-swing/src/main/java/org/assertj/swing/monitor/EventQueueMapping.java b/assertj-swing/src/main/java/org/assertj/swing/monitor/EventQueueMapping.java index 11c0bd45..230d175a 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/monitor/EventQueueMapping.java +++ b/assertj-swing/src/main/java/org/assertj/swing/monitor/EventQueueMapping.java @@ -12,7 +12,6 @@ */ package org.assertj.swing.monitor; -import static org.assertj.core.util.Maps.newWeakHashMap; import static org.assertj.core.util.Sets.newHashSet; import java.awt.Component; @@ -21,6 +20,7 @@ import java.util.Collection; import java.util.Map; import java.util.Set; +import java.util.WeakHashMap; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -34,7 +34,7 @@ * @author Alex Ruiz */ class EventQueueMapping { - final Map> queueMap = newWeakHashMap(); + final Map> queueMap = new WeakHashMap<>(); @RunsInCurrentThread void addQueueFor(@Nonnull Component c) { diff --git a/assertj-swing/src/main/java/org/assertj/swing/monitor/WindowEventQueueMapping.java b/assertj-swing/src/main/java/org/assertj/swing/monitor/WindowEventQueueMapping.java index ad045820..a018d4bd 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/monitor/WindowEventQueueMapping.java +++ b/assertj-swing/src/main/java/org/assertj/swing/monitor/WindowEventQueueMapping.java @@ -13,7 +13,6 @@ package org.assertj.swing.monitor; import static java.lang.Boolean.TRUE; -import static org.assertj.core.util.Maps.newWeakHashMap; import static org.assertj.core.util.Sets.newHashSet; import static org.assertj.swing.query.ComponentParentQuery.parentOf; @@ -24,6 +23,7 @@ import java.util.Collection; import java.util.Map; import java.util.Set; +import java.util.WeakHashMap; import javax.annotation.Nonnull; @@ -36,10 +36,10 @@ * @author Yvonne Wang */ class WindowEventQueueMapping { - final Map> queueMap = newWeakHashMap(); + final Map> queueMap = new WeakHashMap<>(); void addQueueFor(@Nonnull Toolkit toolkit) { - Map map = newWeakHashMap(); + Map map = new WeakHashMap<>(); queueMap.put(toolkit.getSystemEventQueue(), map); } @@ -56,7 +56,7 @@ void addQueueFor(@Nonnull Component component) { } private @Nonnull Map createWindowMapping(EventQueue queue) { - Map windowMapping = newWeakHashMap(); + Map windowMapping = new WeakHashMap<>(); queueMap.put(queue, windowMapping); return windowMapping; } diff --git a/assertj-swing/src/main/java/org/assertj/swing/monitor/Windows.java b/assertj-swing/src/main/java/org/assertj/swing/monitor/Windows.java index 556d670a..e15106c7 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/monitor/Windows.java +++ b/assertj-swing/src/main/java/org/assertj/swing/monitor/Windows.java @@ -12,13 +12,12 @@ */ package org.assertj.swing.monitor; -import static org.assertj.core.util.Maps.newWeakHashMap; - import java.awt.Component; import java.awt.Window; import java.util.Map; import java.util.Timer; import java.util.TimerTask; +import java.util.WeakHashMap; import javax.annotation.Nonnull; import javax.annotation.concurrent.GuardedBy; @@ -39,19 +38,19 @@ class Windows { /** {@link Window#isShowing() isShowing} is true but are not yet ready for input. */ @GuardedBy("lock") - final Map pending = newWeakHashMap(); + final Map pending = new WeakHashMap<>(); /** Considered to be ready to use. */ @GuardedBy("lock") - final Map open = newWeakHashMap(); + final Map open = new WeakHashMap<>(); /** Have sent a {@link java.awt.event.WindowEvent#WINDOW_CLOSED WINDOW_CLOSED} event. */ @GuardedBy("lock") - final Map closed = newWeakHashMap(); + final Map closed = new WeakHashMap<>(); /** Not visible. */ @GuardedBy("lock") - final Map hidden = newWeakHashMap(); + final Map hidden = new WeakHashMap<>(); private final Timer windowReadyTimer; diff --git a/assertj-swing/src/main/java/org/assertj/swing/text/TextReaders.java b/assertj-swing/src/main/java/org/assertj/swing/text/TextReaders.java index 24b88f92..bf487b7b 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/text/TextReaders.java +++ b/assertj-swing/src/main/java/org/assertj/swing/text/TextReaders.java @@ -12,13 +12,13 @@ */ package org.assertj.swing.text; -import static org.assertj.core.util.Maps.newConcurrentHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import static org.assertj.core.util.Strings.concat; import static org.assertj.swing.edt.GuiActionRunner.execute; import java.awt.Component; import java.awt.Container; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.logging.Logger; @@ -38,7 +38,7 @@ public class TextReaders { private static Logger logger = Logger.getLogger(TextReaders.class.getCanonicalName()); @VisibleForTesting - final ConcurrentMap, TextReader> readers = newConcurrentHashMap(); + final ConcurrentMap, TextReader> readers = new ConcurrentHashMap<>(); @VisibleForTesting TextReaders() { diff --git a/assertj-swing/src/main/java/org/assertj/swing/util/Arrays.java b/assertj-swing/src/main/java/org/assertj/swing/util/Arrays.java index 04823a5a..5788c3a9 100644 --- a/assertj-swing/src/main/java/org/assertj/swing/util/Arrays.java +++ b/assertj-swing/src/main/java/org/assertj/swing/util/Arrays.java @@ -71,7 +71,7 @@ public static boolean equal(@Nullable String[][] one, @Nullable String[][] two) @InternalApi public static String format(Object object) { - return org.assertj.core.util.Arrays.format(new StandardRepresentation(), object); + return new StandardRepresentation().toStringOf( object ); } /** diff --git a/assertj-swing/src/test/java/org/assertj/swing/applet/BasicAppletStub_getParameter_Test.java b/assertj-swing/src/test/java/org/assertj/swing/applet/BasicAppletStub_getParameter_Test.java index b0c004ae..70f3cb14 100644 --- a/assertj-swing/src/test/java/org/assertj/swing/applet/BasicAppletStub_getParameter_Test.java +++ b/assertj-swing/src/test/java/org/assertj/swing/applet/BasicAppletStub_getParameter_Test.java @@ -13,8 +13,8 @@ package org.assertj.swing.applet; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.util.Maps.newHashMap; +import java.util.HashMap; import java.util.Map; import org.junit.Test; @@ -28,7 +28,7 @@ public class BasicAppletStub_getParameter_Test extends BasicAppletStub_TestCase { @Test public void should_Return_Parameter() { - Map parameters = newHashMap(); + Map parameters = new HashMap<>(); parameters.put("key1", "value1"); stub = new BasicAppletStub(viewer, context, parameters); assertThat(stub.getParameter("key1")).isEqualTo("value1"); diff --git a/assertj-swing/src/test/java/org/assertj/swing/driver/JAppletDriver_TestCase.java b/assertj-swing/src/test/java/org/assertj/swing/driver/JAppletDriver_TestCase.java index 745676ac..3e750de9 100644 --- a/assertj-swing/src/test/java/org/assertj/swing/driver/JAppletDriver_TestCase.java +++ b/assertj-swing/src/test/java/org/assertj/swing/driver/JAppletDriver_TestCase.java @@ -13,7 +13,6 @@ package org.assertj.swing.driver; import static javax.swing.SwingUtilities.isEventDispatchThread; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Strings.concat; import static org.assertj.core.util.Strings.quote; import static org.assertj.swing.core.TestRobots.singletonRobotMock; @@ -21,6 +20,7 @@ import java.applet.AppletContext; import java.net.URL; +import java.util.HashMap; import java.util.Map; import javax.swing.JApplet; @@ -55,8 +55,8 @@ final JAppletDriver driver() { } static class JAppletStub extends JApplet { - private final Map methodCallsInEDT = newHashMap(); - private final Map parameters = newHashMap(); + private final Map methodCallsInEDT = new HashMap<>(); + private final Map parameters = new HashMap<>(); private AppletContext context; private URL codeBase; diff --git a/assertj-swing/src/test/java/org/assertj/swing/input/DisposalMonitor_componentShown_Test.java b/assertj-swing/src/test/java/org/assertj/swing/input/DisposalMonitor_componentShown_Test.java index 88ef1be6..0532f45b 100644 --- a/assertj-swing/src/test/java/org/assertj/swing/input/DisposalMonitor_componentShown_Test.java +++ b/assertj-swing/src/test/java/org/assertj/swing/input/DisposalMonitor_componentShown_Test.java @@ -13,10 +13,10 @@ package org.assertj.swing.input; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.util.Maps.newHashMap; import java.awt.Window; import java.awt.event.ComponentEvent; +import java.util.HashMap; import java.util.Map; import javax.swing.JFrame; @@ -38,7 +38,7 @@ public class DisposalMonitor_componentShown_Test { @Before public void setUp() { frame = TestWindow.createNewWindow(DisposalMonitor_componentShown_Test.class); - disposedWindows = newHashMap(); + disposedWindows = new HashMap<>(); monitor = new DisposalMonitor(disposedWindows); frame.addComponentListener(monitor); } diff --git a/assertj-swing/src/test/java/org/assertj/swing/keystroke/KeyStrokeMappingProvider_TestCase.java b/assertj-swing/src/test/java/org/assertj/swing/keystroke/KeyStrokeMappingProvider_TestCase.java index c8f6ee7a..75650d0d 100644 --- a/assertj-swing/src/test/java/org/assertj/swing/keystroke/KeyStrokeMappingProvider_TestCase.java +++ b/assertj-swing/src/test/java/org/assertj/swing/keystroke/KeyStrokeMappingProvider_TestCase.java @@ -19,13 +19,13 @@ import static java.lang.String.valueOf; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.util.Lists.newArrayList; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Strings.concat; import static org.assertj.core.util.Strings.quote; import static org.assertj.swing.timing.Pause.pause; import java.awt.Dimension; import java.util.Collection; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -49,7 +49,7 @@ * @author Alex Ruiz */ public abstract class KeyStrokeMappingProvider_TestCase extends RobotBasedTestCase { - private static final Map BASIC_CHARS_AND_KEYS_MAP = newHashMap(); + private static final Map BASIC_CHARS_AND_KEYS_MAP = new HashMap<>(); static { BASIC_CHARS_AND_KEYS_MAP.put((char) 8, VK_BACK_SPACE); diff --git a/assertj-swing/src/test/java/org/assertj/swing/launcher/AppletLauncher_withParametersAsMap_Test.java b/assertj-swing/src/test/java/org/assertj/swing/launcher/AppletLauncher_withParametersAsMap_Test.java index 7da23b40..06b20570 100644 --- a/assertj-swing/src/test/java/org/assertj/swing/launcher/AppletLauncher_withParametersAsMap_Test.java +++ b/assertj-swing/src/test/java/org/assertj/swing/launcher/AppletLauncher_withParametersAsMap_Test.java @@ -13,8 +13,8 @@ package org.assertj.swing.launcher; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.util.Maps.newHashMap; +import java.util.HashMap; import java.util.Map; import org.assertj.swing.test.swing.TestApplet; @@ -34,7 +34,7 @@ public void should_Throw_Error_If_Parameter_Map_Is_Null() { @Test public void should_Set_Parameters_In_Given_Map() { - Map parameters = newHashMap(); + Map parameters = new HashMap<>(); parameters.put("bgcolor", "blue"); parameters.put("color", "red"); applet = TestApplet.createNew(); diff --git a/assertj-swing/src/test/java/org/assertj/swing/monitor/WindowEventQueueMapping_removeMappingFor_Test.java b/assertj-swing/src/test/java/org/assertj/swing/monitor/WindowEventQueueMapping_removeMappingFor_Test.java index 6c5bb218..fe590965 100644 --- a/assertj-swing/src/test/java/org/assertj/swing/monitor/WindowEventQueueMapping_removeMappingFor_Test.java +++ b/assertj-swing/src/test/java/org/assertj/swing/monitor/WindowEventQueueMapping_removeMappingFor_Test.java @@ -13,10 +13,10 @@ package org.assertj.swing.monitor; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.util.Maps.newHashMap; import java.awt.EventQueue; import java.awt.Window; +import java.util.HashMap; import java.util.Map; import org.junit.Test; @@ -40,7 +40,7 @@ public void should_Remove_Component_From_Mapping() { @Test public void should_Remove_Component_From_All_Mappings() { EventQueue anotherEventQueue = new EventQueue(); - Map windowMapping = newHashMap(); + Map windowMapping = new HashMap<>(); windowMapping.put(window, true); queueMap.put(anotherEventQueue, windowMapping); mapping.removeMappingFor(window); diff --git a/assertj-swing/src/test/java/org/assertj/swing/test/awt/ToolkitStub.java b/assertj-swing/src/test/java/org/assertj/swing/test/awt/ToolkitStub.java index 48c10a81..f6f90e41 100644 --- a/assertj-swing/src/test/java/org/assertj/swing/test/awt/ToolkitStub.java +++ b/assertj-swing/src/test/java/org/assertj/swing/test/awt/ToolkitStub.java @@ -12,7 +12,6 @@ */ package org.assertj.swing.test.awt; -import static org.assertj.core.util.Maps.newHashMap; import static org.mockito.Mockito.spy; import java.awt.Button; @@ -81,6 +80,7 @@ import java.awt.peer.WindowPeer; import java.net.URL; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; @@ -99,7 +99,7 @@ static ToolkitStub createNew() { static ToolkitStub createNew(EventQueue eventQueue) { ToolkitStub stub = spy(new ToolkitStub()); stub.eventQueue(eventQueue); - stub.eventListeners = newHashMap(); + stub.eventListeners = new HashMap<>(); return stub; } diff --git a/assertj-swing/src/test/java/org/assertj/swing/test/core/MethodInvocations.java b/assertj-swing/src/test/java/org/assertj/swing/test/core/MethodInvocations.java index 9d196a59..aa9f4d2a 100644 --- a/assertj-swing/src/test/java/org/assertj/swing/test/core/MethodInvocations.java +++ b/assertj-swing/src/test/java/org/assertj/swing/test/core/MethodInvocations.java @@ -14,13 +14,13 @@ import static java.util.Arrays.deepEquals; import static org.assertj.core.api.Fail.fail; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import static org.assertj.core.util.Strings.concat; import static org.assertj.core.util.Strings.quote; import static org.assertj.swing.util.Arrays.copyOf; import static org.assertj.swing.util.Arrays.format; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; @@ -33,7 +33,7 @@ * @author Yvonne Wang */ public class MethodInvocations { - private final Map invocations = newHashMap(); + private final Map invocations = new HashMap<>(); /** * Records that a method with the given name was invoked. diff --git a/assertj-swing/src/test/java/org/assertj/swing/test/recorder/AbstractClickRecorder.java b/assertj-swing/src/test/java/org/assertj/swing/test/recorder/AbstractClickRecorder.java index b5c52034..eeddd333 100644 --- a/assertj-swing/src/test/java/org/assertj/swing/test/recorder/AbstractClickRecorder.java +++ b/assertj-swing/src/test/java/org/assertj/swing/test/recorder/AbstractClickRecorder.java @@ -13,13 +13,13 @@ package org.assertj.swing.test.recorder; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.swing.core.MouseButton.LEFT_BUTTON; import static org.assertj.swing.core.MouseButton.MIDDLE_BUTTON; import static org.assertj.swing.core.MouseButton.RIGHT_BUTTON; import java.awt.Point; import java.awt.event.MouseEvent; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; @@ -34,7 +34,7 @@ */ public class AbstractClickRecorder { - private static final Map MOUSE_BUTTON_MAP = newHashMap(); + private static final Map MOUSE_BUTTON_MAP = new HashMap<>(); static { MOUSE_BUTTON_MAP.put(MouseEvent.BUTTON1, LEFT_BUTTON); diff --git a/assertj-swing/src/test/java/org/assertj/swing/test/recorder/ToolkitClickRecorder.java b/assertj-swing/src/test/java/org/assertj/swing/test/recorder/ToolkitClickRecorder.java index 4405a874..7919f8e2 100644 --- a/assertj-swing/src/test/java/org/assertj/swing/test/recorder/ToolkitClickRecorder.java +++ b/assertj-swing/src/test/java/org/assertj/swing/test/recorder/ToolkitClickRecorder.java @@ -13,7 +13,6 @@ package org.assertj.swing.test.recorder; import static org.assertj.core.util.Lists.newArrayList; -import static org.assertj.core.util.Maps.newHashMap; import static org.assertj.core.util.Preconditions.checkNotNull; import java.awt.AWTEvent; @@ -22,6 +21,7 @@ import java.awt.Toolkit; import java.awt.event.AWTEventListener; import java.awt.event.MouseEvent; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -35,7 +35,7 @@ */ public class ToolkitClickRecorder extends AbstractClickRecorder { - private static Map recorderListeners = newHashMap(); + private static Map recorderListeners = new HashMap<>(); ToolkitClickRecorder() { // hide the constructor from the outside