Changeset 707f616


Ignore:
Timestamp:
Nov 28, 2013 11:10:57 AM (6 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
0ff423f, aa4b4b9, f112baa
Parents:
c0ef19a
Message:

Changes from -rc diff review

Files:
22 edited

Legend:

Unmodified
Added
Removed
  • apps/BOB/src/net/i2p/BOB/TCPtoI2P.java

    rc0ef19a r707f616  
    7171         */
    7272        private static String lnRead(InputStream in) throws IOException {
    73                 String S = "";
    74         StringBuilder builder = new StringBuilder();
     73                StringBuilder builder = new StringBuilder();
    7574                int b;
    7675                char c;
     
    8786                        }
    8887                        c = (char) (b & 0x7f); // We only care about ASCII
    89             builder.append(c);
     88                        builder.append(c);
    9089                }
    9190                return builder.toString();
  • apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java

    rc0ef19a r707f616  
    66import java.util.Collections;
    77import java.util.HashMap;
    8 import java.util.Iterator;
    98import java.util.List;
    109import java.util.Map;
     
    217216            Properties opts = _context.getProperties();
    218217            if (_opts != null) {
    219                 for (Iterator<String> iter = _opts.keySet().iterator(); iter.hasNext(); ) {
    220                     String key = iter.next();
    221                     opts.setProperty(key, _opts.get(key).toString());
    222                 }
     218                for (Map.Entry<String, String> entry : _opts.entrySet() )
     219                    opts.setProperty(entry.getKey(), entry.getValue());
    223220            }
    224221            if (opts.getProperty("inbound.nickname") == null)
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    rc0ef19a r707f616  
    1515import java.util.HashMap;
    1616import java.util.HashSet;
    17 import java.util.Iterator;
    1817import java.util.List;
    1918import java.util.Map;
     
    16881687        existingNames.removeAll(_magnets);
    16891688        // now lets see which ones have been removed...
    1690         for (Iterator<String> iter = existingNames.iterator(); iter.hasNext(); ) {
    1691             String name = iter.next();
     1689        for (String name : existingNames) {
    16921690            if (foundNames.contains(name)) {
    16931691                // known and still there.  noop
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java

    rc0ef19a r707f616  
    205205                        _log.warn("Refusing POST since peer is throttled: " + peerHash.toBase64());
    206206                    try {
    207                         // Send a 503, so the user doesn't get an HTTP Proxy error message
     207                        // Send a 403, so the user doesn't get an HTTP Proxy error message
    208208                        // and blame his router or the network.
    209209                        socket.getOutputStream().write(ERR_DENIED);
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java

    rc0ef19a r707f616  
    88import java.io.IOException;
    99import java.util.ArrayList;
    10 import java.util.Iterator;
    1110import java.util.List;
    1211
     
    138137            }
    139138            br.close();
    140             for (Iterator<PingHandler> it = pingHandlers.iterator(); it.hasNext();) {
    141                 Thread t = (Thread) it.next();
     139            for (Thread t : pingHandlers)
    142140                t.join();
    143             }
    144141            return;
    145142        } else {
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java

    rc0ef19a r707f616  
    22
    33import java.io.File;
    4 import java.util.Iterator;
    54import java.util.Map;
    65import java.util.Set;
     
    5958         // user themes
    6059         Set<String> props = _context.getPropertyNames();
    61          for (Iterator<String> iter = props.iterator(); iter.hasNext(); ) {
    62               String prop = iter.next();
     60         for (String prop : props) {
    6361              if (prop.startsWith(PROP_THEME_PFX) && prop.length() > PROP_THEME_PFX.length())
    6462                  rv.add(prop.substring(PROP_THEME_PFX.length()));
  • apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java

    rc0ef19a r707f616  
    55import java.util.Comparator;
    66import java.util.HashMap;
    7 import java.util.Iterator;
    87import java.util.List;
    98import java.util.Map;
     
    145144            boolean hasTx = false;
    146145            boolean hasRx = false;
    147             for (Iterator<SummaryListener> iter = ordered.iterator(); iter.hasNext(); ) {
    148                 SummaryListener lsnr = iter.next();
     146            for (SummaryListener lsnr : ordered) {
    149147                String title = lsnr.getRate().getRateStat().getName();
    150148                if (title.equals("bw.sendRate")) hasTx = true;
     
    167165            }
    168166           
    169             for (Iterator<SummaryListener> iter = ordered.iterator(); iter.hasNext(); ) {
    170                 SummaryListener lsnr = iter.next();
     167            for (SummaryListener lsnr : ordered) {
    171168                Rate r = lsnr.getRate();
    172169                // e.g. "statname for 60m"
  • apps/streaming/java/src/net/i2p/client/streaming/Connection.java

    rc0ef19a r707f616  
    611611        _connectionError = "Connection reset";
    612612        synchronized (_connectLock) { _connectLock.notifyAll(); }
    613         // RFC 793 end of setion 3.4: We are completely done.
     613        // RFC 793 end of section 3.4: We are completely done.
    614614        disconnectComplete();
    615615    }
  • apps/susimail/src/src/i2p/susi/webmail/RequestWrapper.java

    rc0ef19a r707f616  
    2929import java.util.Hashtable;
    3030import java.util.Locale;
     31import java.util.Map;
    3132
    3233import javax.servlet.http.HttpServletRequest;
     
    135136                if( multiPartRequest != null ) {
    136137                        Hashtable<String, String> params = multiPartRequest.getParams( partName );
    137                         for( Enumeration<String> e = params.keys(); e.hasMoreElements(); ) {
    138                                 String key = e.nextElement();
     138                        for( Map.Entry<String, String> e : params.entrySet() ) {
     139                                String key = e.getKey();
    139140                                if( key.toLowerCase(Locale.US).compareToIgnoreCase( "content-type") == 0 ) {
    140                                         String value = (String)params.get( key );
     141                                        String value = e.getValue();
    141142                                        int i = value.indexOf( ";" );
    142143                                        if( i != -1 )
  • core/java/src/com/nettgryppa/security/HashCash.java

    rc0ef19a r707f616  
    339339   
    340340    for(Map.Entry<String, List<String>> entry: extensions.entrySet()) {
    341         String key = entry.getKey();
     341      String key = entry.getKey();
    342342      if(key.contains(":") || key.contains(";") || key.contains("="))
    343343          throw new IllegalArgumentException("Extension key contains an illegal character. " + key);
  • core/java/src/net/i2p/client/I2PSessionImpl2.java

    rc0ef19a r707f616  
    524524            return;
    525525        synchronized (_sendingStates) {
    526             for (Iterator<MessageState> iter = _sendingStates.iterator(); iter.hasNext();) {
    527                 MessageState state = iter.next();
     526            for (MessageState state : _sendingStates)
    528527                state.cancel();
    529             }
    530528            if (_log.shouldLog(Log.INFO)) _log.info(getPrefix() + "Disconnecting " + _sendingStates.size() + " states");
    531529            _sendingStates.clear();
  • core/java/src/net/i2p/client/MessageState.java

    rc0ef19a r707f616  
    22
    33import java.util.HashSet;
    4 import java.util.Iterator;
    54import java.util.Set;
    65import java.util.concurrent.atomic.AtomicLong;
     
    151150        if (_log.shouldLog(Log.DEBUG))
    152151            _log.debug(_prefix + "isSuccess(" + wantedStatus + "): " + _receivedStatus);
    153         for (Iterator<Integer> iter = _receivedStatus.iterator(); iter.hasNext();) {
    154             Integer val = iter.next();
     152        for (Integer val : _receivedStatus) {
    155153            int recv = val.intValue();
    156154            switch (recv) {
     
    211209            _log.debug(_prefix + "isFailure(" + wantedStatus + "): " + _receivedStatus);
    212210       
    213         for (Iterator<Integer> iter = _receivedStatus.iterator(); iter.hasNext();) {
    214             Integer val = iter.next();
     211        for (Integer val : _receivedStatus) {
    215212            int recv = val.intValue();
    216213            switch (recv) {
  • core/java/src/net/i2p/crypto/ElGamalAESEngine.java

    rc0ef19a r707f616  
    1313import java.util.Collections;
    1414import java.util.HashSet;
    15 import java.util.Iterator;
    1615import java.util.List;
    1716import java.util.Set;
     
    657656        DataHelper.toLong(aesData, cur, 2, tagsForDelivery.size());
    658657        cur += 2;
    659         for (Iterator<SessionTag> iter = tagsForDelivery.iterator(); iter.hasNext();) {
    660             SessionTag tag = iter.next();
     658        for (SessionTag tag : tagsForDelivery) {
    661659            System.arraycopy(tag.getData(), 0, aesData, cur, SessionTag.BYTE_LENGTH);
    662660            cur += SessionTag.BYTE_LENGTH;
  • core/java/src/net/i2p/crypto/KeyStoreUtil.java

    rc0ef19a r707f616  
    267267     *
    268268     *  @return success
    269      *  @since 0.8.3, consolidated from RouterConsoleRUnner and SSLClientListenerRunner in 0.9.9
     269     *  @since 0.8.3, consolidated from RouterConsoleRunner and SSLClientListenerRunner in 0.9.9
    270270     */
    271271    public static boolean createKeys(File ks, String alias, String cname, String ou,
     
    291291     *
    292292     *  @return success
    293      *  @since 0.8.3, consolidated from RouterConsoleRUnner and SSLClientListenerRunner in 0.9.9
     293     *  @since 0.8.3, consolidated from RouterConsoleRunner and SSLClientListenerRunner in 0.9.9
    294294     */
    295295    public static boolean createKeys(File ks, String ksPW, String alias, String cname, String ou,
  • core/java/src/net/i2p/data/LeaseSet.java

    rc0ef19a r707f616  
    1616import java.io.OutputStream;
    1717import java.util.ArrayList;
    18 import java.util.Iterator;
    1918import java.util.List;
    2019
     
    291290            DataHelper.writeLong(out, 1, _leases.size());
    292291            //DataHelper.writeLong(out, 4, _version);
    293             for (Iterator<Lease> iter = _leases.iterator(); iter.hasNext();) {
    294                 Lease lease = iter.next();
     292            for (Lease lease : _leases)
    295293                lease.writeBytes(out);
    296             }
    297294        } catch (IOException ioe) {
    298295            return null;
     
    340337        DataHelper.writeLong(out, 1, _leases.size());
    341338        //DataHelper.writeLong(out, 4, _version);
    342         for (Iterator<Lease> iter = _leases.iterator(); iter.hasNext();) {
    343             Lease lease = iter.next();
     339        for (Lease lease : _leases)
    344340            lease.writeBytes(out);
    345         }
    346341        _signature.writeBytes(out);
    347342    }
  • core/java/src/net/i2p/util/I2PAppThread.java

    rc0ef19a r707f616  
    1111
    1212
    13 import java.util.Iterator;
    1413import java.util.Set;
    1514import java.util.concurrent.CopyOnWriteArraySet;
     
    4645    @Override
    4746    protected void fireOOM(OutOfMemoryError oom) {
    48         for (Iterator<OOMEventListener> iter = _threadListeners.iterator(); iter.hasNext(); ) {
    49             OOMEventListener listener = iter.next();
     47        for (OOMEventListener listener : _threadListeners)
    5048            listener.outOfMemory(oom);
    51         }
    5249    }
    5350
  • core/java/src/net/i2p/util/I2PThread.java

    rc0ef19a r707f616  
    1111
    1212
    13 import java.util.Iterator;
    1413import java.util.Set;
    1514import java.util.concurrent.CopyOnWriteArraySet;
     
    113112   
    114113    protected void fireOOM(OutOfMemoryError oom) {
    115         for (Iterator<OOMEventListener> iter = _listeners.iterator(); iter.hasNext(); ) {
    116             OOMEventListener listener = iter.next();
     114        for (OOMEventListener listener : _listeners)
    117115            listener.outOfMemory(oom);
    118         }
    119116    }
    120117
  • router/java/src/net/i2p/router/RouterVersion.java

    rc0ef19a r707f616  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 34;
     21    public final static long BUILD = 35;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/networkdb/kademlia/ExploreKeySelectorJob.java

    rc0ef19a r707f616  
    1010
    1111import java.util.HashSet;
    12 import java.util.Iterator;
    1312import java.util.Set;
    1413
     
    6362            if (bucket.getKeyCount() < KBucketSet.BUCKET_SIZE) {
    6463                boolean already = false;
    65                 for (Iterator<Hash> iter = alreadyQueued.iterator(); iter.hasNext(); ) {
    66                     Hash key = iter.next();
     64                for (Hash key : alreadyQueued) {
    6765                    if (bucket.shouldContain(key)) {
    6866                        already = true;
  • router/java/src/net/i2p/router/networkdb/kademlia/HarvesterJob.java

    rc0ef19a r707f616  
    22
    33import java.util.ArrayList;
    4 import java.util.Iterator;
    54import java.util.List;
    65import java.util.Map;
     
    5958        if (shouldHarvest()) {
    6059            List<Hash> peers = selectPeersToUpdate();
    61             for (int i = 0; i < peers.size(); i++) {
    62                 Hash peer= peers.get(i);
     60            for (Hash peer : peers)
    6361                harvest(peer);
    64             }
    6562        }
    6663        requeue(REQUEUE_DELAY);
     
    8077        Set<Hash> peers = _facade.getAllRouters();
    8178        long now = getContext().clock().now();
    82         for (Iterator<Hash> iter = peers.iterator(); iter.hasNext(); ) {
    83             Hash peer = iter.next();
     79        for (Hash peer : peers) {
    8480            RouterInfo info = _facade.lookupRouterInfoLocally(peer);
    8581            if (info != null) {
     
    9793        // entries
    9894        List<Hash> rv = new ArrayList<Hash>();
    99         for (Iterator<Hash> iter = routersByAge.values().iterator(); iter.hasNext(); ) {
    100             Hash peer = iter.next();
     95        for (Hash peer : routersByAge.values()) {
    10196            rv.add(peer);
    10297            if (rv.size() >= MAX_PER_RUN)
  • router/java/src/net/i2p/router/networkdb/kademlia/SearchJob.java

    rc0ef19a r707f616  
    1111import java.util.ArrayList;
    1212import java.util.Collections;
    13 import java.util.Iterator;
    1413import java.util.List;
    1514import java.util.Set;
     
    291290            } else {
    292291                attempted.addAll(closestHashes);
    293                 for (Iterator<Hash> iter = closestHashes.iterator(); iter.hasNext(); ) {
    294                     Hash peer = iter.next();
     292                for (Hash peer : closestHashes) {
    295293                    DatabaseEntry ds = _facade.getDataStore().get(peer);
    296294                    if (ds == null) {
     
    631629            sendTo.addAll(_state.getPending());
    632630            int numSent = 0;
    633             for (Iterator<Hash> iter = sendTo.iterator(); iter.hasNext(); ) {
    634                 Hash peer = iter.next();
     631            for (Hash peer : sendTo) {
    635632                RouterInfo peerInfo = _facade.lookupRouterInfoLocally(peer);
    636633                if (peerInfo == null) continue;
  • router/java/src/net/i2p/router/peermanager/PeerTestJob.java

    rc0ef19a r707f616  
    22
    33import java.util.HashSet;
    4 import java.util.Iterator;
    54import java.util.List;
    65import java.util.Set;
     
    7473            _log.debug("Testing " + peers.size() + " peers");
    7574       
    76         for (Iterator<RouterInfo> iter = peers.iterator(); iter.hasNext(); ) {
    77             RouterInfo peer = iter.next();
     75        for (RouterInfo peer : peers) {
    7876            if (_log.shouldLog(Log.DEBUG))
    7977                _log.debug("Testing peer " + peer.getIdentity().getHash().toBase64());
     
    9997       
    10098        Set<RouterInfo> peers = new HashSet<RouterInfo>(peerHashes.size());
    101         for (Iterator<Hash> iter = peerHashes.iterator(); iter.hasNext(); ) {
    102             Hash peer = iter.next();
     99        for (Hash peer : peerHashes) {
    103100            RouterInfo peerInfo = getContext().netDb().lookupRouterInfoLocally(peer);
    104101            if (peerInfo != null) {
Note: See TracChangeset for help on using the changeset viewer.