Changeset 84990d9


Ignore:
Timestamp:
Feb 17, 2011 10:45:35 AM (9 years ago)
Author:
dev <dev@…>
Branches:
master
Children:
bec1b4a
Parents:
b2433d0
Message:

minor changes

Location:
core/java/src/net/i2p
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/client/datagram/I2PDatagramDissector.java

    rb2433d0 r84990d9  
    3131    private static Log _log = new Log(I2PDatagramDissector.class);
    3232
    33     private static int DGRAM_BUFSIZE = 32768;
    34 
    35     private DSAEngine dsaEng = DSAEngine.getInstance();
    36     private SHA256Generator hashGen = SHA256Generator.getInstance();
     33    private static final int DGRAM_BUFSIZE = 32768;
     34
     35    private final DSAEngine dsaEng = DSAEngine.getInstance();
     36    private final SHA256Generator hashGen = SHA256Generator.getInstance();
    3737
    3838    private Hash rxHash = null;
     
    4242    private Destination rxDest;
    4343
    44     private byte[] rxPayload = new byte[DGRAM_BUFSIZE];
     44    private final byte[] rxPayload = new byte[DGRAM_BUFSIZE];
    4545
    4646    private int rxPayloadLen = 0;
     
    190190            return;
    191191       
    192         if (rxSign == null || rxSign.getData() == null ||
    193             rxDest == null || rxDest.getSigningPublicKey() == null)
     192        if (rxSign == null || rxSign.getData() == null || rxDest == null || rxDest.getSigningPublicKey() == null)
    194193            throw new I2PInvalidDatagramException("Datagram not yet read");
    195194
  • core/java/src/net/i2p/client/datagram/I2PDatagramMaker.java

    rb2433d0 r84990d9  
    2929    private static Log _log = new Log(I2PDatagramMaker.class);
    3030
    31     private static int DGRAM_BUFSIZE = 32768;
     31    private static final int DGRAM_BUFSIZE = 32768;
    3232
    33     private SHA256Generator hashGen = SHA256Generator.getInstance();
    34     private DSAEngine dsaEng = DSAEngine.getInstance();
     33    private final SHA256Generator hashGen = SHA256Generator.getInstance();
     34    private final DSAEngine dsaEng = DSAEngine.getInstance();
    3535
    3636    private SigningPrivateKey sxPrivKey = null;
    3737    private byte[] sxDestBytes = null;
    3838
    39     private ByteArrayOutputStream sxDGram = new ByteArrayOutputStream(DGRAM_BUFSIZE);
     39    private final ByteArrayOutputStream sxDGram = new ByteArrayOutputStream(DGRAM_BUFSIZE);
    4040
    4141    /**
  • core/java/src/net/i2p/internal/QueuedI2CPMessageReader.java

    rb2433d0 r84990d9  
    66
    77/**
    8  * Get messages off an In-JVM queue, zero-copy
     8 * Get messages off an In-JVM queue, zero-copy.
    99 *
    1010 * @author zzz
     
    1414    private final I2CPMessageQueue in;
    1515
     16    /**
     17     * Creates a new instance of this QueuedMessageReader and spawns a pumper thread.
     18     */
    1619    public QueuedI2CPMessageReader(I2CPMessageQueue in, I2CPMessageEventListener lsnr) {
    1720        super(lsnr);
     
    2629            super();
    2730        }
    28 
     31       
     32        /**
     33         * Shuts the pumper down.
     34         */
    2935        @Override
    3036        public void cancelRunner() {
     
    3238            _readerThread.interrupt();
    3339        }
    34 
     40       
     41        /**
     42         * Pumps messages from the incoming message queue to the listener.
     43         */
    3544        @Override
    3645        public void run() {
     
    4756                            _listener.messageReceived(QueuedI2CPMessageReader.this, msg);
    4857                        }
    49                     } catch (InterruptedException ie) {}
     58                    } catch (InterruptedException ie) {
     59                        // hint that we probably should check the continue running flag
     60                    }
    5061                }
    5162                // ??? unused
Note: See TracChangeset for help on using the changeset viewer.