From 283134b5bc67925b0a61feaeb35eca737c26170b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Maxime=20M=C3=A9riouma-Caron?= Date: Mon, 1 Feb 2016 20:46:38 -0500 Subject: [PATCH] Cleanup --- .../java/com/google/gwt/query/client/GQuery.java | 10 +++++----- .../google/gwt/query/client/impl/SelectorEngine.java | 4 ++-- .../query/client/impl/SelectorEngineCssToXPath.java | 4 ++-- .../query/client/impl/research/SelectorEngineJS.java | 2 +- .../java/com/google/gwt/query/client/js/JsCache.java | 2 +- .../google/gwt/query/client/js/JsObjectArray.java | 2 +- .../google/gwt/query/client/plugins/QueuePlugin.java | 2 +- .../com/google/gwt/query/client/plugins/Widgets.java | 2 +- .../gwt/query/client/plugins/deferred/Callbacks.java | 4 ++-- .../gwt/query/client/plugins/effects/Transform.java | 4 ++-- .../query/client/plugins/effects/Transitions.java | 2 +- .../query/client/plugins/events/EventsListener.java | 6 +++--- .../gwt/query/rebind/JsonBuilderGenerator.java | 4 ++-- .../query/rebind/SelectorGeneratorCssToXPath.java | 2 +- .../gwt/query/rebind/SelectorGeneratorXPath.java | 2 +- .../com/google/gwt/query/vm/AjaxTransportJre.java | 4 +--- .../java/com/google/gwt/query/vm/CookieManager.java | 12 ++++++------ .../com/google/gwt/query/vm/JsonBuilderHandler.java | 8 ++++---- .../requestfactory/shared/gquery/PromiseRF.java | 4 ++-- .../google/gwt/query/client/GQueryCoreTestGwt.java | 4 ++-- .../com/google/gwt/query/client/GQueryJsTestGwt.java | 2 +- .../google/gwt/query/client/ajax/AjaxTestJre.java | 2 +- .../query/client/dbinding/DataBindingTestJre.java | 4 ++-- pom.xml | 6 +++--- 24 files changed, 48 insertions(+), 50 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java index 477bfb9e..06f72b0e 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java @@ -629,7 +629,7 @@ public class GQuery implements Lazy { */ @SuppressWarnings("unchecked") public static T[] grep(T[] objects, Predicate f) { - ArrayList ret = new ArrayList(); + ArrayList ret = new ArrayList<>(); for (int i = 0, l = objects.length; i < l; i++) { if (f.f(objects[i], i)) { ret.add(objects[i]); @@ -2888,7 +2888,7 @@ public class GQuery implements Lazy { * the array. */ public List map(Function f) { - ArrayList ret = new ArrayList(); + ArrayList ret = new ArrayList<>(); int i = 0; for (Element e : elements) { @SuppressWarnings("unchecked") @@ -3957,7 +3957,7 @@ public class GQuery implements Lazy { // more than one element) boolean mustBeCloned = length() == 1 && parents().filter("body").length() == 0; - List newElements = new ArrayList(); + List newElements = new ArrayList<>(); for (int i = 0, l = target.size(); i < l; i++) { GQuery that = (i > 0 && mustBeCloned) ? this.clone() : this; $(target.get(i)).replaceWith(that); @@ -4835,7 +4835,7 @@ public class GQuery implements Lazy { * return the list of attached widgets matching the query. */ public List widgets() { - List widgets = new ArrayList(); + List widgets = new ArrayList<>(); for (Element e : elements) { Widget w = getAssociatedWidget(e); if (w != null) { @@ -4854,7 +4854,7 @@ public class GQuery implements Lazy { */ @SuppressWarnings("unchecked") public List widgets(Class clazz) { - List ret = new ArrayList(); + List ret = new ArrayList<>(); for (Widget w : widgets()) { // isAssignableFrom does not work in gwt. Class c = w.getClass(); diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngine.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngine.java index c9bdef5a..2557646a 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngine.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngine.java @@ -177,8 +177,8 @@ public class SelectorEngine implements HasSelector { return res; } Element ghostParent = null; - HashSet parents = new HashSet(); - HashSet elmList = new HashSet(); + HashSet parents = new HashSet<>(); + HashSet elmList = new HashSet<>(); for (int i = 0, l = nodes.getLength(); i < l; i++) { Node e = nodes.getItem(i); if (e == window || e == document || e.getNodeName() == null diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineCssToXPath.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineCssToXPath.java index 7a634c83..ab85dc27 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineCssToXPath.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineCssToXPath.java @@ -195,7 +195,7 @@ public class SelectorEngineCssToXPath extends SelectorEngineImpl { ReplaceCallback callback = (ReplaceCallback) o; while (p.test(s)) { MatchResult a = p.exec(s); - ArrayList args = new ArrayList(); + ArrayList args = new ArrayList<>(); for (int i = 0; a != null && i < a.getGroupCount(); i++) { args.add(a.getGroup(i)); } @@ -220,7 +220,7 @@ public class SelectorEngineCssToXPath extends SelectorEngineImpl { ReplaceCallback callback = (ReplaceCallback) o; com.google.gwt.regexp.shared.MatchResult a = null; while ((a = p.exec(s)) != null) { - ArrayList args = new ArrayList(); + ArrayList args = new ArrayList<>(); for (int i = 0; i < a.getGroupCount(); i++) { args.add(a.getGroup(i)); } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/research/SelectorEngineJS.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/research/SelectorEngineJS.java index deaa396b..f517a431 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/research/SelectorEngineJS.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/research/SelectorEngineJS.java @@ -497,7 +497,7 @@ public class SelectorEngineJS extends SelectorEngineImpl { for (int q = 0, qlen = previousMatch.size(); q < qlen; q++) { previous = previousMatch.getNode(q); if (!isAdded(previous)) { - if (((Element) previous).getInnerText().indexOf(pseudoValue) != -1) { + if (((Element) previous).getInnerText().contains(pseudoValue)) { setAdded(previous, true); matchingElms.addNode(previous); } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsCache.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsCache.java index 2f201626..7315977e 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsCache.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsCache.java @@ -168,7 +168,7 @@ public class JsCache extends JavaScriptObject { public final JsCache put(Object id, Object obj) { if (obj instanceof Boolean) { - putBoolean(id, ((Boolean) obj).booleanValue()); + putBoolean(id, (Boolean) obj); } else if (obj instanceof Number) { putNumber(id, ((Number) obj).doubleValue()); } else { diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsObjectArray.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsObjectArray.java index 3a1b5ee8..bbbe5d08 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsObjectArray.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsObjectArray.java @@ -40,7 +40,7 @@ public final class JsObjectArray extends JavaScriptObject { if (t instanceof Number) { c().putNumber(length(), (((Number) t).doubleValue())); } else if (t instanceof Boolean) { - c().putBoolean(length(), ((Boolean) t).booleanValue()); + c().putBoolean(length(), (Boolean) t); } else { c().put(length(), t); } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java index 8951ccad..992c6c2e 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java @@ -388,7 +388,7 @@ public class QueuePlugin> extends GQuery { if (f != null) { if (f instanceof Function) { // pass jumpToEnd to Animation.onCancel() via the element's data object - $(elem).data(JUMP_TO_END, Boolean.valueOf(jumpToEnd)); + $(elem).data(JUMP_TO_END, jumpToEnd); ((Function) f).cancel(elem); $(elem).removeData(JUMP_TO_END); } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Widgets.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Widgets.java index 0c26c0bc..bcb0e0a7 100755 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Widgets.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Widgets.java @@ -69,7 +69,7 @@ public class Widgets extends QueuePlugin { */ public Widgets widgets(WidgetFactory factory, WidgetInitializer initializers) { - List result = new ArrayList(); + List result = new ArrayList<>(); for (Element e : elements()) { W w = widget(e, factory, initializers); if (w != null) { diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Callbacks.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Callbacks.java index 508c82e5..e6329e23 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Callbacks.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Callbacks.java @@ -35,7 +35,7 @@ public class Callbacks { boolean f(Object... objects); } - private List stack = new ArrayList(); + private List stack = new ArrayList<>(); private boolean done = false; @@ -113,7 +113,7 @@ public class Callbacks { if (!done) { done = isOnce; if (isMemory) { - memory = new ArrayList(Arrays.asList(o)); + memory = new ArrayList<>(Arrays.asList(o)); } if (stack != null) for (Object c : stack) { diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java index da0bb509..02d49b18 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java @@ -69,7 +69,7 @@ public class Transform { private static final RegExp anglePropRegex = RegExp.compile("(rotate[XYZ]?|skew[XY]?)"); private static final RegExp translatePropRegex = RegExp.compile("translate[XYZ]"); - private HashMap> map = new HashMap>(); + private HashMap> map = new HashMap<>(); // Some browsers like HTMLUnit only support 2d transformations private static boolean supportsTransform3d() { @@ -234,4 +234,4 @@ public class Transform { private List unit(String val, String unit) { return Arrays.asList(val + (val.endsWith(unit) ? "" : unit)); } -} \ No newline at end of file +} diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java index 1bf8ad7d..a1f8d8bf 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java @@ -128,7 +128,7 @@ public class Transitions extends Effects { } public static List filterTransitionPropertyNames(Properties p) { - List ret = new ArrayList(); + List ret = new ArrayList<>(); for (String s : p.keys()) { if (invalidTransitionNamesRegex.test(s)) { continue; diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java index 48285d8e..257d4ab5 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java @@ -83,7 +83,7 @@ public class EventsListener implements EventListener { } public static List split(String events) { - List ret = new ArrayList(); + List ret = new ArrayList<>(); String[] parts = events.split("[\\s,]+"); for (String event : parts) { String[] tmp = event.split("\\.", 2); @@ -229,7 +229,7 @@ public class EventsListener implements EventListener { } // Compute the live selectors which respond to this event type - List validSelectors = new ArrayList(); + List validSelectors = new ArrayList<>(); for (String cssSelector : bindFunctionBySelector.keys()) { JsObjectArray bindFunctions = bindFunctionBySelector.get(cssSelector); for (int i = 0; bindFunctions != null && i < bindFunctions.length(); i++) { @@ -361,7 +361,7 @@ public class EventsListener implements EventListener { static { // Register some special events which already exist in jQuery - special = new HashMap(); + special = new HashMap<>(); special.put(MOUSEENTER, new MouseSpecialEvent(MOUSEENTER, "mouseover")); special.put(MOUSELEAVE, new MouseSpecialEvent(MOUSELEAVE, "mouseout")); } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java index e30b7588..3b36f293 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java @@ -101,7 +101,7 @@ public class JsonBuilderGenerator extends Generator { if (isFactory) { generateCreateMethod(sw, treeLogger); } else { - Set attrs = new HashSet(); + Set attrs = new HashSet<>(); for (JMethod method : clazz.getInheritableMethods()) { String methName = method.getName(); // skip method from JsonBuilder @@ -304,7 +304,7 @@ public class JsonBuilderGenerator extends Generator { private void generateCreateMethod(SourceWriter sw, TreeLogger logger) { sw.println("public T create(Class clz) {"); sw.indent(); - ArrayList types = new ArrayList(); + ArrayList types = new ArrayList<>(); for (JClassType t : oracle.getTypes()) { if (t.isInterface() != null && t.isAssignableTo(jsonBuilderType)) { if (t.isPublic()) { diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorCssToXPath.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorCssToXPath.java index 1590b2c0..a17bfaf9 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorCssToXPath.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorCssToXPath.java @@ -51,7 +51,7 @@ public class SelectorGeneratorCssToXPath extends SelectorGeneratorBase { ReplaceCallback callback = (ReplaceCallback) o; while (matcher.find()) { final MatchResult matchResult = matcher.toMatchResult(); - ArrayList argss = new ArrayList(); + ArrayList argss = new ArrayList<>(); for (int i = 0; i < matchResult.groupCount() + 1; i++) { argss.add(matchResult.group(i)); } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorXPath.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorXPath.java index ad11c989..fc88d804 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorXPath.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorXPath.java @@ -93,7 +93,7 @@ public class SelectorGeneratorXPath extends SelectorGeneratorBase { } } - ArrayList cssSelectors = new ArrayList(); + ArrayList cssSelectors = new ArrayList<>(); Matcher selm = selectorSplitRegExp.matcher(currentRule); while (selm.find()) { cssSelectors.add(selm.group(0)); diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/vm/AjaxTransportJre.java b/gwtquery-core/src/main/java/com/google/gwt/query/vm/AjaxTransportJre.java index fa756933..3f4b40fe 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/vm/AjaxTransportJre.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/vm/AjaxTransportJre.java @@ -15,8 +15,6 @@ */ package com.google.gwt.query.vm; -// import org.apache.http.impl.client.HttpClientBuilder; - import com.google.gwt.http.client.RequestException; import com.google.gwt.http.client.Response; import com.google.gwt.query.client.Function; @@ -202,7 +200,7 @@ public class AjaxTransportJre implements AjaxTransport { if (is != null) { BufferedReader in = new BufferedReader(new InputStreamReader(is)); String inputLine; - StringBuffer response = new StringBuffer(); + StringBuilder response = new StringBuilder(); while ((inputLine = in.readLine()) != null) { response.append(inputLine + "\n"); } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/vm/CookieManager.java b/gwtquery-core/src/main/java/com/google/gwt/query/vm/CookieManager.java index 0075b708..12d8d38f 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/vm/CookieManager.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/vm/CookieManager.java @@ -32,7 +32,7 @@ import java.util.StringTokenizer; public class CookieManager { private Map>> store = - new HashMap>>(); + new HashMap<>(); private static final String SET_COOKIE = "Set-Cookie"; private static final String COOKIE_VALUE_DELIMITER = ";"; @@ -78,12 +78,12 @@ public class CookieManager { String domain = getDomainFromHost(host); Map> domainStore = store.get(domain); if (domainStore == null) { - domainStore = new HashMap>(); + domainStore = new HashMap<>(); store.put(domain, domainStore); } Map cookie = domainStore.get(name); if (cookie == null) { - cookie = new HashMap(); + cookie = new HashMap<>(); domainStore.put(name, cookie); } if (value == null) { @@ -115,7 +115,7 @@ public class CookieManager { domainStore = store.get(domain); } else { // we don't, so let's create it and put it in the store - domainStore = new HashMap>(); + domainStore = new HashMap<>(); store.put(domain, domainStore); } @@ -124,7 +124,7 @@ public class CookieManager { String headerName = null; for (int i = 1; (headerName = conn.getHeaderFieldKey(i)) != null; i++) { if (headerName.equalsIgnoreCase(SET_COOKIE)) { - Map cookie = new HashMap(); + Map cookie = new HashMap<>(); StringTokenizer st = new StringTokenizer(conn.getHeaderField(i), COOKIE_VALUE_DELIMITER); // the specification dictates that the first name/value pair @@ -173,7 +173,7 @@ public class CookieManager { Map> domainStore = store.get(domain); if (domainStore == null) return; - StringBuffer cookieStringBuffer = new StringBuffer(); + StringBuilder cookieStringBuffer = new StringBuilder(); Iterator cookieNames = domainStore.keySet().iterator(); while (cookieNames.hasNext()) { diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/vm/JsonBuilderHandler.java b/gwtquery-core/src/main/java/com/google/gwt/query/vm/JsonBuilderHandler.java index 0cece814..6b598331 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/vm/JsonBuilderHandler.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/vm/JsonBuilderHandler.java @@ -71,7 +71,7 @@ public class JsonBuilderHandler implements InvocationHandler { return null; } - List l = new ArrayList(); + List l = new ArrayList<>(); for (int i = 0; j != null && i < j.length(); i++) { l.add((T) getValue(j, i, null, null, ctype, null)); } @@ -83,7 +83,7 @@ public class JsonBuilderHandler implements InvocationHandler { try { return obj != null ? obj.getNumber(attr) : arr.getNumber(idx); } catch (Exception e) { - return Double.valueOf(0d); + return 0d; } } @@ -312,7 +312,7 @@ public class JsonBuilderHandler implements InvocationHandler { } private HashSet getAttributeNames(Method[] methods) { - HashSet valid = new HashSet(); + HashSet valid = new HashSet<>(); if (methods == null || methods.length == 0) { return valid; @@ -331,7 +331,7 @@ public class JsonBuilderHandler implements InvocationHandler { } private Hashtable getJsonBuilders(Method[] methods) { - Hashtable ispropertyGetters = new Hashtable(); + Hashtable ispropertyGetters = new Hashtable<>(); if (methods == null || methods.length == 0) { return ispropertyGetters; diff --git a/gwtquery-core/src/main/java/com/google/web/bindery/requestfactory/shared/gquery/PromiseRF.java b/gwtquery-core/src/main/java/com/google/web/bindery/requestfactory/shared/gquery/PromiseRF.java index 9166190a..67f016eb 100644 --- a/gwtquery-core/src/main/java/com/google/web/bindery/requestfactory/shared/gquery/PromiseRF.java +++ b/gwtquery-core/src/main/java/com/google/web/bindery/requestfactory/shared/gquery/PromiseRF.java @@ -51,8 +51,8 @@ import javax.validation.ConstraintViolation; */ public class PromiseRF extends DeferredPromiseImpl { private int total = 0; - private List responses = new ArrayList(); - private List contexts = new ArrayList(); + private List responses = new ArrayList<>(); + private List contexts = new ArrayList<>(); /** * Fire a RF Request. diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java index 3c76a811..c637aac9 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java @@ -1792,7 +1792,7 @@ public class GQueryCoreTestGwt extends GWTTestCase { if ($(e).attr("id").isEmpty() || $(e).attr("class").isEmpty()) { return null; } - List attrs = new ArrayList(); + List attrs = new ArrayList<>(); attrs.add(e.getTagName()); attrs.add($(e).attr("class")); attrs.add($(e).attr("id")); @@ -2077,7 +2077,7 @@ public class GQueryCoreTestGwt extends GWTTestCase { GQuery target = $("#target", e); - $("#target", e).data("intValue", new Integer(1)); + $("#target", e).data("intValue", 1); Integer value = $("#target", e).data("intValue", Integer.class); diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsTestGwt.java index a15af268..feae41d6 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsTestGwt.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsTestGwt.java @@ -129,7 +129,7 @@ public class GQueryJsTestGwt extends GWTTestCase { assertEquals(0, a.keys().length); assertEquals(0, a.elements().length); - a.put("obj", new Long(21)); + a.put("obj", 21L); assertEquals(1, a.length()); assertEquals(1, a.keys().length); assertEquals(1, a.elements().length); diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/ajax/AjaxTestJre.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/ajax/AjaxTestJre.java index 8618f10d..81a48c36 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/ajax/AjaxTestJre.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/ajax/AjaxTestJre.java @@ -61,7 +61,7 @@ public class AjaxTestJre extends AjaxTests { protected void startWebServer(int port) throws Exception { if (server == null) { - final Map> servlets = new HashMap>(); + final Map> servlets = new HashMap<>(); servlets.put("/" + servletPath, GQAjaxTestServlet.class); server = createWebServer(port, ".", null, servlets, null); } diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/dbinding/DataBindingTestJre.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/dbinding/DataBindingTestJre.java index a8770cc2..14a2bc96 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/dbinding/DataBindingTestJre.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/dbinding/DataBindingTestJre.java @@ -49,7 +49,7 @@ public class DataBindingTestJre extends GWTTestCase { p1.set("e", true); assertEquals("1", p1.get("a")); - assertEquals(Double.valueOf(1), p1.get("b")); + assertEquals(1d, p1.get("b")); assertEquals("null", p1.get("c")); assertNull(p1.get("d")); assertTrue((Boolean)p1.get("e")); @@ -57,7 +57,7 @@ public class DataBindingTestJre extends GWTTestCase { p1 = GQ.create(p1.toJson()); assertEquals("1", p1.get("a")); - assertEquals(Double.valueOf(1), p1.get("b")); + assertEquals(1d, p1.get("b")); assertEquals("null", p1.get("c")); assertNull(p1.get("d")); } diff --git a/pom.xml b/pom.xml index 5b4cb5b2..0db05e14 100644 --- a/pom.xml +++ b/pom.xml @@ -97,10 +97,10 @@ org.apache.maven.plugins maven-compiler-plugin - 3.2 + 3.5 - 1.6 - 1.6 + 1.7 + 1.7 -- 2.39.5