aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Mériouma-Caron <maxime.meriouma@arcbees.com>2016-02-01 20:46:38 -0500
committerMaxime Mériouma-Caron <maxime.meriouma@arcbees.com>2016-02-01 20:46:38 -0500
commit283134b5bc67925b0a61feaeb35eca737c26170b (patch)
tree55fa13baeff7ee80968174d654cc31c4ed18d78a
parenta077516121504ab88c207838966e478d3be59fc6 (diff)
downloadgwtquery-283134b5bc67925b0a61feaeb35eca737c26170b.tar.gz
gwtquery-283134b5bc67925b0a61feaeb35eca737c26170b.zip
Cleanup
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java10
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngine.java4
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineCssToXPath.java4
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/impl/research/SelectorEngineJS.java2
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsCache.java2
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsObjectArray.java2
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java2
-rwxr-xr-xgwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Widgets.java2
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Callbacks.java4
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java4
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java2
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java6
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java4
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorCssToXPath.java2
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorXPath.java2
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/vm/AjaxTransportJre.java4
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/vm/CookieManager.java12
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/vm/JsonBuilderHandler.java8
-rw-r--r--gwtquery-core/src/main/java/com/google/web/bindery/requestfactory/shared/gquery/PromiseRF.java4
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java4
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryJsTestGwt.java2
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/ajax/AjaxTestJre.java2
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/dbinding/DataBindingTestJre.java4
-rw-r--r--pom.xml6
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<GQuery, LazyGQuery> {
*/
@SuppressWarnings("unchecked")
public static <T> T[] grep(T[] objects, Predicate f) {
- ArrayList<Object> ret = new ArrayList<Object>();
+ ArrayList<Object> 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<GQuery, LazyGQuery> {
* the array.
*/
public <W> List<W> map(Function f) {
- ArrayList<W> ret = new ArrayList<W>();
+ ArrayList<W> ret = new ArrayList<>();
int i = 0;
for (Element e : elements) {
@SuppressWarnings("unchecked")
@@ -3957,7 +3957,7 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
// more than one element)
boolean mustBeCloned = length() == 1 && parents().filter("body").length() == 0;
- List<Element> newElements = new ArrayList<Element>();
+ List<Element> 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<GQuery, LazyGQuery> {
* return the list of attached widgets matching the query.
*/
public List<Widget> widgets() {
- List<Widget> widgets = new ArrayList<Widget>();
+ List<Widget> widgets = new ArrayList<>();
for (Element e : elements) {
Widget w = getAssociatedWidget(e);
if (w != null) {
@@ -4854,7 +4854,7 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
*/
@SuppressWarnings("unchecked")
public <W extends Widget> List<W> widgets(Class<W> clazz) {
- List<W> ret = new ArrayList<W>();
+ List<W> 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<Node> parents = new HashSet<Node>();
- HashSet<Node> elmList = new HashSet<Node>();
+ HashSet<Node> parents = new HashSet<>();
+ HashSet<Node> 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<String> args = new ArrayList<String>();
+ ArrayList<String> 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<String> args = new ArrayList<String>();
+ ArrayList<String> 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<T> 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<T extends 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<Widgets> {
*/
public <W extends Widget> Widgets widgets(WidgetFactory<W> factory,
WidgetInitializer<W> initializers) {
- List<Element> result = new ArrayList<Element>();
+ List<Element> 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<Object> stack = new ArrayList<Object>();
+ private List<Object> stack = new ArrayList<>();
private boolean done = false;
@@ -113,7 +113,7 @@ public class Callbacks {
if (!done) {
done = isOnce;
if (isMemory) {
- memory = new ArrayList<Object>(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<String, List<String>> map = new HashMap<String, List<String>>();
+ private HashMap<String, List<String>> map = new HashMap<>();
// Some browsers like HTMLUnit only support 2d transformations
private static boolean supportsTransform3d() {
@@ -234,4 +234,4 @@ public class Transform {
private List<String> 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<String> filterTransitionPropertyNames(Properties p) {
- List<String> ret = new ArrayList<String>();
+ List<String> 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<EventName> split(String events) {
- List<EventName> ret = new ArrayList<EventName>();
+ List<EventName> 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<String> validSelectors = new ArrayList<String>();
+ List<String> validSelectors = new ArrayList<>();
for (String cssSelector : bindFunctionBySelector.keys()) {
JsObjectArray<BindFunction> 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<String, SpecialEvent>();
+ 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<String> attrs = new HashSet<String>();
+ Set<String> 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 extends " + JsonBuilder.class.getName() + "> T create(Class<T> clz) {");
sw.indent();
- ArrayList<JClassType> types = new ArrayList<JClassType>();
+ ArrayList<JClassType> 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<String> argss = new ArrayList<String>();
+ ArrayList<String> 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<String> cssSelectors = new ArrayList<String>();
+ ArrayList<String> 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<String, Map<String, Map<String, String>>> store =
- new HashMap<String, Map<String, Map<String, String>>>();
+ 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<String, Map<String, String>> domainStore = store.get(domain);
if (domainStore == null) {
- domainStore = new HashMap<String, Map<String, String>>();
+ domainStore = new HashMap<>();
store.put(domain, domainStore);
}
Map<String, String> cookie = domainStore.get(name);
if (cookie == null) {
- cookie = new HashMap<String, String>();
+ 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<String, Map<String, String>>();
+ 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<String, String> cookie = new HashMap<String, String>();
+ Map<String, String> 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<String, Map<String, String>> domainStore = store.get(domain);
if (domainStore == null)
return;
- StringBuffer cookieStringBuffer = new StringBuffer();
+ StringBuilder cookieStringBuffer = new StringBuilder();
Iterator<String> 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<T> l = new ArrayList<T>();
+ List<T> 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<String> getAttributeNames(Method[] methods) {
- HashSet<String> valid = new HashSet<String>();
+ HashSet<String> valid = new HashSet<>();
if (methods == null || methods.length == 0) {
return valid;
@@ -331,7 +331,7 @@ public class JsonBuilderHandler implements InvocationHandler {
}
private Hashtable<String, Method> getJsonBuilders(Method[] methods) {
- Hashtable<String, Method> ispropertyGetters = new Hashtable<String, Method>();
+ Hashtable<String, Method> 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<Object> responses = new ArrayList<Object>();
- private List<RequestContext> contexts = new ArrayList<RequestContext>();
+ private List<Object> responses = new ArrayList<>();
+ private List<RequestContext> 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<String> attrs = new ArrayList<String>();
+ List<String> 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<String, Class<? extends Servlet>> servlets = new HashMap<String, Class<? extends Servlet>>();
+ final Map<String, Class<? extends Servlet>> 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 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.2</version>
+ <version>3.5</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.7</source>
+ <target>1.7</target>
</configuration>
</plugin>
</plugins>