Changeset efcf294 for core


Ignore:
Timestamp:
May 29, 2016 5:02:47 AM (4 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
7249b64
Parents:
e969213
Message:

Require that AndroidLogWriter? is a subclass of LogWriter?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/LogManager.java

    re969213 refcf294  
    168168        if (SystemVersion.isAndroid()) {
    169169            try {
    170                 Class<?> clazz = Class.forName("net.i2p.util.AndroidLogWriter");
    171                 Constructor<?> ctor = clazz.getDeclaredConstructor(LogManager.class);
    172                 _writer = (LogWriter) ctor.newInstance(this);
     170                Class<? extends LogWriter> clazz = Class.forName(
     171                        "net.i2p.util.AndroidLogWriter"
     172                    ).asSubclass(LogWriter.class);
     173                Constructor<? extends LogWriter> ctor = clazz.getDeclaredConstructor(LogManager.class);
     174                _writer = ctor.newInstance(this);
    173175            } catch (ClassNotFoundException e) {
    174176            } catch (InstantiationException e) {
Note: See TracChangeset for help on using the changeset viewer.