You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2014/01/02 20:09:31 UTC

[NET] Better name for getAddressCountLong() ?

There was a problem [1] with the getAddressCount() method - it
returned an int, however the count of addresses could be larger than
Integer.MAX_VALUE.
To preserve binary compat, I added a new method

long getAddressCountLong()

However, I'm not entirely happy with the new name; it seems a bit long
and untidy.

Any suggestions for a new shorter name?

The method [original code: 2] returns the count of availalable
addresses for a given netmask.
[Optionally including the network and broadcast addresses]

[1] https://issues.apache.org/jira/browse/NET-521
[2] http://commons.apache.org/proper/commons-net/xref/org/apache/commons/net/util/SubnetUtils.html#162

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [NET] Better name for getAddressCountLong() ?

Posted by sebb <se...@gmail.com>.
OK, thanks, I'll leave it as is.

On 2 January 2014 22:11, Paul Benedict <pb...@apache.org> wrote:
> There's nothing wrong with the name. Even the spec experts follow this
> convention. See methods getContentLength() vs getContentLengthLong().
>
> tomcat.apache.org/tomcat-8.0-doc/servletapi/javax/servlet/ServletRequest.html
>
>
> On Thu, Jan 2, 2014 at 4:08 PM, Gary Gregory <ga...@gmail.com> wrote:
>
>> There is no good short name, unless you want to go with something like
>> getAddressCountL(), yikes.
>>
>> For the 'normal' version 'AsType' is used somettimes:
>> getAddressCountAsLong().
>>
>> Or we could add a name that reflects the now corrected semantics, like
>> getFullAddressCount().
>>
>> Gary
>>
>>
>>
>>
>> On Thu, Jan 2, 2014 at 2:09 PM, sebb <se...@gmail.com> wrote:
>>
>> > There was a problem [1] with the getAddressCount() method - it
>> > returned an int, however the count of addresses could be larger than
>> > Integer.MAX_VALUE.
>> > To preserve binary compat, I added a new method
>> >
>> > long getAddressCountLong()
>> >
>> > However, I'm not entirely happy with the new name; it seems a bit long
>> > and untidy.
>> >
>> > Any suggestions for a new shorter name?
>> >
>> > The method [original code: 2] returns the count of availalable
>> > addresses for a given netmask.
>> > [Optionally including the network and broadcast addresses]
>> >
>> > [1] https://issues.apache.org/jira/browse/NET-521
>> > [2]
>> >
>> http://commons.apache.org/proper/commons-net/xref/org/apache/commons/net/util/SubnetUtils.html#162
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> > For additional commands, e-mail: dev-help@commons.apache.org
>> >
>> >
>>
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition<
>> http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>
>
>
> --
> Cheers,
> Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [NET] Better name for getAddressCountLong() ?

Posted by Paul Benedict <pb...@apache.org>.
There's nothing wrong with the name. Even the spec experts follow this
convention. See methods getContentLength() vs getContentLengthLong().

tomcat.apache.org/tomcat-8.0-doc/servletapi/javax/servlet/ServletRequest.html


On Thu, Jan 2, 2014 at 4:08 PM, Gary Gregory <ga...@gmail.com> wrote:

> There is no good short name, unless you want to go with something like
> getAddressCountL(), yikes.
>
> For the 'normal' version 'AsType' is used somettimes:
> getAddressCountAsLong().
>
> Or we could add a name that reflects the now corrected semantics, like
> getFullAddressCount().
>
> Gary
>
>
>
>
> On Thu, Jan 2, 2014 at 2:09 PM, sebb <se...@gmail.com> wrote:
>
> > There was a problem [1] with the getAddressCount() method - it
> > returned an int, however the count of addresses could be larger than
> > Integer.MAX_VALUE.
> > To preserve binary compat, I added a new method
> >
> > long getAddressCountLong()
> >
> > However, I'm not entirely happy with the new name; it seems a bit long
> > and untidy.
> >
> > Any suggestions for a new shorter name?
> >
> > The method [original code: 2] returns the count of availalable
> > addresses for a given netmask.
> > [Optionally including the network and broadcast addresses]
> >
> > [1] https://issues.apache.org/jira/browse/NET-521
> > [2]
> >
> http://commons.apache.org/proper/commons-net/xref/org/apache/commons/net/util/SubnetUtils.html#162
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition<
> http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
Cheers,
Paul

Re: [NET] Better name for getAddressCountLong() ?

Posted by Gary Gregory <ga...@gmail.com>.
There is no good short name, unless you want to go with something like
getAddressCountL(), yikes.

For the 'normal' version 'AsType' is used somettimes:
getAddressCountAsLong().

Or we could add a name that reflects the now corrected semantics, like
getFullAddressCount().

Gary




On Thu, Jan 2, 2014 at 2:09 PM, sebb <se...@gmail.com> wrote:

> There was a problem [1] with the getAddressCount() method - it
> returned an int, however the count of addresses could be larger than
> Integer.MAX_VALUE.
> To preserve binary compat, I added a new method
>
> long getAddressCountLong()
>
> However, I'm not entirely happy with the new name; it seems a bit long
> and untidy.
>
> Any suggestions for a new shorter name?
>
> The method [original code: 2] returns the count of availalable
> addresses for a given netmask.
> [Optionally including the network and broadcast addresses]
>
> [1] https://issues.apache.org/jira/browse/NET-521
> [2]
> http://commons.apache.org/proper/commons-net/xref/org/apache/commons/net/util/SubnetUtils.html#162
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory