Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » IPath.isValidPath()
IPath.isValidPath() [message #289357] Thu, 04 August 2005 00:02 Go to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

The method IPath.isValidPath() is prototyped as:

public boolean isValidPath(String path);

This is kind of confusing to me. I would have thought it would either be a
static method, or take no parameters (i.e., validate the object it was
called on). But it's neither. So, what is the interaction between the Path
object on which the method is called, and the string passed in? The javadoc
comment doesn't help me.

Thanks,
-Walter Harley
BEA Systems Inc.
Re: IPath.isValidPath() [message #289382 is a reply to message #289357] Thu, 04 August 2005 08:45 Go to previous messageGo to next message
NiS is currently offline NiSFriend
Messages: 58
Registered: July 2009
Member
Did you look at the source code?

"Walter Harley" <wharley@bea.com> a
Re: IPath.isValidPath() [message #289392 is a reply to message #289357] Thu, 04 August 2005 11:39 Go to previous messageGo to next message
Martin Olsson is currently offline Martin OlssonFriend
Messages: 20
Registered: July 2009
Junior Member
You're absolutely right, the interface of that function is just plain
confusing. I started wondering about this too a while back and posted a
question about it in this group. Search for a message with title:

IPath.isValidPath() does not make sense

John Arthorne (which wrote books about Eclipse etc) gave the following
answer:

The answer is simply that interfaces cannot define static methods. At
the time this was written, the goal was to define the API purely in
terms of interfaces. It does not operate on the receiver because the
purpose is to determine whether it would be legal to create a path from
the given string. You can use Path.ROOT.isValidPath(String). See also:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=76246




regards,
martin

Walter Harley wrote:
> The method IPath.isValidPath() is prototyped as:
>
> public boolean isValidPath(String path);
>
> This is kind of confusing to me. I would have thought it would either be a
> static method, or take no parameters (i.e., validate the object it was
> called on). But it's neither. So, what is the interaction between the Path
> object on which the method is called, and the string passed in? The javadoc
> comment doesn't help me.
>
> Thanks,
> -Walter Harley
> BEA Systems Inc.
>
>
Re: IPath.isValidPath() [message #289443 is a reply to message #289392] Thu, 04 August 2005 23:54 Go to previous message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Martin Olsson" <mnemo@minimum.se> wrote in message
news:dcsupv$2tm$1@news.eclipse.org...
>
> [...]
> John Arthorne (which wrote books about Eclipse etc) gave the following
> answer:
>
> The answer is simply that interfaces cannot define static methods. At the
> time this was written, the goal was to define the API purely in terms of
> interfaces. [...]


Thanks, now I understand. (To me it's a good argument against the
desirability of that goal!)

It would be nice if the javadoc was explicit about these "de facto statics".
I hate to put in a bug for "less-than-ideal javadoc," though.
Previous Topic:finding bundle name?
Next Topic:Infopops
Goto Forum:
  


Current Time: Fri Apr 26 22:25:23 GMT 2024

Powered by FUDForum. Page generated in 0.02868 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top