File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Extending From Classes with Same Name, Different JAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Extending From Classes with Same Name, Different JAR" Watch "Extending From Classes with Same Name, Different JAR" New topic
Author

Extending From Classes with Same Name, Different JAR

Steve Singer
Greenhorn

Joined: Feb 23, 2010
Posts: 3
Question for anybody who might have run across this --

We are working with a software package and want to make a modification. There is a class that looks like this:



We want to make a copy of the class in a custom jar file and override just method2. We want to use everything else as the base. We don't have the full source code, but the vendor gave us the method name and signature and we know how to add it to the CLASSPATH. So, what we'd need to do would be this:



That would run all the base methods but run our method2. But that's not working since Eclipse thinks we're extending from ourselves and not the SomeClass that is in the vendor's JAR. Is there a way to do this? Or are we lost?

Thanks in advance!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19543
    
  16

For the compiler these two are the same class, and therefore it will not work.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Extending From Classes with Same Name, Different JAR
 
Similar Threads
reasoning behind issues with protected fields in other packages
Java Free Blocks
Tracking User's requests.
How to Spy a Method
Game Tutorials -->> Creating An Executable JAR File