• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Javadoc repair

 
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic