This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] for Review: SelectorImpl.wakeup() + Synchronization


On Fri, Dec 19, 2003 at 09:25:52AM -0600, Mohan Embar wrote:

> >> +  private boolean unhandledWakeup = false;
> >
> >false is the default value of boolean and not explicitely needed.
> 
> Is this the official libgcj stance? I understand default values in Java,
> but as a matter of style, I initialize all fields either explicitly
> or in the constructor. This being said, I'm searching the web
> for some document to back me up and I can't find anything
> after a quick search....

AFAIK this falls under the "redundancy" rule. We dont write redundant
stuff. ;-)

> 
> >> +      throw new ClosedSelectorException ();
> >
> >Dont add "space" between method/constructor name and '('. There are
> >serveral instances of this misformatting. I know I said different in the
> >past but tromey enlightened me.
> 
> Are we doing this differently than C?:
> 
> http://www.gnu.org/prep/standards_23.html#SEC23
> 
> If so, why? (Not that I'm complaining about not having this space, I'd
> gladly remove these from the C/C++ code too if Father GNU didn't make
> me put them there.)

Yeah, we are different here. I wondered too but tromey told me to leave
the space out.

> >> -  /**
> >> -   * Marks the beginning of an I/O operation that might block indefinitely.
> >> -   */
> >> -  protected final void begin()
> >> -  {
> >> -  }
> >> -
> >> -  /**
> >> -   * Marks the end of an I/O operation that might block indefinitely.
> >> -   */
> >> -  protected final void end()
> >> -  {
> >> -  }
> >> -    
> >
> >Why do you remove methods required by the official API ?
> 
> Oops. I should have realized that this was a "real" class. I'll put this
> back in, but based on my implementation, do you think these really
> need to be overridden in SelectorImpl? I wouldn't know what I'd put
> in them.

Its needed to tell the thread doing the seletion if the selector was
asynchroniously closed or interrupted by another thread.


Michael


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]