Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Generics type on the base classes ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ed  
View profile  
 More options Nov 27 2009, 12:29 pm
From: Ed <post2edb...@gmail.com>
Date: Fri, 27 Nov 2009 09:29:07 -0800 (PST)
Local: Fri, Nov 27 2009 12:29 pm
Subject: Generics type on the base classes ?
Hellu,

Why not use put a Generic parameter on the base classes like
PrimitiveAssert (a bit like the Enum generics).
Why? I think you can move up quick a bit of code that is now contained
in the subclass to support the Fluent API.
Example:
public abstract class PrimitiveAssert<T extends PrimitiveAssert<T>>
extends Assert {

So the as method can now move up and become part of the
PrimitiveAssert:
        @SuppressWarnings("unchecked")
        public T as(String description) {
                description(description);
                return (T) this;
        }

Even do, it contains a supress warning, it absolutely safe. Just try
it...
I tested it and it works fine.

If you choise to implement this, you could move up quite a lot of
code, which of course has a lot of benefits... :)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Ruiz  
View profile  
 More options Nov 27 2009, 2:28 pm
From: Alex Ruiz <alex.ruiz...@gmail.com>
Date: Fri, 27 Nov 2009 11:28:18 -0800
Local: Fri, Nov 27 2009 2:28 pm
Subject: Re: [easytesting] Generics type on the base classes ?

Hi Ed,

There is already a task that involves removing PrimitiveAssert and
consolidate everything under one base class. It is part of the fix for
FEST-133 ( http://jira.codehaus.org/browse/FEST-133 ) :)

Cheers,
-Alex


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed  
View profile  
 More options Nov 27 2009, 2:39 pm
From: Ed <post2edb...@gmail.com>
Date: Fri, 27 Nov 2009 11:39:14 -0800 (PST)
Local: Fri, Nov 27 2009 2:39 pm
Subject: Re: Generics type on the base classes ?
Ok, sorry for the duplicate.
I have to admit, that I searched.. but fast ;)
I just voted FEST-133

On Nov 27, 8:28 pm, Alex Ruiz <alex.ruiz...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »