Revision 7a1fcbeb
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/library/effect/PostprocessEffect.java | ||
---|---|---|
197 | 197 |
mSources.clear(); |
198 | 198 |
mNumSources = 0; |
199 | 199 |
|
200 |
Method method=null;
|
|
200 |
Method method; |
|
201 | 201 |
|
202 | 202 |
for(EffectName name: EffectName.values()) |
203 | 203 |
{ |
... | ... | |
207 | 207 |
|
208 | 208 |
try |
209 | 209 |
{ |
210 |
method = cls.getMethod("destroyStatics");
|
|
210 |
method = cls.getDeclaredMethod("destroyStatics"); // destroyStatics not public, thus getDeclaredMethod
|
|
211 | 211 |
} |
212 | 212 |
catch(NoSuchMethodException ex) |
213 | 213 |
{ |
214 |
android.util.Log.e("postprocess", "exception getting method: "+ex.getMessage()); |
|
214 |
android.util.Log.e("postprocess", cls.getSimpleName()+": exception getting method: "+ex.getMessage()); |
|
215 |
method = null; |
|
215 | 216 |
} |
216 | 217 |
|
217 | 218 |
try |
218 | 219 |
{ |
219 |
method.invoke(null); |
|
220 |
if( method!=null ) method.invoke(null);
|
|
220 | 221 |
} |
221 | 222 |
catch(Exception ex) |
222 | 223 |
{ |
Also available in: Unified diff
fix a bug: in certain places when we use reflection, it needs to be getDeclaredMethod and not getMethod because the methods are not public!