7dr3am7
7dr3am7

Reputation: 765

Java API modification

I have a very quick question - Is it possible to modify the source code of Java API e.g. Junit, JABX ? I know it seems a very stupid question, but it has been bugging me for a while.

Upvotes: 2

Views: 166

Answers (2)

hvgotcodes
hvgotcodes

Reputation: 120318

If you can get your hands on the source, then sure you can modify it. It might not be the best option. It might be better to just create subclasses (if possible) and overwrite implementations, and use your subclasses. Or use composition to proxy the library classes. Depends on what you need to do/fix.

Keep in mind if you modify the source of an external library, and upgrade, you have to modify the source again. You might have to change your extensions/proxies as well if you go that route, but experience has taught me that's typically less complicated.

Upvotes: 2

Gerbrand
Gerbrand

Reputation: 1633

for open source API such as JUnit: yes

Upvotes: 1

Related Questions