Changeset 9bddba5


Ignore:
Timestamp:
Oct 17, 2015 2:38:02 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
5f175455
Parents:
4e6ddfc
Message:

lint router

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

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/data/router/RouterInfo.java

    r4e6ddfc r9bddba5  
    340340                    // network-wide. The signature is not checked at readin time, but only
    341341                    // later, and the hashes are stored in a Set, not a List.
    342                     peers = (Collection<Hash>) SortHelper.sortStructures(peers);
     342                    peers = SortHelper.sortStructures(peers);
    343343                for (Hash peerHash : peers) {
    344344                    peerHash.writeBytes(out);
  • router/java/src/net/i2p/data/router/SortHelper.java

    r4e6ddfc r9bddba5  
    3232     *  it cannot be changed.
    3333     *  Why? Just because it has to be consistent so signing will work.
    34      *  How to spec as returning the same type as the param?
    3534     *  DEPRECATED - Only used by RouterInfo.
    3635     *
    3736     *  @return a new list
    3837     */
    39     public static List<? extends DataStructure> sortStructures(Collection<? extends DataStructure> dataStructures) {
     38    public static <T extends DataStructure> List<T> sortStructures(Collection<T> dataStructures) {
    4039        if (dataStructures == null) return Collections.emptyList();
    4140
     
    5352        //    rv.add(struct);
    5453        //}
    55         ArrayList<DataStructure> rv = new ArrayList<DataStructure>(dataStructures);
     54        ArrayList<T> rv = new ArrayList<T>(dataStructures);
    5655        sortStructureList(rv);
    5756        return rv;
  • router/java/src/net/i2p/router/CommSystemFacade.java

    r4e6ddfc r9bddba5  
    4949    public boolean haveOutboundCapacity(int pct) { return true; }
    5050    public boolean haveHighOutboundCapacity() { return true; }
    51     public List getMostRecentErrorMessages() { return Collections.emptyList(); }
     51    public List<String> getMostRecentErrorMessages() { return Collections.emptyList(); }
    5252   
    5353    /**
  • router/java/src/net/i2p/router/Router.java

    r4e6ddfc r9bddba5  
    612612     * Not for external use.
    613613     */
     614    @SuppressWarnings({ "unchecked", "rawtypes" })
    614615    public void readConfig() {
    615616        synchronized(_configFileLock) {
     
    13921393     * @since 0.8.13
    13931394     */
     1395    @SuppressWarnings({ "unchecked", "rawtypes" })
    13941396    public boolean saveConfig(Map toAdd, Collection<String> toRemove) {
    13951397        synchronized(_configFileLock) {
  • router/java/src/net/i2p/router/startup/LoadClientAppsJob.java

    r4e6ddfc r9bddba5  
    208208            args = new String[0];
    209209        Class<?> cls = Class.forName(className, true, cl);
    210         Method method = cls.getMethod("main", new Class[] { String[].class });
     210        Method method = cls.getMethod("main", String[].class);
    211211        method.invoke(cls, new Object[] { args });
    212212    }
     
    288288                    mgr.addAndStart(app, _args);
    289289                } else {
    290                     Method method = cls.getMethod("main", new Class[] { String[].class });
     290                    Method method = cls.getMethod("main", String[].class);
    291291                    method.invoke(cls, new Object[] { _args });
    292292                }
  • router/java/src/net/i2p/router/transport/OutboundMessageRegistry.java

    r4e6ddfc r9bddba5  
    9797     *         the payload
    9898     */
     99    @SuppressWarnings("unchecked")
    99100    public List<OutNetMessage> getOriginalMessages(I2NPMessage message) {
    100101        List<MessageSelector> matchedSelectors = null;
     
    194195     *  @param allowEmpty is msg.getMessage() allowed to be null?
    195196     */
     197    @SuppressWarnings("unchecked")
    196198    private void registerPending(OutNetMessage msg, boolean allowEmpty) {
    197199        if ( (!allowEmpty) && (msg.getMessage() == null) )
     
    230232     *  @param msg may be be null
    231233     */
     234    @SuppressWarnings("unchecked")
    232235    public void unregisterPending(OutNetMessage msg) {
    233236        if (msg == null) return;
     
    263266        }
    264267
     268        @SuppressWarnings("unchecked")
    265269        public void timeReached() {
    266270            long now = _context.clock().now();
  • router/java/src/net/i2p/router/transport/udp/TimedWeightedPriorityMessageQueue.java

    r4e6ddfc r9bddba5  
    5858     *                  should be pulled off in a row before moving on to the next.
    5959     */
     60    @SuppressWarnings({ "unchecked", "rawtypes" })
    6061    public TimedWeightedPriorityMessageQueue(RouterContext ctx, int[] priorityLimits, int[] weighting, FailedListener lsnr) {
    6162        _context = ctx;
  • router/java/src/net/i2p/router/tunnel/PumpedTunnelGateway.java

    r4e6ddfc r9bddba5  
    5959     *                 to the first hop
    6060     */
     61    @SuppressWarnings({ "unchecked", "rawtypes" })
    6162    public PumpedTunnelGateway(RouterContext context, QueuePreprocessor preprocessor,
    6263                               Sender sender, Receiver receiver, TunnelGatewayPumper pumper) {
Note: See TracChangeset for help on using the changeset viewer.