You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2022/04/19 14:49:31 UTC
svn commit: r1900040 [6/8] - in /db/derby/code/trunk/java: org.apache.derby.client/org/apache/derby/client/ org.apache.derby.client/org/apache/derby/client/am/ org.apache.derby.client/org/apache/derby/client/net/ org.apache.derby.commons/org/apache/der...
Modified: db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/RAMAccessManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/RAMAccessManager.java?rev=1900040&r1=1900039&r2=1900040&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/RAMAccessManager.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/RAMAccessManager.java Tue Apr 19 14:49:30 2022
@@ -68,10 +68,6 @@ import org.apache.derby.catalog.UUID;
import org.apache.derby.shared.common.reference.SQLState;
import org.apache.derby.shared.common.reference.Attribute;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.security.AccessController;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.Hashtable;
@@ -1284,107 +1280,48 @@ public abstract class RAMAccessManager
// ///////////////////////////////////////////////////////////////
/**
- * Privileged lookup of the ContextService. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static ContextService getContextService()
{
- if ( System.getSecurityManager() == null )
- {
- return ContextService.getFactory();
- }
- else
- {
- return AccessController.doPrivileged
- (
- new PrivilegedAction<ContextService>()
- {
- public ContextService run()
- {
- return ContextService.getFactory();
- }
- }
- );
- }
+ return ContextService.getFactory();
}
/**
- * Privileged lookup of a Context. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Context getContext( final String contextID )
{
- return AccessController.doPrivileged
- (
- new PrivilegedAction<Context>()
- {
- public Context run()
- {
- return ContextService.getContext( contextID );
- }
- }
- );
+ return ContextService.getContext( contextID );
}
/**
- * Privileged Monitor lookup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static ModuleFactory getMonitor()
{
- return AccessController.doPrivileged
- (
- new PrivilegedAction<ModuleFactory>()
- {
- public ModuleFactory run()
- {
- return Monitor.getMonitor();
- }
- }
- );
+ return Monitor.getMonitor();
}
/**
- * Privileged startup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object startSystemModule( final String factoryInterface )
throws StandardException
{
- try {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction<Object>()
- {
- public Object run()
- throws StandardException
- {
- return Monitor.startSystemModule( factoryInterface );
- }
- }
- );
- } catch (PrivilegedActionException pae)
- {
- throw StandardException.plainWrapException( pae );
- }
+ return Monitor.startSystemModule( factoryInterface );
}
/**
- * Privileged startup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object bootServiceModule
(
final boolean create, final Object serviceModule,
@@ -1392,31 +1329,14 @@ public abstract class RAMAccessManager
)
throws StandardException
{
- try {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction<Object>()
- {
- public Object run()
- throws StandardException
- {
- return Monitor.bootServiceModule( create, serviceModule, factoryInterface, properties );
- }
- }
- );
- } catch (PrivilegedActionException pae)
- {
- throw StandardException.plainWrapException( pae );
- }
+ return Monitor.bootServiceModule( create, serviceModule, factoryInterface, properties );
}
/**
- * Privileged startup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object bootServiceModule
(
final boolean create, final Object serviceModule,
@@ -1424,49 +1344,17 @@ public abstract class RAMAccessManager
)
throws StandardException
{
- try {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction<Object>()
- {
- public Object run()
- throws StandardException
- {
- return Monitor.bootServiceModule( create, serviceModule, factoryInterface, identifier, properties );
- }
- }
- );
- } catch (PrivilegedActionException pae)
- {
- throw StandardException.plainWrapException( pae );
- }
+ return Monitor.bootServiceModule( create, serviceModule, factoryInterface, identifier, properties );
}
/**
- * Privileged startup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object findServiceModule( final Object serviceModule, final String factoryInterface)
throws StandardException
{
- try {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction<Object>()
- {
- public Object run()
- throws StandardException
- {
- return Monitor.findServiceModule( serviceModule, factoryInterface );
- }
- }
- );
- } catch (PrivilegedActionException pae)
- {
- throw StandardException.plainWrapException( pae );
- }
+ return Monitor.findServiceModule( serviceModule, factoryInterface );
}
}
Modified: db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/btree/index/B2IFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/btree/index/B2IFactory.java?rev=1900040&r1=1900039&r2=1900040&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/btree/index/B2IFactory.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/btree/index/B2IFactory.java Tue Apr 19 14:49:30 2022
@@ -21,8 +21,6 @@
package org.apache.derby.impl.store.access.btree.index;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.Properties;
import org.apache.derby.shared.common.reference.SQLState;
@@ -373,23 +371,12 @@ public class B2IFactory implements Congl
}
/**
- * Privileged Monitor lookup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static ModuleFactory getMonitor()
{
- return AccessController.doPrivileged
- (
- new PrivilegedAction<ModuleFactory>()
- {
- public ModuleFactory run()
- {
- return Monitor.getMonitor();
- }
- }
- );
+ return Monitor.getMonitor();
}
}
Modified: db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/heap/HeapConglomerateFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/heap/HeapConglomerateFactory.java?rev=1900040&r1=1900039&r2=1900040&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/heap/HeapConglomerateFactory.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/heap/HeapConglomerateFactory.java Tue Apr 19 14:49:30 2022
@@ -55,8 +55,6 @@ import org.apache.derby.iapi.services.uu
import org.apache.derby.catalog.UUID;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.Properties;
// For JavaDoc references (i.e. @see)
@@ -372,23 +370,12 @@ public class HeapConglomerateFactory imp
}
/**
- * Privileged Monitor lookup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static ModuleFactory getMonitor()
{
- return AccessController.doPrivileged
- (
- new PrivilegedAction<ModuleFactory>()
- {
- public ModuleFactory run()
- {
- return Monitor.getMonitor();
- }
- }
- );
+ return Monitor.getMonitor();
}
}
Modified: db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/sort/ExternalSortFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/sort/ExternalSortFactory.java?rev=1900040&r1=1900039&r2=1900040&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/sort/ExternalSortFactory.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/access/sort/ExternalSortFactory.java Tue Apr 19 14:49:30 2022
@@ -21,8 +21,6 @@
package org.apache.derby.impl.store.access.sort;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.Properties;
import org.apache.derby.iapi.services.monitor.ModuleControl;
@@ -392,23 +390,12 @@ public class ExternalSortFactory impleme
/**
- * Privileged Monitor lookup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static ModuleFactory getMonitor()
{
- return AccessController.doPrivileged
- (
- new PrivilegedAction<ModuleFactory>()
- {
- public ModuleFactory run()
- {
- return Monitor.getMonitor();
- }
- }
- );
+ return Monitor.getMonitor();
}
}
Modified: db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/RawStore.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/RawStore.java?rev=1900040&r1=1900039&r2=1900040&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/RawStore.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/RawStore.java Tue Apr 19 14:49:30 2022
@@ -67,11 +67,6 @@ import org.apache.derby.shared.common.re
import org.apache.derby.shared.common.reference.MessageId;
import org.apache.derby.shared.common.reference.Property;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.SecureRandom;
-
import java.util.Date;
import java.util.Properties;
import java.io.Serializable;
@@ -82,6 +77,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.security.PrivilegedExceptionAction;
+import java.security.SecureRandom;
import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
import org.apache.derby.iapi.sql.dictionary.DataDictionary;
@@ -100,7 +96,7 @@ import org.apache.derby.iapi.store.repli
and implements PrivilegedExceptionAction.
*/
-public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSupportable, PrivilegedExceptionAction<Object>
+public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSupportable
{
private static final String BACKUP_HISTORY = "BACKUP.HISTORY";
protected TransactionFactory xactFactory;
@@ -2347,65 +2343,62 @@ public final class RawStore implements R
These methods require Priv Blocks when run under a security manager.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- private synchronized OutputStreamWriter privFileWriter( StorageFile fileName, boolean append) throws IOException
- {
+ private synchronized OutputStreamWriter privFileWriter( StorageFile fileName, boolean append) throws IOException
+ {
actionCode = FILE_WRITER_ACTION;
actionStorageFile = fileName;
actionAppend = append;
- try{
- return (OutputStreamWriter) java.security.AccessController.doPrivileged( this);
- }catch (java.security.PrivilegedActionException pae)
- {
- throw (IOException) pae.getException();
+ try{
+ return (OutputStreamWriter) run();
}
+ catch (StandardException pae) { throw wrapSE(pae); }
finally
{
actionStorageFile = null;
}
- }
+ }
+
+ /** Wrap a StandardException in an IOException to handle the signature of run() */
+ private IOException wrapSE(Exception se)
+ {
+ // should never be called
+ return new IOException(se.getMessage(), se);
+ }
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- private synchronized boolean privExists( File file)
+ private synchronized boolean privExists( File file)
{
actionCode = REGULAR_FILE_EXISTS_ACTION;
actionRegularFile = file;
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) { return false;} // does not throw an exception
+ catch( Exception pae) { return false;} // does not throw an exception
finally
{
actionRegularFile = null;
}
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- private synchronized boolean privExists(final StorageFile file)
+ private synchronized boolean privExists(final StorageFile file)
{
actionCode = STORAGE_FILE_EXISTS_ACTION;
actionStorageFile = file;
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) { return false;} // does not throw an exception
+ catch( Exception pae) { return false;} // does not throw an exception
finally
{
actionStorageFile = null;
}
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized OutputStreamWriter privGetOutputStreamWriter(StorageFile file)
throws IOException
{
@@ -2413,16 +2406,11 @@ public final class RawStore implements R
actionStorageFile = file;
try
{
- return (OutputStreamWriter) java.security.AccessController.doPrivileged(this);
- }
- catch (java.security.PrivilegedActionException pae)
- {
- throw (IOException) pae.getException();
+ return (OutputStreamWriter) run();
}
+ catch (StandardException pae) { throw wrapSE(pae); }
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privDelete( File file)
{
actionCode = REGULAR_FILE_DELETE_ACTION;
@@ -2430,18 +2418,16 @@ public final class RawStore implements R
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) { return false;} // does not throw an exception
+ catch( Exception pae) { return false;} // does not throw an exception
finally
{
actionRegularFile = null;
}
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privDelete(StorageFile file)
{
actionCode = STORAGE_FILE_DELETE_ACTION;
@@ -2449,20 +2435,16 @@ public final class RawStore implements R
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) { return false;} // does not throw an exception
+ catch( Exception pae) { return false;} // does not throw an exception
finally
{
actionStorageFile = null;
}
}
-
-
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privMkdirs(File file) throws IOException
{
actionCode = REGULAR_FILE_MKDIRS_ACTION;
@@ -2470,21 +2452,16 @@ public final class RawStore implements R
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch (PrivilegedActionException pae) {
- throw (IOException) pae.getCause();
- }
+ catch (StandardException pae) { throw wrapSE(pae); }
finally
{
actionRegularFile = null;
}
}
-
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privIsDirectory( File file)
{
actionCode = REGULAR_FILE_IS_DIRECTORY_ACTION;
@@ -2492,18 +2469,16 @@ public final class RawStore implements R
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) { return false;} // does not throw an exception
+ catch( Exception pae) { return false;} // does not throw an exception
finally
{
actionRegularFile = null;
}
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privRemoveDirectory( File file)
{
actionCode = REGULAR_FILE_REMOVE_DIRECTORY_ACTION;
@@ -2511,18 +2486,16 @@ public final class RawStore implements R
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) { return false;} // does not throw an exception
+ catch( Exception pae) { return false;} // does not throw an exception
finally
{
actionRegularFile = null;
}
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privRenameTo( File file1, File file2)
{
actionCode = REGULAR_FILE_RENAME_TO_ACTION;
@@ -2531,10 +2504,10 @@ public final class RawStore implements R
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) { return false;} // does not throw an exception
+ catch( Exception pae) { return false;} // does not throw an exception
finally
{
actionRegularFile = null;
@@ -2542,8 +2515,6 @@ public final class RawStore implements R
}
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privCopyDirectory(StorageFile from,
File to,
byte[] buffer,
@@ -2560,11 +2531,12 @@ public final class RawStore implements R
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) {
- throw (StandardException)pae.getCause();
+ catch( IOException pae) {
+ // should never happen
+ throw StandardException.plainWrapException(pae);
}
finally
{
@@ -2576,8 +2548,6 @@ public final class RawStore implements R
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privCopyDirectory( File from, StorageFile to, byte[] buffer, String[] filter)
{
actionCode = COPY_REGULAR_DIRECTORY_TO_STORAGE_ACTION;
@@ -2588,10 +2558,10 @@ public final class RawStore implements R
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) { return false;} // does not throw an exception
+ catch( Exception pae) { return false;} // does not throw an exception
finally
{
actionStorageFile = null;
@@ -2602,8 +2572,6 @@ public final class RawStore implements R
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privCopyFile( File from, StorageFile to)
{
actionCode = COPY_REGULAR_FILE_TO_STORAGE_ACTION;
@@ -2612,10 +2580,10 @@ public final class RawStore implements R
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) { return false;} // does not throw an exception
+ catch( Exception pae) { return false;} // does not throw an exception
finally
{
actionStorageFile = null;
@@ -2623,8 +2591,6 @@ public final class RawStore implements R
}
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privCopyFile( StorageFile from, File to)
throws StandardException
{
@@ -2634,11 +2600,12 @@ public final class RawStore implements R
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) {
- throw (StandardException)pae.getCause();
+ catch( IOException pae) {
+ // should never happen
+ throw StandardException.plainWrapException(pae);
}
finally
{
@@ -2647,10 +2614,6 @@ public final class RawStore implements R
}
}
-
-
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privCopyFile( StorageFile from, StorageFile to)
{
actionCode = COPY_STORAGE_FILE_TO_STORAGE_ACTION;
@@ -2659,10 +2622,10 @@ public final class RawStore implements R
try
{
- Object ret = AccessController.doPrivileged( this);
+ Object ret = run();
return ((Boolean) ret).booleanValue();
}
- catch( PrivilegedActionException pae) { return false;} // does not throw an exception
+ catch( Exception pae) { return false;} // does not throw an exception
finally
{
actionStorageFile = null;
@@ -2670,9 +2633,6 @@ public final class RawStore implements R
}
}
-
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized String[] privList(final StorageFile file)
{
actionCode = STORAGE_FILE_LIST_DIRECTORY_ACTION;
@@ -2680,18 +2640,15 @@ public final class RawStore implements R
try
{
- return (String[]) AccessController.doPrivileged( this);
+ return (String[]) run();
}
- catch( PrivilegedActionException pae) { return null;} // does not throw an exception
+ catch( Exception pae) { return null;} // does not throw an exception
finally
{
actionStorageFile = null;
}
}
-
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized String privGetCanonicalPath(final StorageFile file)
{
actionCode = STORAGE_FILE_GET_CANONICALPATH_ACTION;
@@ -2699,25 +2656,17 @@ public final class RawStore implements R
try
{
- return (String) AccessController.doPrivileged( this);
+ return (String) run();
}
- catch( PrivilegedActionException pae) {
+ catch( Exception pae) {
return null;
} // does not throw an exception
- catch(SecurityException se) {
- // there are no permission to get canonical path
- // just return null.
- return null;
- }
finally
{
actionStorageFile = null;
}
}
-
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized String privGetCanonicalPath(final File file)
{
actionCode = REGULAR_FILE_GET_CANONICALPATH_ACTION;
@@ -2725,16 +2674,11 @@ public final class RawStore implements R
try
{
- return (String) AccessController.doPrivileged( this);
+ return (String) run();
}
- catch( PrivilegedActionException pae) {
+ catch( Exception pae) {
return null;
} // does not throw an exception
- catch(SecurityException se) {
- // there are no permission to get canonical path
- // just return null.
- return null;
- }
finally
{
actionRegularFile = null;
@@ -2876,128 +2820,58 @@ public final class RawStore implements R
}
/**
- * Privileged lookup of the ContextService. Private so that user code
+ * Private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static ContextService getContextService()
{
- if ( System.getSecurityManager() == null )
- {
- return ContextService.getFactory();
- }
- else
- {
- return AccessController.doPrivileged
- (
- new PrivilegedAction<ContextService>()
- {
- public ContextService run()
- {
- return ContextService.getFactory();
- }
- }
- );
- }
+ return ContextService.getFactory();
}
/**
- * Privileged lookup of a Context. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Context getContextOrNull( final String contextID )
{
- return AccessController.doPrivileged
- (
- new PrivilegedAction<Context>()
- {
- public Context run()
- {
- return ContextService.getContextOrNull( contextID );
- }
- }
- );
+ return ContextService.getContextOrNull( contextID );
}
/**
- * Privileged Monitor lookup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static ModuleFactory getMonitor()
{
- return AccessController.doPrivileged
- (
- new PrivilegedAction<ModuleFactory>()
- {
- public ModuleFactory run()
- {
- return Monitor.getMonitor();
- }
- }
- );
+ return Monitor.getMonitor();
}
/**
- * Privileged service name lookup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static String getServiceName( final Object serviceModule )
{
- return AccessController.doPrivileged
- (
- new PrivilegedAction<String>()
- {
- public String run()
- {
- return Monitor.getServiceName( serviceModule );
- }
- }
- );
+ return Monitor.getServiceName( serviceModule );
}
/**
- * Privileged startup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object startSystemModule( final String factoryInterface )
throws StandardException
{
- try {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction<Object>()
- {
- public Object run()
- throws StandardException
- {
- return Monitor.startSystemModule( factoryInterface );
- }
- }
- );
- } catch (PrivilegedActionException pae)
- {
- throw StandardException.plainWrapException( pae );
- }
+ return Monitor.startSystemModule( factoryInterface );
}
/**
- * Privileged startup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object bootServiceModule
(
final boolean create, final Object serviceModule,
@@ -3005,49 +2879,17 @@ public final class RawStore implements R
)
throws StandardException
{
- try {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction<Object>()
- {
- public Object run()
- throws StandardException
- {
- return Monitor.bootServiceModule( create, serviceModule, factoryInterface, properties );
- }
- }
- );
- } catch (PrivilegedActionException pae)
- {
- throw StandardException.plainWrapException( pae );
- }
+ return Monitor.bootServiceModule( create, serviceModule, factoryInterface, properties );
}
/**
- * Privileged startup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object findServiceModule( final Object serviceModule, final String factoryInterface)
throws StandardException
{
- try {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction<Object>()
- {
- public Object run()
- throws StandardException
- {
- return Monitor.findServiceModule( serviceModule, factoryInterface );
- }
- }
- );
- } catch (PrivilegedActionException pae)
- {
- throw StandardException.plainWrapException( pae );
- }
+ return Monitor.findServiceModule( serviceModule, factoryInterface );
}
}
Modified: db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java?rev=1900040&r1=1900039&r2=1900040&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java Tue Apr 19 14:49:30 2022
@@ -90,11 +90,7 @@ import java.io.IOException;
import java.net.URL;
-import java.security.AccessController;
import java.security.CodeSource;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
-import java.security.PrivilegedActionException;
/**
@@ -116,7 +112,7 @@ that file was made to inherit from this
**/
public class BaseDataFileFactory
- implements DataFactory, CacheableFactory, ModuleControl, ModuleSupportable, PrivilegedExceptionAction<Object>
+ implements DataFactory, CacheableFactory, ModuleControl, ModuleSupportable
{
StorageFactory storageFactory;
@@ -262,39 +258,36 @@ public class BaseDataFileFactory
return true;
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- public void boot(boolean create, Properties startParams)
+ public void boot(boolean create, Properties startParams)
throws StandardException
{
-
- jbmsVersion = getMonitor().getEngineVersion();
+ jbmsVersion = getMonitor().getEngineVersion();
- jvmVersion = buildJvmVersion();
+ jvmVersion = buildJvmVersion();
- osInfo = buildOSinfo();
+ osInfo = buildOSinfo();
- jarCPath = jarClassPath(getClass());
+ jarCPath = jarClassPath(getClass());
- dataDirectory = startParams.getProperty(PersistentService.ROOT);
+ dataDirectory = startParams.getProperty(PersistentService.ROOT);
- UUIDFactory uf = getMonitor().getUUIDFactory();
+ UUIDFactory uf = getMonitor().getUUIDFactory();
- identifier = uf.createUUID();
+ identifier = uf.createUUID();
PersistentService ps = getMonitor().getServiceType(this);
try
{
storageFactory =
- ps.getStorageFactoryInstance(
- true,
- dataDirectory,
- startParams.getProperty(
- Property.STORAGE_TEMP_DIRECTORY,
- PropertyUtil.getSystemProperty(
- Property.STORAGE_TEMP_DIRECTORY)),
- identifier.toANSIidentifier());
+ ps.getStorageFactoryInstance(
+ true,
+ dataDirectory,
+ startParams.getProperty(
+ Property.STORAGE_TEMP_DIRECTORY,
+ PropertyUtil.getSystemProperty(
+ Property.STORAGE_TEMP_DIRECTORY)),
+ identifier.toANSIidentifier());
}
catch(IOException ioe)
{
@@ -328,128 +321,128 @@ public class BaseDataFileFactory
try
{
- AccessController.doPrivileged( this);
+ run();
}
- catch (PrivilegedActionException pae)
+ catch (Exception pae)
{
// BOOT_ACTION does not throw any exceptions.
}
String value =
startParams.getProperty(Property.FORCE_DATABASE_LOCK,
- PropertyUtil.getSystemProperty(Property.FORCE_DATABASE_LOCK));
+ PropertyUtil.getSystemProperty(Property.FORCE_DATABASE_LOCK));
throwDBlckException =
Boolean.valueOf(
(value != null ? value.trim() : value)).booleanValue();
- if (!isReadOnly()) // read only db, not interested in filelock
- getJBMSLockOnDB(identifier, uf, dataDirectory);
+ if (!isReadOnly()) // read only db, not interested in filelock
+ getJBMSLockOnDB(identifier, uf, dataDirectory);
- //If the database is being restored/created from backup
- //the restore the data directory(seg*) from backup
- String restoreFrom =null;
- restoreFrom = startParams.getProperty(Attribute.CREATE_FROM);
- if(restoreFrom == null)
- restoreFrom = startParams.getProperty(Attribute.RESTORE_FROM);
- if(restoreFrom == null)
- restoreFrom = startParams.getProperty(Attribute.ROLL_FORWARD_RECOVERY_FROM);
+ //If the database is being restored/created from backup
+ //the restore the data directory(seg*) from backup
+ String restoreFrom =null;
+ restoreFrom = startParams.getProperty(Attribute.CREATE_FROM);
+ if(restoreFrom == null)
+ restoreFrom = startParams.getProperty(Attribute.RESTORE_FROM);
+ if(restoreFrom == null)
+ restoreFrom = startParams.getProperty(Attribute.ROLL_FORWARD_RECOVERY_FROM);
- if (restoreFrom !=null)
- {
- try
+ if (restoreFrom !=null)
+ {
+ try
{
// restoreFrom and createFrom operations also need to know if database
// is encrypted
String dataEncryption =
startParams.getProperty(Attribute.DATA_ENCRYPTION);
databaseEncrypted = Boolean.valueOf(dataEncryption).booleanValue();
- restoreDataDirectory(restoreFrom);
- }
+ restoreDataDirectory(restoreFrom);
+ }
catch(StandardException se)
- {
- releaseJBMSLockOnDB();
- throw se;
- }
- }
+ {
+ releaseJBMSLockOnDB();
+ throw se;
+ }
+ }
- logMsg(LINE);
+ logMsg(LINE);
String messageID = (isReadOnly()) ?
MessageId.STORE_BOOT_MSG_READ_ONLY
: MessageId.STORE_BOOT_MSG;
boolean logBootTrace = Boolean.valueOf(startParams.getProperty(Property.LOG_BOOT_TRACE,
- PropertyUtil.getSystemProperty(Property.LOG_BOOT_TRACE))).booleanValue();
+ PropertyUtil.getSystemProperty(Property.LOG_BOOT_TRACE))).booleanValue();
logMsg(new Date() +
- MessageService.getTextMessage(messageID,
+ MessageService.getTextMessage(messageID,
jbmsVersion,
identifier,
dataDirectory,
// cast to Object so we get object hash code
(Object) this.getClass().getClassLoader(),
jarCPath
- ));
- //Log the JVM version info
- logMsg(jvmVersion);
-
- //Log the OS info
- logMsg(osInfo);
-
- //Log derby.system.home It will have null value if user didn't set it
- logMsg(Property.SYSTEM_HOME_PROPERTY+"=" +
- PropertyUtil.getSystemProperty(Property.SYSTEM_HOME_PROPERTY));
+ ));
+ //Log the JVM version info
+ logMsg(jvmVersion);
+
+ //Log the OS info
+ logMsg(osInfo);
+
+ //Log derby.system.home It will have null value if user didn't set it
+ logMsg(Property.SYSTEM_HOME_PROPERTY+"=" +
+ PropertyUtil.getSystemProperty(Property.SYSTEM_HOME_PROPERTY));
- //Log properties related to redirection of derby.log
- String target =
- PropertyUtil.getSystemProperty(Property.ERRORLOG_STYLE_PROPERTY);
- if (target != null)
- logMsg(Property.ERRORLOG_STYLE_PROPERTY+"=" + target);
+ //Log properties related to redirection of derby.log
+ String target =
+ PropertyUtil.getSystemProperty(Property.ERRORLOG_STYLE_PROPERTY);
+ if (target != null)
+ logMsg(Property.ERRORLOG_STYLE_PROPERTY+"=" + target);
- target =
- PropertyUtil.getSystemProperty(Property.ERRORLOG_FILE_PROPERTY);
- if (target != null)
- logMsg(Property.ERRORLOG_FILE_PROPERTY+"=" + target);
+ target =
+ PropertyUtil.getSystemProperty(Property.ERRORLOG_FILE_PROPERTY);
+ if (target != null)
+ logMsg(Property.ERRORLOG_FILE_PROPERTY+"=" + target);
- target =
- PropertyUtil.getSystemProperty(Property.ERRORLOG_METHOD_PROPERTY);
- if (target != null)
- logMsg(Property.ERRORLOG_METHOD_PROPERTY+"=" + target);
+ target =
+ PropertyUtil.getSystemProperty(Property.ERRORLOG_METHOD_PROPERTY);
+ if (target != null)
+ logMsg(Property.ERRORLOG_METHOD_PROPERTY+"=" + target);
- target =
- PropertyUtil.getSystemProperty(Property.ERRORLOG_FIELD_PROPERTY);
- if (target != null)
- logMsg(Property.ERRORLOG_FIELD_PROPERTY+"=" + target);
+ target =
+ PropertyUtil.getSystemProperty(Property.ERRORLOG_FIELD_PROPERTY);
+ if (target != null)
+ logMsg(Property.ERRORLOG_FIELD_PROPERTY+"=" + target);
if (logBootTrace)
- Monitor.logThrowable(new Throwable("boot trace"));
- uf = null;
+ Monitor.logThrowable(new Throwable("boot trace"));
+ uf = null;
- CacheFactory cf = (CacheFactory)
+ CacheFactory cf = (CacheFactory)
startSystemModule(
org.apache.derby.shared.common.reference.Module.CacheFactory);
// Initialize the page cache
- int pageCacheSize = getIntParameter(
- RawStoreFactory.PAGE_CACHE_SIZE_PARAMETER,
- null,
- RawStoreFactory.PAGE_CACHE_SIZE_DEFAULT,
- RawStoreFactory.PAGE_CACHE_SIZE_MINIMUM,
- RawStoreFactory.PAGE_CACHE_SIZE_MAXIMUM);
+ int pageCacheSize = getIntParameter(
+ RawStoreFactory.PAGE_CACHE_SIZE_PARAMETER,
+ null,
+ RawStoreFactory.PAGE_CACHE_SIZE_DEFAULT,
+ RawStoreFactory.PAGE_CACHE_SIZE_MINIMUM,
+ RawStoreFactory.PAGE_CACHE_SIZE_MAXIMUM);
- pageCache =
+ pageCache =
cf.newCacheManager(
this, "PageCache", pageCacheSize / 2, pageCacheSize);
// Initialize the container cache
- int fileCacheSize = getIntParameter(
- RawStoreFactory.CONTAINER_CACHE_SIZE_PARAMETER,
- null,
- RawStoreFactory.CONTAINER_CACHE_SIZE_DEFAULT,
- RawStoreFactory.CONTAINER_CACHE_SIZE_MINIMUM,
- RawStoreFactory.CONTAINER_CACHE_SIZE_MAXIMUM);
+ int fileCacheSize = getIntParameter(
+ RawStoreFactory.CONTAINER_CACHE_SIZE_PARAMETER,
+ null,
+ RawStoreFactory.CONTAINER_CACHE_SIZE_DEFAULT,
+ RawStoreFactory.CONTAINER_CACHE_SIZE_MINIMUM,
+ RawStoreFactory.CONTAINER_CACHE_SIZE_MAXIMUM);
- containerCache =
+ containerCache =
cf.newCacheManager(
this, "ContainerCache", fileCacheSize / 2, fileCacheSize);
@@ -458,22 +451,22 @@ public class BaseDataFileFactory
pageCache.registerMBean(dataDirectory);
containerCache.registerMBean(dataDirectory);
- if (create)
- {
- String noLog =
- startParams.getProperty(Property.CREATE_WITH_NO_LOG);
+ if (create)
+ {
+ String noLog =
+ startParams.getProperty(Property.CREATE_WITH_NO_LOG);
- inCreateNoLog =
+ inCreateNoLog =
(noLog != null && Boolean.valueOf(noLog).booleanValue());
- }
+ }
- droppedTableStubInfo = new Hashtable<LogInstant,Object[]>();
+ droppedTableStubInfo = new Hashtable<LogInstant,Object[]>();
// If derby.system.durability=test then set flags to disable sync of
// data pages at allocation when file is grown, disable sync of data
// writes during checkpoint
if (Property.DURABILITY_TESTMODE_NO_SYNC.equalsIgnoreCase(
- PropertyUtil.getSystemProperty(Property.DURABILITY_PROPERTY)))
+ PropertyUtil.getSystemProperty(Property.DURABILITY_PROPERTY)))
{
// - disable syncing of data during checkpoint.
dataNotSyncedAtCheckpoint = true;
@@ -482,10 +475,10 @@ public class BaseDataFileFactory
// is set to a mode, where syncs wont be forced and the
// possible consequences of setting this mode
Monitor.logMessage(MessageService.getTextMessage(
- MessageId.STORE_DURABILITY_TESTMODE_NO_SYNC,
- Property.DURABILITY_PROPERTY,
- Property.DURABILITY_TESTMODE_NO_SYNC));
- }
+ MessageId.STORE_DURABILITY_TESTMODE_NO_SYNC,
+ Property.DURABILITY_PROPERTY,
+ Property.DURABILITY_TESTMODE_NO_SYNC));
+ }
else if (Performance.MEASURE)
{
// development build only feature, must by hand set the
@@ -504,10 +497,10 @@ public class BaseDataFileFactory
"Warning: " +
Property.STORAGE_DATA_NOT_SYNCED_AT_CHECKPOINT +
"set to true.");
- }
+ }
fileHandler = new RFResource( this);
- } // end of boot
+ } // end of boot
public void stop()
{
@@ -1554,8 +1547,6 @@ public class BaseDataFileFactory
return loggableAllocActions;
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized void removeTempDirectory()
{
if( storageFactory != null)
@@ -1563,9 +1554,9 @@ public class BaseDataFileFactory
actionCode = REMOVE_TEMP_DIRECTORY_ACTION;
try
{
- AccessController.doPrivileged( this);
+ run();
}
- catch (PrivilegedActionException pae)
+ catch (Exception pae)
{
// removeTempDirectory does not throw an exception
}
@@ -1612,8 +1603,6 @@ public class BaseDataFileFactory
return getContainerPath(containerId, stub, GET_CONTAINER_PATH_ACTION);
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized StorageFile getContainerPath(
ContainerKey containerId,
boolean stub,
@@ -1626,9 +1615,9 @@ public class BaseDataFileFactory
this.stub = stub;
try
{
- return (StorageFile) AccessController.doPrivileged( this);
+ return (StorageFile) run();
}
- catch (PrivilegedActionException pae)
+ catch (Exception pae)
{
// getContainerPath does not throw an exception
return null;
@@ -1638,7 +1627,7 @@ public class BaseDataFileFactory
{
this.containerId = null;
}
- }
+ }
/**
@@ -1663,26 +1652,24 @@ public class BaseDataFileFactory
- /**
- Remove stubs in this database. Stubs are committed deleted containers
- */
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- private synchronized void removeStubs()
- {
+ /**
+ Remove stubs in this database. Stubs are committed deleted containers
+ */
+ private synchronized void removeStubs()
+ {
if( storageFactory != null)
{
actionCode = REMOVE_STUBS_ACTION;
try
{
- AccessController.doPrivileged( this);
+ run();
}
- catch (PrivilegedActionException pae)
+ catch (Exception pae)
{
// removeStubs does not throw an exception
}
}
- }
+ }
/**
* keeps track of information about the stub files of the committed deleted
@@ -1708,67 +1695,63 @@ public class BaseDataFileFactory
}
}
- /**
- * Delete the stub files that are not required for recovery. A stub file
- * is not required to be around if the recovery is not going to see
- * any log record that belongs to that container. Since the stub files
- * are created as a post commit operation, they are not necessary during
- * undo operation of the recovery.
- *
- * To remove a stub file we have to be sure that it was created before the
- * redoLWM in the check point record. We can be sure that the stub is not
- * required if the log instant when it was created is less than the redoLWM.
- */
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- public void removeDroppedContainerFileStubs(
- LogInstant redoLWM)
+ /**
+ * Delete the stub files that are not required for recovery. A stub file
+ * is not required to be around if the recovery is not going to see
+ * any log record that belongs to that container. Since the stub files
+ * are created as a post commit operation, they are not necessary during
+ * undo operation of the recovery.
+ *
+ * To remove a stub file we have to be sure that it was created before the
+ * redoLWM in the check point record. We can be sure that the stub is not
+ * required if the log instant when it was created is less than the redoLWM.
+ */
+ public void removeDroppedContainerFileStubs(LogInstant redoLWM)
throws StandardException
- {
-
- if (droppedTableStubInfo != null)
- {
- synchronized(droppedTableStubInfo)
- {
- for (Enumeration<LogInstant> e = droppedTableStubInfo.keys();
+ {
+ if (droppedTableStubInfo != null)
+ {
+ synchronized(droppedTableStubInfo)
+ {
+ for (Enumeration<LogInstant> e = droppedTableStubInfo.keys();
e.hasMoreElements(); )
- {
- LogInstant logInstant = e.nextElement();
- if(logInstant.lessThan(redoLWM))
- {
+ {
+ LogInstant logInstant = e.nextElement();
+ if(logInstant.lessThan(redoLWM))
+ {
- Object[] removeInfo =
+ Object[] removeInfo =
droppedTableStubInfo.get(logInstant);
- Object identity = removeInfo[1];
- //delete the entry in the container cache.
- Cacheable ccentry = containerCache.findCached(identity);
- if(ccentry!=null)
- containerCache.remove(ccentry);
+ Object identity = removeInfo[1];
+ //delete the entry in the container cache.
+ Cacheable ccentry = containerCache.findCached(identity);
+ if(ccentry!=null)
+ containerCache.remove(ccentry);
- //delete the stub we don't require it during recovery
+ //delete the stub we don't require it during recovery
synchronized( this)
{
actionFile = (StorageFile)removeInfo[0];
actionCode = DELETE_IF_EXISTS_ACTION;
try
{
- if (AccessController.doPrivileged(this) != null)
+ if (run() != null)
{
//if we successfuly delete the file remove
//it from the hash table.
droppedTableStubInfo.remove(logInstant);
}
}
- catch (PrivilegedActionException pae)
+ catch (Exception pae)
{
// DELETE_IF_EXISTS does not throw an exception
}
}
- }
- }
- }
- }
- }
+ }
+ }
+ }
+ }
+ }
@@ -1788,41 +1771,38 @@ public class BaseDataFileFactory
* code.
* <p>
*
- * @return The largest containerid in seg0.
+ * @return The largest containerid in seg0.
**/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- private synchronized long findMaxContainerId()
- {
+ private synchronized long findMaxContainerId()
+ {
actionCode = FIND_MAX_CONTAINER_ID_ACTION;
try
{
- return ((Long) AccessController.doPrivileged( this)).longValue();
+ return (Long) run();
}
- catch (PrivilegedActionException pae)
+ catch (Exception pae)
{
// findMaxContainerId does not throw an exception
return 0;
}
- }
+ }
- private void bootLogFactory(
- boolean create,
- Properties startParams)
+ private void bootLogFactory(
+ boolean create,
+ Properties startParams)
throws StandardException
{
-
- if (isReadOnly())
+ if (isReadOnly())
{
- startParams.put(
+ startParams.put(
LogFactory.RUNTIME_ATTRIBUTES, LogFactory.RT_READONLY);
}
- logFactory = (LogFactory)
- bootServiceModule(
+ logFactory = (LogFactory)
+ bootServiceModule(
create, this,
rawStoreFactory.getLogFactoryModule(), startParams);
- }
+ }
/**
@@ -1874,24 +1854,22 @@ public class BaseDataFileFactory
@exception StandardException another JBMS is already attached to the
database at this directory
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- private void getJBMSLockOnDB(
- UUID myUUID,
- UUIDFactory uuidFactory,
- String databaseDirectory)
- throws StandardException
- {
- if (fileLockOnDB != null) // I already got the lock!
- return;
+ private void getJBMSLockOnDB(
+ UUID myUUID,
+ UUIDFactory uuidFactory,
+ String databaseDirectory)
+ throws StandardException
+ {
+ if (fileLockOnDB != null) // I already got the lock!
+ return;
- if (isReadOnly())
- return;
- if (SanityManager.DEBUG)
- {
- if (myUUID == null)
- SanityManager.THROWASSERT("myUUID == null");
- }
+ if (isReadOnly())
+ return;
+ if (SanityManager.DEBUG)
+ {
+ if (myUUID == null)
+ SanityManager.THROWASSERT("myUUID == null");
+ }
synchronized( this)
{
@@ -1902,11 +1880,12 @@ public class BaseDataFileFactory
try
{
- AccessController.doPrivileged( this);
+ run();
}
- catch (PrivilegedActionException pae)
- {
- throw (StandardException) pae.getException();
+ catch (IOException pae)
+ {
+ // should never happen
+ throw StandardException.plainWrapException(pae);
}
finally
{
@@ -1916,10 +1895,10 @@ public class BaseDataFileFactory
}
}
- // OK file lock is reliable, we think... keep the fileLockOnDB file
- // descriptor open to prevent other JBMS from booting
- // fileLockOnDB is not null in this case
- }
+ // OK file lock is reliable, we think... keep the fileLockOnDB file
+ // descriptor open to prevent other JBMS from booting
+ // fileLockOnDB is not null in this case
+ }
// Called from within a privilege block
private void privGetJBMSLockOnDB() throws StandardException
@@ -2101,21 +2080,19 @@ public class BaseDataFileFactory
}
} // end of privGetJBMSLockOnDB
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- private void releaseJBMSLockOnDB()
- {
- if (isReadOnly())
- return;
+ private void releaseJBMSLockOnDB()
+ {
+ if (isReadOnly())
+ { return; }
synchronized( this)
{
actionCode = RELEASE_LOCK_ON_DB_ACTION;
try
{
- AccessController.doPrivileged( this);
+ run();
}
- catch (PrivilegedActionException pae)
+ catch (Exception pae)
{
// do nothing - it may be read only medium, who knows what the
// problem is
@@ -2125,7 +2102,7 @@ public class BaseDataFileFactory
fileLockOnDB = null;
}
}
- }
+ }
private void privReleaseJBMSLockOnDB() throws IOException
{
@@ -2223,30 +2200,17 @@ public class BaseDataFileFactory
*
* @return the ClassPath of a jar file
**/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static String jarClassPath(final Class cls)
{
- return AccessController.doPrivileged( new PrivilegedAction<String>()
- {
- public String run()
- {
- CodeSource cs = null;
- try {
- cs = cls.getProtectionDomain().getCodeSource();
- }
- catch (SecurityException se) {
- return se.getMessage();
- }
+ CodeSource cs = null;
+ cs = cls.getProtectionDomain().getCodeSource();
- if ( cs == null || cs.getLocation() == null )
- return null;
+ if ( cs == null || cs.getLocation() == null )
+ return null;
- URL result = cs.getLocation ();
+ URL result = cs.getLocation ();
- return result.toString();
- }
- });
+ return result.toString();
}
/**
@@ -2255,27 +2219,16 @@ public class BaseDataFileFactory
* @return the Java system property value for the OS or a string capturing a
* security exception.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static String buildOSinfo () {
- return AccessController.doPrivileged(new PrivilegedAction<String>(){
- public String run() {
- String osInfo = "";
- try {
- String currentProp = PropertyUtil.getSystemProperty("os.name");
- if (currentProp != null)
- osInfo = "os.name="+currentProp+"\n";
- if ((currentProp = PropertyUtil.getSystemProperty("os.arch")) != null)
- osInfo += "os.arch="+currentProp+"\n";
- if ((currentProp = PropertyUtil.getSystemProperty("os.version")) != null)
- osInfo += "os.version="+currentProp;
- }
- catch(SecurityException se){
- return se.getMessage();
- }
- return osInfo;
- }
- });
+ String osInfo = "";
+ String currentProp = PropertyUtil.getSystemProperty("os.name");
+ if (currentProp != null)
+ osInfo = "os.name="+currentProp+"\n";
+ if ((currentProp = PropertyUtil.getSystemProperty("os.arch")) != null)
+ osInfo += "os.arch="+currentProp+"\n";
+ if ((currentProp = PropertyUtil.getSystemProperty("os.version")) != null)
+ osInfo += "os.version="+currentProp;
+ return osInfo;
}
/**
@@ -2284,31 +2237,18 @@ public class BaseDataFileFactory
* @return the Java system property value from the JVM or a string capturing a
* security exception.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static String buildJvmVersion () {
- return AccessController.doPrivileged( new PrivilegedAction<String>()
- {
- public String run()
- {
- String jvmversion = "";
- try {
- String currentProp = PropertyUtil.getSystemProperty("java.vendor");
- if ( currentProp != null)
- jvmversion = "java.vendor=" + currentProp;
- if ((currentProp = PropertyUtil.getSystemProperty("java.runtime.version")) != null)
- jvmversion += "\njava.runtime.version=" + currentProp;
- if ((currentProp = PropertyUtil.getSystemProperty("java.fullversion")) != null)
- jvmversion += "\njava.fullversion=" + currentProp ;
- if ((currentProp = PropertyUtil.getSystemProperty("user.dir")) != null)
- jvmversion += "\nuser.dir=" + currentProp ;
- }
- catch (SecurityException se) {
- return se.getMessage();
- }
- return jvmversion;
- }
- });
+ String jvmversion = "";
+ String currentProp = PropertyUtil.getSystemProperty("java.vendor");
+ if ( currentProp != null)
+ jvmversion = "java.vendor=" + currentProp;
+ if ((currentProp = PropertyUtil.getSystemProperty("java.runtime.version")) != null)
+ jvmversion += "\njava.runtime.version=" + currentProp;
+ if ((currentProp = PropertyUtil.getSystemProperty("java.fullversion")) != null)
+ jvmversion += "\njava.fullversion=" + currentProp ;
+ if ((currentProp = PropertyUtil.getSystemProperty("user.dir")) != null)
+ jvmversion += "\nuser.dir=" + currentProp ;
+ return jvmversion;
} // end of buildjvmVersion
/**
@@ -2354,15 +2294,13 @@ public class BaseDataFileFactory
return databaseEncrypted ? rawStoreFactory.random() : 0;
}
- /**
- Add a file to the list of files to be removed post recovery.
- */
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- void fileToRemove( StorageFile file, boolean remove)
+ /**
+ Add a file to the list of files to be removed post recovery.
+ */
+ void fileToRemove( StorageFile file, boolean remove)
{
- if (postRecoveryRemovedFiles == null)
- postRecoveryRemovedFiles = new Hashtable<String,StorageFile>();
+ if (postRecoveryRemovedFiles == null)
+ { postRecoveryRemovedFiles = new Hashtable<String,StorageFile>(); }
String path = null;
synchronized( this)
{
@@ -2370,9 +2308,9 @@ public class BaseDataFileFactory
actionFile = file;
try
{
- path = (String) AccessController.doPrivileged( this);
+ path = (String) run();
}
- catch (PrivilegedActionException pae)
+ catch (Exception pae)
{
// GET_PATH does not throw an exception
}
@@ -2381,45 +2319,41 @@ public class BaseDataFileFactory
actionFile = null;
}
}
- if (remove) // to be removed
- postRecoveryRemovedFiles.put(path, file);
- else
- postRecoveryRemovedFiles.remove(path);
-
- }
+ if (remove) // to be removed
+ { postRecoveryRemovedFiles.put(path, file); }
+ else
+ { postRecoveryRemovedFiles.remove(path); }
+ }
- /**
- Called after recovery is performed.
+ /**
+ Called after recovery is performed.
- @exception StandardException Standard Derby Error Policy
- */
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- public void postRecovery() throws StandardException
+ @exception StandardException Standard Derby Error Policy
+ */
+ public void postRecovery() throws StandardException
{
+ DaemonService daemon = rawStoreFactory.getDaemon();
- DaemonService daemon = rawStoreFactory.getDaemon();
-
- if (daemon == null)
- return;
+ if (daemon == null)
+ return;
- if (postRecoveryRemovedFiles != null)
+ if (postRecoveryRemovedFiles != null)
{
synchronized( this)
{
actionCode = POST_RECOVERY_REMOVE_ACTION;
try
{
- AccessController.doPrivileged( this);
+ run();
}
- catch (PrivilegedActionException pae)
+ catch (Exception pae)
{
// POST_RECOVERY_REMOVE does not throw an exception
}
}
- postRecoveryRemovedFiles = null;
- }
- }
+ postRecoveryRemovedFiles = null;
+ }
+ }
/**
* Set up the cache cleaner for the container cache and the page cache.
@@ -2603,46 +2537,42 @@ public class BaseDataFileFactory
}
}
- /**
+ /**
* get all the names of the files in seg 0.
* MT - This method needs to be synchronized to avoid conflicts
* with other privileged actions execution in this class.
* @return An array of all the file names in seg0.
**/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
synchronized String[] getContainerNames()
- {
+ {
actionCode = GET_CONTAINER_NAMES_ACTION;
try{
- return (String[]) AccessController.doPrivileged( this);
+ return (String[]) run();
}
- catch( PrivilegedActionException pae){ return null;}
- }
+ catch(Exception pae){ return null;}
+ }
- /**
- * removes the data directory(seg*) from database home directory and
- * restores it from backup location.
- * This function gets called only when any of the folling attributes
- * are specified on connection URL:
- * Attribute.CREATE_FROM (Create database from backup if it does not exist)
- * Attribute.RESTORE_FROM (Delete the whole database if it exists and
+ /**
+ * removes the data directory(seg*) from database home directory and
+ * restores it from backup location.
+ * This function gets called only when any of the folling attributes
+ * are specified on connection URL:
+ * Attribute.CREATE_FROM (Create database from backup if it does not exist)
+ * Attribute.RESTORE_FROM (Delete the whole database if it exists and
* then restore * it from backup)
- * Attribute.ROLL_FORWARD_RECOVERY_FROM:(Perform Rollforward Recovery;
- * except for the log directory everthing else is replced by the copy from
- * backup. log files in the backup are copied to the existing online log
+ * Attribute.ROLL_FORWARD_RECOVERY_FROM:(Perform Rollforward Recovery;
+ * except for the log directory everthing else is replced by the copy from
+ * backup. log files in the backup are copied to the existing online log
* directory.
- *
- * In all the cases, data directory(seg*) is replaced by the data directory
- * directory from backup when this function is called.
- */
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
- private void restoreDataDirectory(String backupPath)
+ *
+ * In all the cases, data directory(seg*) is replaced by the data directory
+ * directory from backup when this function is called.
+ */
+ private void restoreDataDirectory(String backupPath)
throws StandardException
- {
+ {
// Root dir of backup db
final File backupRoot = new java.io.File(backupPath);
@@ -2652,12 +2582,7 @@ public class BaseDataFileFactory
* This will fail with a security exception unless the database engine
* and all its callers have permission to read the backup directory.
*/
- String[] bfilelist = AccessController.doPrivileged(
- new PrivilegedAction<String[]>() {
- public String[] run() {
- return backupRoot.list();
- }
- });
+ String[] bfilelist = backupRoot.list();
if(bfilelist !=null)
{
boolean segmentexist = false;
@@ -2668,22 +2593,10 @@ public class BaseDataFileFactory
{
// Segment directory in the backup
final File bsegdir = new File(backupRoot , bfilelist[i]);
- boolean bsegdirExists = (
- AccessController.doPrivileged(
- new PrivilegedAction<Boolean>() {
- public Boolean run() {
- return Boolean.valueOf(bsegdir.exists());
- }
- })).booleanValue();
+ boolean bsegdirExists = Boolean.valueOf(bsegdir.exists());
if (bsegdirExists) {
// Make sure the file object points at a directory.
- boolean isDirectory = (
- AccessController.doPrivileged(
- new PrivilegedAction<Boolean>() {
- public Boolean run() {
- return Boolean.valueOf(bsegdir.isDirectory());
- }
- })).booleanValue();
+ boolean isDirectory = Boolean.valueOf(bsegdir.isDirectory());
if (isDirectory) {
segmentexist = true;
break;
@@ -2695,15 +2608,15 @@ public class BaseDataFileFactory
if(!segmentexist)
{
throw
- StandardException.newException(
- SQLState.DATA_DIRECTORY_NOT_FOUND_IN_BACKUP, backupRoot);
+ StandardException.newException(
+ SQLState.DATA_DIRECTORY_NOT_FOUND_IN_BACKUP, backupRoot);
}
}
else
{
throw StandardException.newException(
- SQLState.DATA_DIRECTORY_NOT_FOUND_IN_BACKUP, backupRoot);
+ SQLState.DATA_DIRECTORY_NOT_FOUND_IN_BACKUP, backupRoot);
}
synchronized (this)
@@ -2713,11 +2626,12 @@ public class BaseDataFileFactory
this.bfilelist = bfilelist;
try
{
- AccessController.doPrivileged( this);
+ run();
}
- catch (PrivilegedActionException pae)
- {
- throw (StandardException) pae.getException();
+ catch (IOException pae)
+ {
+ // should never happen
+ throw StandardException.plainWrapException(pae);
}
finally
{
@@ -2806,27 +2720,13 @@ public class BaseDataFileFactory
}
/** Return true if the Lucene plugin is loaded */
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
public boolean luceneLoaded()
throws StandardException
{
- try {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction<Boolean>()
- {
- public Boolean run()
- {
- StorageFactory storageFactory = getStorageFactory();
- StorageFile luceneDir = storageFactory.newStorageFile( Database.LUCENE_DIR );
-
- return luceneDir.exists();
- }
- }
- ).booleanValue();
- }
- catch (PrivilegedActionException pae) { throw StandardException.plainWrapException( pae ); }
+ StorageFactory storageFactory = getStorageFactory();
+ StorageFile luceneDir = storageFactory.newStorageFile( Database.LUCENE_DIR );
+
+ return luceneDir.exists();
}
/**
@@ -3024,59 +2924,29 @@ public class BaseDataFileFactory
} // end of run
/**
- * Privileged Monitor lookup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static ModuleFactory getMonitor()
{
- return AccessController.doPrivileged
- (
- new PrivilegedAction<ModuleFactory>()
- {
- public ModuleFactory run()
- {
- return Monitor.getMonitor();
- }
- }
- );
+ return Monitor.getMonitor();
}
/**
- * Privileged startup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object startSystemModule( final String factoryInterface )
throws StandardException
{
- try {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction<Object>()
- {
- public Object run()
- throws StandardException
- {
- return Monitor.startSystemModule( factoryInterface );
- }
- }
- );
- } catch (PrivilegedActionException pae)
- {
- throw StandardException.plainWrapException( pae );
- }
+ return Monitor.startSystemModule( factoryInterface );
}
/**
- * Privileged startup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object bootServiceModule
(
final boolean create, final Object serviceModule,
@@ -3084,22 +2954,7 @@ public class BaseDataFileFactory
)
throws StandardException
{
- try {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction<Object>()
- {
- public Object run()
- throws StandardException
- {
- return Monitor.bootServiceModule( create, serviceModule, factoryInterface, properties );
- }
- }
- );
- } catch (PrivilegedActionException pae)
- {
- throw StandardException.plainWrapException( pae );
- }
+ return Monitor.bootServiceModule( create, serviceModule, factoryInterface, properties );
}
}
Modified: db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/D_DiagnosticUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/D_DiagnosticUtil.java?rev=1900040&r1=1900039&r2=1900040&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/D_DiagnosticUtil.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/D_DiagnosticUtil.java Tue Apr 19 14:49:30 2022
@@ -21,11 +21,6 @@
package org.apache.derby.impl.store.raw.data;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
import org.apache.derby.iapi.services.context.ContextService;
import org.apache.derby.iapi.services.diag.Diagnosticable;
import org.apache.derby.iapi.services.diag.DiagnosticUtil;
@@ -441,70 +436,31 @@ public class D_DiagnosticUtil
}
/**
- * Privileged startup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object findServiceModule( final Object serviceModule, final String factoryInterface)
throws StandardException
{
- try {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction<Object>()
- {
- public Object run()
- throws StandardException
- {
- return Monitor.findServiceModule( serviceModule, factoryInterface );
- }
- }
- );
- } catch (PrivilegedActionException pae)
- {
- throw StandardException.plainWrapException( pae );
- }
+ return Monitor.findServiceModule( serviceModule, factoryInterface );
}
/**
- * Privileged module lookup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object getServiceModule( final Object serviceModule, final String factoryInterface )
{
- return AccessController.doPrivileged
- (
- new PrivilegedAction<Object>()
- {
- public Object run()
- {
- return Monitor.getServiceModule( serviceModule, factoryInterface );
- }
- }
- );
+ return Monitor.getServiceModule( serviceModule, factoryInterface );
}
/**
- * Privileged service lookup. Must be private so that user code
+ * Must be private so that user code
* can't call this entry point.
*/
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private static Object findService( final String factoryInterface, final String serviceName )
{
- return AccessController.doPrivileged
- (
- new PrivilegedAction<Object>()
- {
- public Object run()
- {
- return Monitor.findService( factoryInterface, serviceName );
- }
- }
- );
+ return Monitor.findService( factoryInterface, serviceName );
}
}
Modified: db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/EncryptOrDecryptData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/EncryptOrDecryptData.java?rev=1900040&r1=1900039&r2=1900040&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/EncryptOrDecryptData.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.engine/org/apache/derby/impl/store/raw/data/EncryptOrDecryptData.java Tue Apr 19 14:49:30 2022
@@ -33,8 +33,6 @@ import org.apache.derby.iapi.store.acces
import org.apache.derby.io.StorageFactory;
import org.apache.derby.io.StorageFile;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
/**
@@ -58,7 +56,7 @@ import java.security.PrivilegedAction;
* after a successful checkpoint with a new key or on a rollback.
*/
-public class EncryptOrDecryptData implements PrivilegedAction<Boolean> {
+public class EncryptOrDecryptData {
private BaseDataFileFactory dataFactory;
private StorageFactory storageFactory;
@@ -363,44 +361,36 @@ public class EncryptOrDecryptData implem
}
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privExists(StorageFile file)
{
actionCode = STORAGE_FILE_EXISTS_ACTION;
actionStorageFile = file;
- Boolean ret = AccessController.doPrivileged(this);
+ Boolean ret = run();
actionStorageFile = null;
return ret.booleanValue();
}
-
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privDelete(StorageFile file)
{
actionCode = STORAGE_FILE_DELETE_ACTION;
actionStorageFile = file;
- Boolean ret = AccessController.doPrivileged(this);
+ Boolean ret = run();
actionStorageFile = null;
return ret.booleanValue();
}
- // AccessController.doPrivileged() deprecated for removal by JEP 411 https://openjdk.java.net/jeps/411
- @SuppressWarnings("removal")
private synchronized boolean privRename(StorageFile fromFile,
StorageFile destFile)
{
actionCode = STORAGE_FILE_RENAME_ACTION;
actionStorageFile = fromFile;
actionDestStorageFile = destFile;
- Boolean ret = AccessController.doPrivileged(this);
+ Boolean ret = run();
actionStorageFile = null;
actionDestStorageFile = null;
return ret.booleanValue();
-
}