Changeset c6f2d49


Ignore:
Timestamp:
Nov 24, 2013 11:41:06 PM (6 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
615ba94
Parents:
e1fcad68
Message:

Class generics

Files:
12 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java

    re1fcad68 rc6f2d49  
    833833    private static void addPath(URL u) throws Exception {
    834834        URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
    835         Class urlClass = URLClassLoader.class;
     835        Class<URLClassLoader> urlClass = URLClassLoader.class;
    836836        Method method = urlClass.getDeclaredMethod("addURL", new Class[]{URL.class});
    837837        method.setAccessible(true);
  • apps/susimail/src/src/i2p/susi/webmail/encoding/EncodingFactory.java

    re1fcad68 rc6f2d49  
    4747                        for( int i = 0; i < classNames.length; i++ ) {
    4848                                try {
    49                                         Class c = Class.forName( classNames[i] );
     49                                        Class<?> c = Class.forName( classNames[i] );
    5050                                        Encoding e = (Encoding)c.newInstance();
    5151                                        encodings.put( e.getName(), e );
  • core/java/src/net/i2p/client/naming/MetaNamingService.java

    re1fcad68 rc6f2d49  
    3939        while (tok.hasMoreTokens()) {
    4040            try {
    41                 Class cls = Class.forName(tok.nextToken());
    42                 Constructor con = cls.getConstructor(new Class[] { I2PAppContext.class });
     41                Class<?> cls = Class.forName(tok.nextToken());
     42                Constructor<?> con = cls.getConstructor(new Class[] { I2PAppContext.class });
    4343                addNamingService((NamingService)con.newInstance(new Object[] { context }), false);
    4444            } catch (Exception ex) {
  • core/java/src/net/i2p/client/naming/NamingService.java

    re1fcad68 rc6f2d49  
    463463        String impl = context.getProperty(PROP_IMPL, DEFAULT_IMPL);
    464464        try {
    465             Class cls = Class.forName(impl);
    466             Constructor con = cls.getConstructor(new Class[] { I2PAppContext.class });
     465            Class<?> cls = Class.forName(impl);
     466            Constructor<?> con = cls.getConstructor(new Class[] { I2PAppContext.class });
    467467            instance = (NamingService)con.newInstance(new Object[] { context });
    468468        } catch (Exception ex) {
  • core/java/src/net/i2p/crypto/ECConstants.java

    re1fcad68 rc6f2d49  
    4242        if (Security.getProvider("BC") == null) {
    4343            try {
    44                 Class cls = Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider");
    45                 Constructor con = cls.getConstructor(new Class[0]);
     44                Class<?> cls = Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider");
     45                Constructor<?> con = cls.getConstructor(new Class[0]);
    4646                Provider bc = (Provider)con.newInstance(new Object[0]);
    4747                Security.addProvider(bc);
  • core/java/src/net/i2p/util/FileUtil.java

    re1fcad68 rc6f2d49  
    296296        if (!_failedOracle) {
    297297            try {
    298                 Class p200 = Class.forName("java.util.jar.Pack200", true, ClassLoader.getSystemClassLoader());
     298                Class<?> p200 = Class.forName("java.util.jar.Pack200", true, ClassLoader.getSystemClassLoader());
    299299                Method newUnpacker = p200.getMethod("newUnpacker", (Class[]) null);
    300300                Object unpacker = newUnpacker.invoke(null,(Object[])  null);
     
    317317        if (!_failedApache) {
    318318            try {
    319                 Class p200 = Class.forName("org.apache.harmony.unpack200.Archive", true, ClassLoader.getSystemClassLoader());
    320                 Constructor newUnpacker = p200.getConstructor(new Class[] {InputStream.class, JarOutputStream.class});
     319                Class<?> p200 = Class.forName("org.apache.harmony.unpack200.Archive", true, ClassLoader.getSystemClassLoader());
     320                Constructor<?> newUnpacker = p200.getConstructor(new Class[] {InputStream.class, JarOutputStream.class});
    321321                Object unpacker = newUnpacker.newInstance(new Object[] {in, out});
    322322                Method unpack = unpacker.getClass().getMethod("unpack", (Class[]) null);
  • core/java/src/net/i2p/util/Log.java

    re1fcad68 rc6f2d49  
    2626 */
    2727public class Log {
    28     private final Class _class;
     28    private final Class<?> _class;
    2929    private final String _className;
    3030    private final String _name;
     
    7676     *  Use I2PAppContext.getGlobalContext().logManager().getLog(cls)
    7777     */
    78     public Log(Class cls) {
     78    public Log(Class<?> cls) {
    7979        this(I2PAppContext.getGlobalContext().logManager(), cls, null);
    8080        _manager.addLog(this);
     
    9090    }
    9191
    92     Log(LogManager manager, Class cls) {
     92    Log(LogManager manager, Class<?> cls) {
    9393        this(manager, cls, null);
    9494    }
     
    9898    }
    9999
    100     Log(LogManager manager, Class cls, String name) {
     100    Log(LogManager manager, Class<?> cls, String name) {
    101101        _manager = manager;
    102102        _class = cls;
     
    230230    public Object getScope() { return _scope; }
    231231
    232     static String getScope(String name, Class cls) {
     232    static String getScope(String name, Class<?> cls) {
    233233        if ( (name == null) && (cls == null) ) return "f00";
    234234        if (cls == null) return name;
     
    240240        private final String _scopeCache;
    241241
    242         public LogScope(String name, Class cls) {
     242        public LogScope(String name, Class<?> cls) {
    243243            _scopeCache = getScope(name, cls);
    244244        }
  • core/java/src/net/i2p/util/LogManager.java

    re1fcad68 rc6f2d49  
    167167    }
    168168
    169     public Log getLog(Class cls) { return getLog(cls, null); }
     169    public Log getLog(Class<?> cls) { return getLog(cls, null); }
    170170    public Log getLog(String name) { return getLog(null, name); }
    171     public Log getLog(Class cls, String name) {
     171    public Log getLog(Class<?> cls, String name) {
    172172        String scope = Log.getScope(name, cls);
    173173        boolean isNew = false;
  • core/java/src/net/i2p/util/LogRecord.java

    re1fcad68 rc6f2d49  
    1616class LogRecord {
    1717    private final long _date;
    18     private final Class _source;
     18    private final Class<?> _source;
    1919    private final String _name;
    2020    private final String _threadName;
     
    2323    private final Throwable _throwable;
    2424
    25     public LogRecord(Class src, String name, String threadName, int priority, String msg, Throwable t) {
     25    public LogRecord(Class<?> src, String name, String threadName, int priority, String msg, Throwable t) {
    2626        _date = Clock.getInstance().now();
    2727        _source = src;
     
    3737    }
    3838
    39     public Class getSource() {
     39    public Class<?> getSource() {
    4040        return _source;
    4141    }
  • core/java/src/net/i2p/util/SystemVersion.java

    re1fcad68 rc6f2d49  
    4848        if (_isAndroid) {
    4949            try {
    50                 Class ver = Class.forName("android.os.Build.VERSION", true, ClassLoader.getSystemClassLoader());
     50                Class<?> ver = Class.forName("android.os.Build.VERSION", true, ClassLoader.getSystemClassLoader());
    5151                Field field = ver.getField("SDK_INT");
    5252                sdk = field.getInt(null);
  • router/java/src/net/i2p/router/JobQueue.java

    re1fcad68 rc6f2d49  
    278278        if (!_allowParallelOperation) return false; // dont drop during startup [duh]
    279279        if (numReady > _maxWaitingJobs) {
    280             Class cls = job.getClass();
     280            Class<? extends Job> cls = job.getClass();
    281281            // lets not try to drop too many tunnel messages...
    282282            //if (cls == HandleTunnelMessageJob.class)
  • router/java/src/net/i2p/router/startup/LoadClientAppsJob.java

    re1fcad68 rc6f2d49  
    198198        if (args == null)
    199199            args = new String[0];
    200         Class cls = Class.forName(className, true, cl);
     200        Class<?> cls = Class.forName(className, true, cl);
    201201        Method method = cls.getMethod("main", new Class[] { String[].class });
    202202        method.invoke(cls, new Object[] { args });
     
    265265        public void run() {
    266266            try {
    267                 Class cls = Class.forName(_className, true, _cl);
     267                Class<?> cls = Class.forName(_className, true, _cl);
    268268                if (isRouterApp(cls)) {
    269                     Constructor con = cls.getConstructor(RouterContext.class, ClientAppManager.class, String[].class);
     269                    Constructor<?> con = cls.getConstructor(RouterContext.class, ClientAppManager.class, String[].class);
    270270                    RouterAppManager mgr = _ctx.clientAppManager();
    271271                    Object[] conArgs = new Object[] {_ctx, _ctx.clientAppManager(), _args};
     
    273273                    mgr.addAndStart(app, _args);
    274274                } else if (isClientApp(cls)) {
    275                     Constructor con = cls.getConstructor(I2PAppContext.class, ClientAppManager.class, String[].class);
     275                    Constructor<?> con = cls.getConstructor(I2PAppContext.class, ClientAppManager.class, String[].class);
    276276                    RouterAppManager mgr = _ctx.clientAppManager();
    277277                    Object[] conArgs = new Object[] {_ctx, _ctx.clientAppManager(), _args};
     
    289289        }
    290290
    291         private static boolean isRouterApp(Class cls) {
     291        private static boolean isRouterApp(Class<?> cls) {
    292292            return isInterface(cls, RouterApp.class);
    293293        }
    294294
    295         private static boolean isClientApp(Class cls) {
     295        private static boolean isClientApp(Class<?> cls) {
    296296            return isInterface(cls, ClientApp.class);
    297297        }
    298298
    299         private static boolean isInterface(Class cls, Class intfc) {
     299        private static boolean isInterface(Class<?> cls, Class<?> intfc) {
    300300            try {
    301                 Class[] intfcs = cls.getInterfaces();
     301                Class<?>[] intfcs = cls.getInterfaces();
    302302                for (int i = 0; i < intfcs.length; i++) {
    303303                    if (intfcs[i] == intfc)
Note: See TracChangeset for help on using the changeset viewer.