aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1796986 - in /aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal: TransactionLogUtils.java TransactionManagerService.java
Date Wed, 31 May 2017 07:02:44 GMT
Author: cschneider
Date: Wed May 31 07:02:44 2017
New Revision: 1796986

URL: http://svn.apache.org/viewvc?rev=1796986&view=rev
Log:
Fix warnings

Modified:
    aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionLogUtils.java
    aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionManagerService.java

Modified: aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionLogUtils.java
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionLogUtils.java?rev=1796986&r1=1796985&r2=1796986&view=diff
==============================================================================
--- aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionLogUtils.java
(original)
+++ aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionLogUtils.java
Wed May 31 07:02:44 2017
@@ -55,7 +55,6 @@ public class TransactionLogUtils {
      * @param newConfiguration configuration to create new transaction manager
      * @return <code>true</code> if there was conversion performed
      */
-    @SuppressWarnings("unchecked")
     public static boolean copyActiveTransactions(Dictionary<String, Object> oldConfiguration,
Dictionary<String, ?> newConfiguration)
             throws ConfigurationException, IOException {
         boolean initialConfiguration = false;
@@ -230,7 +229,8 @@ public class TransactionLogUtils {
      * @return
      */
     private static BaseTxLogConfig transactionLogFileConfig(File txFile) throws IOException
{
-        FileChannel channel = new RandomAccessFile(txFile, "r").getChannel();
+        RandomAccessFile raf = new RandomAccessFile(txFile, "r");
+        FileChannel channel = raf.getChannel();
         try {
             ByteBuffer bb = ByteBuffer.wrap(new byte[1024]);
             int read = channel.read(bb);
@@ -267,6 +267,7 @@ public class TransactionLogUtils {
             return new BaseTxLogConfig(maxLogFiles, maxBlocksPerFile, bufferSizeKBytes);
         } finally {
             channel.close();
+            raf.close();
         }
     }
 

Modified: aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionManagerService.java
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionManagerService.java?rev=1796986&r1=1796985&r2=1796986&view=diff
==============================================================================
--- aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionManagerService.java
(original)
+++ aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionManagerService.java
Wed May 31 07:02:44 2017
@@ -38,6 +38,7 @@ import org.osgi.service.cm.Configuration
 
 /**
  */
+@SuppressWarnings("rawtypes")
 public class TransactionManagerService {
 
     public static final String TRANSACTION_TIMEOUT = "aries.transaction.timeout";
@@ -65,7 +66,6 @@ public class TransactionManagerService {
 
     @SuppressWarnings("unused")
     private final String pid;
-    @SuppressWarnings("rawtypes")
     private final Dictionary properties;
     private final BundleContext bundleContext;
     private boolean useSpring;
@@ -73,7 +73,7 @@ public class TransactionManagerService {
     private TransactionLog transactionLog;
     private ServiceRegistration<?> serviceRegistration;
 
-    public TransactionManagerService(String pid, @SuppressWarnings("rawtypes") Dictionary
properties, BundleContext bundleContext) throws ConfigurationException {
+    public TransactionManagerService(String pid, Dictionary properties, BundleContext bundleContext)
throws ConfigurationException {
         this.pid = pid;
         this.properties = properties;
         this.bundleContext = bundleContext;



Mime
View raw message