Changeset 4e6ddfc


Ignore:
Timestamp:
Oct 17, 2015 2:01:08 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
9bddba5
Parents:
3411a7c
Message:

lint core

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

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/I2PAppContext.java

    r3411a7c r4e6ddfc  
    8585    private KeyGenerator _keyGenerator;
    8686    protected KeyRing _keyRing; // overridden in RouterContext
     87    @SuppressWarnings("deprecation")
    8788    private SimpleScheduler _simpleScheduler;
    8889    private SimpleTimer _simpleTimer;
     
    533534     */
    534535    @SuppressWarnings({ "unchecked", "rawtypes" })
    535         public Set<String> getPropertyNames() {
     536    public Set<String> getPropertyNames() {
    536537        // clone to avoid ConcurrentModificationException
    537538        Set<String> names = new HashSet<String>((Set<String>) (Set) ((Properties) System.getProperties().clone()).keySet()); // TODO-Java6: s/keySet()/stringPropertyNames()/
     
    941942     * @deprecated in 0.9.20, use simpleTimer2()
    942943     */
     944    @SuppressWarnings("deprecation")
    943945    public SimpleScheduler simpleScheduler() {
    944946        if (!_simpleSchedulerInitialized)
  • core/java/src/net/i2p/client/I2PSession.java

    r3411a7c r4e6ddfc  
    1919import net.i2p.data.PrivateKey;
    2020import net.i2p.data.SessionKey;
     21import net.i2p.data.SessionTag;
    2122import net.i2p.data.SigningPrivateKey;
    2223
     
    99100     * @return success
    100101     */
    101     public boolean sendMessage(Destination dest, byte[] payload, SessionKey keyUsed, Set tagsSent) throws I2PSessionException;
     102    public boolean sendMessage(Destination dest, byte[] payload, SessionKey keyUsed, Set<SessionTag> tagsSent) throws I2PSessionException;
    102103
    103104    /**
     
    107108     * @return success
    108109     */
    109     public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent) throws I2PSessionException;
     110    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent) throws I2PSessionException;
    110111
    111112    /**
     
    117118     * @since 0.7.1
    118119     */
    119     public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent, long expire) throws I2PSessionException;
     120    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expire) throws I2PSessionException;
    120121
    121122    /**
     
    134135     * @since 0.7.1
    135136     */
    136     public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent,
     137    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent,
    137138                               int proto, int fromPort, int toPort) throws I2PSessionException;
    138139
     
    153154     * @since 0.7.1
    154155     */
    155     public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent, long expire,
     156    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expire,
    156157                               int proto, int fromPort, int toPort) throws I2PSessionException;
    157158
     
    172173     * @since 0.8.4
    173174     */
    174     public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent, long expire,
     175    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expire,
    175176                               int proto, int fromPort, int toPort, int flags) throws I2PSessionException;
    176177
  • core/java/src/net/i2p/client/impl/I2CPMessageProducer.java

    r3411a7c r4e6ddfc  
    133133     */
    134134    public void sendMessage(I2PSessionImpl session, Destination dest, long nonce, byte[] payload, SessionTag tag,
    135                             SessionKey key, Set tags, SessionKey newKey, long expires) throws I2PSessionException {
     135                            SessionKey key, Set<SessionTag> tags, SessionKey newKey, long expires) throws I2PSessionException {
    136136        sendMessage(session, dest, nonce, payload, expires, 0);
    137137    }
  • core/java/src/net/i2p/client/impl/I2PSessionImpl2.java

    r3411a7c r4e6ddfc  
    3030import net.i2p.data.Destination;
    3131import net.i2p.data.SessionKey;
     32import net.i2p.data.SessionTag;
    3233import net.i2p.data.i2cp.MessageId;
    3334import net.i2p.data.i2cp.MessageStatusMessage;
     
    211212    }
    212213    /** @throws UnsupportedOperationException always, use MuxedImpl */
    213     public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent,
     214    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent,
    214215                               int proto, int fromport, int toport) throws I2PSessionException {
    215216        throw new UnsupportedOperationException("Use MuxedImpl");
    216217    }
    217218    /** @throws UnsupportedOperationException always, use MuxedImpl */
    218     public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent, long expire,
     219    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expire,
    219220                               int proto, int fromport, int toport) throws I2PSessionException {
    220221        throw new UnsupportedOperationException("Use MuxedImpl");
    221222    }
    222223    /** @throws UnsupportedOperationException always, use MuxedImpl */
    223     public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent, long expire,
     224    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expire,
    224225                               int proto, int fromport, int toport, int flags) throws I2PSessionException {
    225226        throw new UnsupportedOperationException("Use MuxedImpl");
     
    254255     */
    255256    @Override
    256     public boolean sendMessage(Destination dest, byte[] payload, SessionKey keyUsed, Set tagsSent) throws I2PSessionException {
     257    public boolean sendMessage(Destination dest, byte[] payload, SessionKey keyUsed, Set<SessionTag> tagsSent) throws I2PSessionException {
    257258        return sendMessage(dest, payload, 0, payload.length, keyUsed, tagsSent, 0);
    258259    }
     
    262263     * @param tagsSent unused - no end-to-end crypto
    263264     */
    264     public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent)
     265    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent)
    265266                   throws I2PSessionException {
    266267        return sendMessage(dest, payload, offset, size, keyUsed, tagsSent, 0);
     
    273274     * @param tagsSent unused - no end-to-end crypto
    274275     */
    275     public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent, long expires)
     276    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expires)
    276277                   throws I2PSessionException {
    277278        if (_log.shouldLog(Log.DEBUG)) _log.debug("sending message");
     
    340341     * @param tagsSent unused - no end-to-end crypto
    341342     */
    342     protected boolean sendBestEffort(Destination dest, byte payload[], SessionKey keyUsed, Set tagsSent, long expires)
     343    protected boolean sendBestEffort(Destination dest, byte payload[], SessionKey keyUsed, Set<SessionTag> tagsSent, long expires)
    343344                    throws I2PSessionException {
    344345        return sendBestEffort(dest, payload, expires, 0);
  • core/java/src/net/i2p/client/impl/I2PSessionMuxedImpl.java

    r3411a7c r4e6ddfc  
    2020import net.i2p.data.Destination;
    2121import net.i2p.data.SessionKey;
     22import net.i2p.data.SessionTag;
    2223import net.i2p.data.i2cp.MessagePayloadMessage;
    2324import net.i2p.util.Log;
     
    164165    @Override
    165166    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size,
    166                                SessionKey keyUsed, Set tagsSent, long expires)
     167                               SessionKey keyUsed, Set<SessionTag> tagsSent, long expires)
    167168                   throws I2PSessionException {
    168169        return sendMessage(dest, payload, offset, size, keyUsed, tagsSent, 0, PROTO_UNSPECIFIED, PORT_UNSPECIFIED, PORT_UNSPECIFIED);
     
    174175     */
    175176    @Override
    176     public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set tagsSent,
     177    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent,
    177178                               int proto, int fromport, int toport) throws I2PSessionException {
    178179        return sendMessage(dest, payload, offset, size, keyUsed, tagsSent, 0, proto, fromport, toport);
     
    193194    @Override
    194195    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size,
    195                                SessionKey keyUsed, Set tagsSent, long expires,
     196                               SessionKey keyUsed, Set<SessionTag> tagsSent, long expires,
    196197                               int proto, int fromPort, int toPort)
    197198                   throws I2PSessionException {
     
    214215    @Override
    215216    public boolean sendMessage(Destination dest, byte[] payload, int offset, int size,
    216                                SessionKey keyUsed, Set tagsSent, long expires,
     217                               SessionKey keyUsed, Set<SessionTag> tagsSent, long expires,
    217218                               int proto, int fromPort, int toPort, int flags)
    218219                   throws I2PSessionException {
  • core/java/src/net/i2p/client/naming/NamingService.java

    r3411a7c r4e6ddfc  
    537537        try {
    538538            Class<?> cls = Class.forName(impl);
    539             Constructor<?> con = cls.getConstructor(new Class[] { I2PAppContext.class });
     539            Constructor<?> con = cls.getConstructor(I2PAppContext.class);
    540540            instance = (NamingService)con.newInstance(new Object[] { context });
    541541        } catch (Exception ex) {
  • core/java/src/net/i2p/data/SDSCache.java

    r3411a7c r4e6ddfc  
    4747    //private static final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(SDSCache.class);
    4848
    49     private static final Class[] conArg = new Class[] { byte[].class };
    5049    private static final double MIN_FACTOR = 0.20;
    5150    private static final double MAX_FACTOR = 5.0;
     
    7574        _datalen = len;
    7675        try {
    77             _rvCon = rvClass.getConstructor(conArg);
     76            _rvCon = rvClass.getConstructor(byte[].class);
    7877        } catch (NoSuchMethodException e) {
    7978            throw new RuntimeException("SDSCache init error", e);
  • core/java/src/net/i2p/util/PortMapper.java

    r3411a7c r4e6ddfc  
    112112     */
    113113    public void renderStatusHTML(Writer out) throws IOException {
    114         List<String> services = new ArrayList(_dir.keySet());
     114        List<String> services = new ArrayList<String>(_dir.keySet());
    115115        out.write("<h2>Port Mapper</h2><table><tr><th>Service<th>Host<th>Port\n");
    116116        Collections.sort(services);
  • core/java/src/net/i2p/util/SimpleTimer2.java

    r3411a7c r4e6ddfc  
    123123    }
    124124
    125     private ScheduledFuture schedule(TimedEvent t, long timeoutMs) {
     125    private ScheduledFuture<?> schedule(TimedEvent t, long timeoutMs) {
    126126        return _executor.schedule(t, timeoutMs, TimeUnit.MILLISECONDS);
    127127    }
     
    249249        private int _fuzz;
    250250        protected static final int DEFAULT_FUZZ = 3;
    251         private ScheduledFuture _future; // _executor.remove() doesn't work so we have to use this
     251        private ScheduledFuture<?> _future; // _executor.remove() doesn't work so we have to use this
    252252                                         // ... and I expect cancelling this way is more efficient
    253253
Note: See TracChangeset for help on using the changeset viewer.