Author: toad
Date: 2009-02-14 01:25:14 +0000 (Sat, 14 Feb 2009)
New Revision: 25637

Modified:
   branches/db4o/freenet/src/freenet/client/FECJob.java
   branches/db4o/freenet/src/freenet/client/FECQueue.java
Log:
Encapsulate codec


Modified: branches/db4o/freenet/src/freenet/client/FECJob.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/FECJob.java        2009-02-14 
01:21:32 UTC (rev 25636)
+++ branches/db4o/freenet/src/freenet/client/FECJob.java        2009-02-14 
01:25:14 UTC (rev 25637)
@@ -16,7 +16,7 @@
  */
 public class FECJob {
        
-       final FECCodec codec;
+       private final FECCodec codec;
        final Bucket[] dataBlocks, checkBlocks;
        final SplitfileBlock[] dataBlockStatus, checkBlockStatus;
        final BucketFactory bucketFactory;
@@ -88,6 +88,10 @@
                this.persistent = persistent;
        }
 
+       public FECCodec getCodec() {
+               return codec;
+       }
+       
        public void activateForExecution(ObjectContainer container) {
                boolean logMINOR = Logger.shouldLog(Logger.MINOR, this);
                if(logMINOR) Logger.minor(this, "Activating FECJob...");

Modified: branches/db4o/freenet/src/freenet/client/FECQueue.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/FECQueue.java      2009-02-14 
01:21:32 UTC (rev 25636)
+++ branches/db4o/freenet/src/freenet/client/FECQueue.java      2009-02-14 
01:25:14 UTC (rev 25637)
@@ -174,10 +174,10 @@
                                        // Encode it
                                        try {
                                                if (job.isADecodingJob)
-                                                       
job.codec.realDecode(job.dataBlockStatus, job.checkBlockStatus, job.blockLength,
+                                                       
job.getCodec().realDecode(job.dataBlockStatus, job.checkBlockStatus, 
job.blockLength,
                                                                
job.bucketFactory);
                                                else {
-                                                       
job.codec.realEncode(job.dataBlocks, job.checkBlocks, job.blockLength, 
job.bucketFactory);
+                                                       
job.getCodec().realEncode(job.dataBlocks, job.checkBlocks, job.blockLength, 
job.bucketFactory);
                                                        // Update 
SplitFileBlocks from buckets if necessary
                                                        if 
((job.dataBlockStatus != null) || (job.checkBlockStatus != null)) {
                                                                for (int i = 0; 
i < job.dataBlocks.length; i++)

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to