Skip to content

Commit

Permalink
Fix deprecation warnings after update to Java 11
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Sep 6, 2021
1 parent 72d2582 commit 3d5c43d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/test/java/org/glassfish/el/test/ELProcessorTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020 Oracle and/or its affiliates and others.
* Copyright (c) 2018, 2021 Oracle and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -21,6 +21,7 @@
import org.junit.Before;
import org.junit.BeforeClass;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import jakarta.el.ELProcessor;
Expand Down Expand Up @@ -62,7 +63,7 @@ public void testMethExpr() {
ctxt, "#{'abc'.length()}", Object.class, null);
Object result = meth.invoke(ctxt, new Object[] {"abcde"});
System.out.println("'abc'.length() called, equals " + result);
assertEquals(result, new Integer(3));
assertEquals(result, Integer.valueOf(3));
}

@Test
Expand All @@ -79,7 +80,7 @@ public void testSetVariable () {
Object result = elp.getValue("xx + 11", String.class);
assertEquals(result, "111");
elp.setVariable("xx", null);
assertEquals(elp.eval("xx"), null);
assertNull(elp.eval("xx"));
elp.setVariable("yy", "abc");
assertEquals(elp.eval("yy = 123; abc"), Long.valueOf(123));
assertEquals(elp.eval("abc = 456; yy"), Long.valueOf(456));
Expand Down Expand Up @@ -172,9 +173,9 @@ public void testImport() {
assertTrue(elp.eval("ELProcessorTest$MyBean.aaaa == 101"));
assertTrue(elp.eval("ELProcessorTest$MyBean.getBar() == 64"));
elm.importStatic("org.glassfish.el.test.ELProcessorTest$MyBean.aaaa");
assertEquals(new Integer(101), elp.eval("aaaa"));
assertEquals(Integer.valueOf(101), elp.eval("aaaa"));
elm.importStatic("org.glassfish.el.test.ELProcessorTest$MyBean.getBar");
assertEquals(new Integer(64), elp.eval("getBar()"));
assertEquals(Integer.valueOf(64), elp.eval("getBar()"));
/*
elm.importStatic("a.b.NonExisting.foobar");
elp.eval("foobar");
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/org/glassfish/el/test/StaticRefTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021 Oracle and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -68,7 +69,7 @@ public void testClass() {

@Test
public void testConstructor() {
assertEquals(new Integer(1001), elp.eval("Integer(1001)"));
assertEquals(Integer.valueOf(1001), elp.eval("Integer(1001)"));
}

@Test
Expand Down

0 comments on commit 3d5c43d

Please sign in to comment.