Changeset 0c5d88d


Ignore:
Timestamp:
Jan 10, 2011 3:46:13 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f15ad23
Parents:
f68c0952
Message:

findbugs router, router/client

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

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/Blocklist.java

    rf68c0952 r0c5d88d  
    680680        Job job = new ShitlistJob(peer);
    681681        if (number > 0)
    682             job.getTiming().setStartAfter(_context.clock().now() + (number * 30*1000));
     682            job.getTiming().setStartAfter(_context.clock().now() + (30*1000l * number));
    683683        _context.jobQueue().addJob(job);
    684684    }
  • router/java/src/net/i2p/router/JobQueue.java

    rf68c0952 r0c5d88d  
    209209     */
    210210    public boolean isJobActive(Job job) {
    211         if (_readyJobs.contains(job) | _timedJobs.contains(job))
     211        if (_readyJobs.contains(job) || _timedJobs.contains(job))
    212212            return true;
    213213        for (JobQueueRunner runner: _queueRunners.values())
     
    690690        for (int i = 0; i < timedJobs.size(); i++) {
    691691            Job j = timedJobs.get(i);
    692             ordered.put(new Long(j.getTiming().getStartAfter()), j);
     692            ordered.put(Long.valueOf(j.getTiming().getStartAfter()), j);
    693693        }
    694694        for (Iterator<Job> iter = ordered.values().iterator(); iter.hasNext(); ) {
  • router/java/src/net/i2p/router/MultiRouter.java

    rf68c0952 r0c5d88d  
    9191    private static Properties getEnv(String filename) {
    9292        Properties props = new Properties();
     93        FileInputStream in = null;
    9394        try {
    94             props.load(new FileInputStream(filename));
     95            in = new FileInputStream(filename);
     96            props.load(in);
    9597            props.setProperty("time.disabled", "true");
    9698            return props;
     
    98100            ioe.printStackTrace();
    99101            return null;
     102        } finally {
     103            if (in != null) try { in.close(); } catch (IOException ioe) {}
    100104        }
    101105    }
  • router/java/src/net/i2p/router/OutNetMessage.java

    rf68c0952 r0c5d88d  
    9090            synchronized (this) {
    9191                locked_initTimestamps();
    92                 while (_timestamps.containsKey(eventName)) {
    93                     eventName = eventName + '.';
    94                 }
    95                 _timestamps.put(eventName, new Long(now));
     92                // ???
     93                //while (_timestamps.containsKey(eventName)) {
     94                //    eventName = eventName + '.';
     95                //}
     96                _timestamps.put(eventName, Long.valueOf(now));
    9697                _timestampOrder.add(eventName);
    9798            }
     
    99100        return now - _created;
    100101    }
     102
     103    /** @deprecated unused */
    101104    public Map<String, Long> getTimestamps() {
    102105        if (_log.shouldLog(Log.INFO)) {
     
    108111        return Collections.EMPTY_MAP;
    109112    }
     113
     114    /** @deprecated unused */
    110115    public Long getTimestamp(String eventName) {
    111116        if (_log.shouldLog(Log.INFO)) {
     
    369374    public boolean equals(Object obj) {
    370375        if(obj == null) return false;
    371         if(obj.getClass() != OutNetMessage.class) return false;
     376        if(!(obj instanceof OutNetMessage)) return false;
    372377        return obj == this; // two OutNetMessages are different even if they contain the same message
    373378    }
  • router/java/src/net/i2p/router/RouterThrottleImpl.java

    rf68c0952 r0c5d88d  
    9999            return TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
    100100
    101         long lag = _context.jobQueue().getMaxLag();
     101        //long lag = _context.jobQueue().getMaxLag();
    102102        // reject here if lag too high???
    103103       
  • router/java/src/net/i2p/router/StatisticsManager.java

    rf68c0952 r0c5d88d  
    158158    }
    159159   
     160/*****
    160161    private void includeRate(String rateName, Properties stats, long selectedPeriods[]) {
    161162        includeRate(rateName, stats, selectedPeriods, false);
    162163    }
     164*****/
     165
    163166    /**
    164167     * @param fudgeQuantity the data being published in this stat is too sensitive to, uh
     
    259262            buf.append("0;0;0;0;");
    260263        }
    261         long numPeriods = rate.getLifetimePeriods();
    262264        buf.append(num(fudgeQuantity)).append(';');
    263265        return buf.toString();
  • router/java/src/net/i2p/router/client/ClientManager.java

    rf68c0952 r0c5d88d  
    434434    }
    435435   
     436    /** @deprecated unused */
    436437    public void renderStatusHTML(Writer out) throws IOException {
     438/******
    437439        StringBuilder buf = new StringBuilder(8*1024);
    438440        buf.append("<u><b>Local destinations</b></u><br>");
     
    480482        out.write(buf.toString());
    481483        out.flush();
     484******/
    482485    }
    483486   
  • router/java/src/net/i2p/router/client/ClientManagerFacadeImpl.java

    rf68c0952 r0c5d88d  
    208208    }
    209209   
     210    /** @deprecated unused */
    210211    @Override
    211212    public void renderStatusHTML(Writer out) throws IOException {
  • router/java/src/net/i2p/router/client/SSLClientListenerRunner.java

    rf68c0952 r0c5d88d  
    143143        File sdir = new SecureDirectory(_context.getConfigDir(), "certificates");
    144144        if (sdir.exists() || sdir.mkdir()) {
     145            InputStream fis = null;
    145146            try {
    146147                KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
    147                 InputStream fis = new FileInputStream(ks);
     148                fis = new FileInputStream(ks);
    148149                String ksPass = _context.getProperty(PROP_KEYSTORE_PASSWORD, DEFAULT_KEYSTORE_PASSWORD);
    149150                keyStore.load(fis, ksPass.toCharArray());
    150                 fis.close();
    151151                Certificate cert = keyStore.getCertificate(KEY_ALIAS);
    152152                if (cert != null) {
     
    160160            } catch (IOException ioe) {
    161161                _log.error("Error saving ASCII SSL keys", ioe);
     162            } finally {
     163                if (fis != null) try { fis.close(); } catch (IOException ioe) {}
    162164            }
    163165        } else {
     
    209211            return false;
    210212        }
     213        InputStream fis = null;
    211214        try {
    212215            SSLContext sslc = SSLContext.getInstance("TLS");
    213216            KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
    214             InputStream fis = new FileInputStream(ks);
     217            fis = new FileInputStream(ks);
    215218            keyStore.load(fis, ksPass.toCharArray());
    216             fis.close();
    217219            KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
    218220            kmf.init(keyStore, keyPass.toCharArray());
     
    224226        } catch (IOException ioe) {
    225227            _log.error("Error loading SSL keys", ioe);
     228        } finally {
     229            if (fis != null) try { fis.close(); } catch (IOException ioe) {}
    226230        }
    227231        return false;
Note: See TracChangeset for help on using the changeset viewer.