Skip to content

Commit

Permalink
Ensuring JDK 1.8 - JDK 21 support. Class fileformat 52.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdereg committed Nov 1, 2023
1 parent 36b56c0 commit 2735645
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 36 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<release>${maven.compiler.release}</release>
<!-- <release>${maven.compiler.release}</release>-->
</configuration>
</plugin>

Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/cedarsoftware/util/ExceptionUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ private ExceptionUtilities() {
*/
public static void safelyIgnoreException(Throwable t)
{
if (t instanceof ThreadDeath)
{
throw (ThreadDeath) t;
}

if (t instanceof OutOfMemoryError)
{
throw (OutOfMemoryError) t;
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/cedarsoftware/util/UniqueIdGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@SuppressWarnings("unchecked")
public class UniqueIdGenerator
{
public static final String JAVA_UTIL_CLUSTERID = "JAVA_UTIL_CLUSTERID";
Expand Down Expand Up @@ -168,7 +169,7 @@ private static long getUniqueIdAttempt()
previousTimeMilliseconds = currentTimeMilliseconds;
}

return currentTimeMilliseconds * 100000 + count * 100 + serverId;
return currentTimeMilliseconds * 100000 + count * 100L + serverId;
}

/**
Expand Down Expand Up @@ -221,7 +222,7 @@ private static long getFullUniqueId19()
previousTimeMilliseconds2 = currentTimeMilliseconds;
}

return currentTimeMilliseconds * 1000000 + count2 * 100 + serverId;
return currentTimeMilliseconds * 1000000 + count2 * 100L + serverId;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ public Object invoke(Object proxy, Method m, Object[] args) throws Throwable
// Get the return value of the call
result = _strategy.readResponse(c);
}
catch (ThreadDeath e)
{
throw e;
}
catch (Throwable e)
{
UrlUtilities.readErrorResponse(c);
Expand Down
14 changes: 1 addition & 13 deletions src/test/java/com/cedarsoftware/util/TestExceptionUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,7 @@ public void testConstructorIsPrivate() throws Exception {
assertNotNull(con.newInstance());
}


public void testThreadDeathThrown()
{
try
{
ExceptionUtilities.safelyIgnoreException(new ThreadDeath());
fail("should not make it here");
}
catch (ThreadDeath e)
{
}
}


public void testOutOfMemoryErrorThrown()
{
try
Expand Down
11 changes: 0 additions & 11 deletions src/test/java/com/cedarsoftware/util/TestReflectionUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,6 @@ public void testMethodAnnotation() throws Exception
assertNull(a);
}

@SuppressWarnings("unchecked")
@Test
public void testGetDeclaredFields() throws Exception
{
List fields = mock(ArrayList.class);
when(fields.add(any())).thenThrow(ThreadDeath.class);

assertThatExceptionOfType(ThreadDeath.class)
.isThrownBy(() -> ReflectionUtils.getDeclaredFields(Parent.class, fields));
}

@Test
public void testDeepDeclaredFields() throws Exception
{
Expand Down

0 comments on commit 2735645

Please sign in to comment.