• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javadoc repair

 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So all you need to do is replacing the . by a #? Sounds like a job for a simple search and replace using regular expressions...
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic