Changeset f8648ff


Ignore:
Timestamp:
Jun 28, 2013 2:56:55 PM (7 years ago)
Author:
zab2 <zab2@…>
Branches:
master
Children:
a308179
Parents:
552f91b
Message:

Explicitly check the type of I2PSocketManager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java

    r552f91b rf8648ff  
    181181        String classname = opts.getProperty(PROP_MANAGER, DEFAULT_MANAGER);
    182182        try {
    183             Class cls = Class.forName(classname);
     183            Class<?> cls = Class.forName(classname);
     184            if (!I2PSocketManager.class.isAssignableFrom(cls))
     185                throw new IllegalArgumentException(classname + " is not an I2PSocketManager");
    184186            Constructor<I2PSocketManager> con = (Constructor<I2PSocketManager>)
    185187                  cls.getConstructor(new Class[] {I2PAppContext.class, I2PSession.class, Properties.class, String.class});
Note: See TracChangeset for help on using the changeset viewer.