8076089: Cleanup: Inline & remove sun.management.Util.newException

Reviewed-by: kevinw, amenkov, dfuchs, sspitsyn
This commit is contained in:
Jaikiran Pai 2022-01-27 03:57:28 +00:00
parent c2ee1b33c3
commit 890830196d
3 changed files with 7 additions and 11 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -68,7 +68,7 @@ public class LockInfoCompositeData extends LazyCompositeData {
return new CompositeDataSupport(LOCK_INFO_COMPOSITE_TYPE, items);
} catch (OpenDataException e) {
// Should never reach here
throw Util.newException(e);
throw new RuntimeException(e);
}
}
@ -79,7 +79,7 @@ public class LockInfoCompositeData extends LazyCompositeData {
MappedMXBeanType.toOpenType(LockInfo.class);
} catch (OpenDataException e) {
// Should never reach here
throw Util.newException(e);
throw new RuntimeException(e);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -482,7 +482,7 @@ public class ManagementFactoryHelper {
}
});
} catch (PrivilegedActionException e) {
throw Util.newException(e.getException());
throw new RuntimeException(e.getException());
}
}
@ -540,7 +540,7 @@ public class ManagementFactoryHelper {
}
});
} catch (PrivilegedActionException e) {
throw Util.newException(e.getException());
throw new RuntimeException(e.getException());
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,10 +34,6 @@ import javax.management.MalformedObjectNameException;
public class Util {
private Util() {} // there are no instances of this class
static RuntimeException newException(Exception e) {
throw new RuntimeException(e);
}
private static final String[] EMPTY_STRING_ARRAY = new String[0];
static String[] toStringArray(List<String> list) {
return list.toArray(EMPTY_STRING_ARRAY);