2

I'm trying to make a URLClassLoader which behaves as follows:

  • If asked for a class whose name is in a given set of inclusions, load it as normal
  • Otherwise, return a dummy class of my choice

How should I go about this? My attempt at doing this didn't work - see my earlier question for details.

Community
  • 1
  • 1
NellerLess
  • 955
  • 1
  • 8
  • 9

2 Answers2

0

extend URLClassLoader in the method loadClass return super.loadClass(originalName) if in the set of inclusions or super.load(myDummyClass) otherwise...

pgras
  • 12,614
  • 4
  • 38
  • 46
0

Basically, you cannot do this. See my answer to your earlier question.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216