wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes Javadoc repair Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Javadoc repair" Watch "Javadoc repair" New topic
Author

Javadoc repair

Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
Hello All,

I have to repair Javadocs. More specifically, I want to repair @see tag in which Class#Reference is mistakenly written as Class.Reference...

I have hundreds of files to update and just wondering any tool/utility is available for this purpose..

I have tried JavaRepair Plugin for Eclipse from CodePro but for the scenario I explained it is not of great usage.

Any comments??

Thanks,
Manohar
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
So all you need to do is replacing the . by a #? Sounds like a job for a simple search and replace using regular expressions...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

In Eclipse V3: Find/Replace, with "Rgular Expressions" checked on.

Find: @see \s+(\w+)\.\(w+)

Replace With: @see $1#$2

will do it, I think. Regex language varies depending on the product, but I think this is how Eclipse wants it.


Customer surveys are for companies who didn't pay proper attention to begin with.
Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
If I use above regular expression,

@see java.lang.Comparable.compareTo(Object)

is replaced like

@see java#lang.Comparable.compareTo(Object)

instead of required replacement,

@see java.lang.Comparable#compareTo(Object)

Any workarounds?

Manohar
Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
This worked for me.

Find String
@see\s+(\w+.*)\.(\w+)\u0028

Replace String
@see $1#$2(

Thanks all for your help.

Manohar
Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
Hello All,

In Eclipse, Find/Replace option is provided at file level. Is there any provision to search and replace a regular expression with other, in package/Project level? Or any other tool/editor which does this?

Your help is appreciated.

TIA,
Manohar
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
After you have done a normal search in Eclipse, take a look at the context menu of the search view. At least in 3.0, there should be a replace option.
Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
Hi All,

Here is one more javadoc repair problem..

In my project, many errors are because of mangled (Wrong) @link references. Like referring to non existent Or Renamed classes.

For ex: to refer a method in Imager.<method>

it's writeen as @link Imaging#<methodName>

Since Imaging class is not existing, javadoc task is throwing error.
So, to repair that I have to modify link as @link Imager#<methodName>

It is very tedious to repair that manually. Is there any tool/API/workaround to solve this problem? Or to automate atleast part of solution?

Your suggestions are appreciated.
Thanks in advance.
Manohar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javadoc repair
 
Similar Threads
Javaranch Newsgroup Crashes on Win98 SE
greying out of text field
Compact and Repair Access Database
Makeshift Heat Sink
IT vs Software?