groovy

provide File.size() and Matcher.size()

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.0-JSR-3
  • Fix Version/s: 1.0-JSR-6
  • Component/s: groovy-jdk
  • Labels:
    None
  • Number of attachments :
    0

Description

File.length() should be available as File.size()
Matcher.getCount() -> size()

-> size() should generally better be named getSize() to allow property calls
obj.size
--> rejected since this conflicts with Map, Expando, and other types that handle getProperty() specially.

Activity

Hide
Dirk Detering added a comment -

Methods on class groovy.util.Node should be renamed too to allow property calls.

E.g.: obj.children , obj.value, obj.attributes ....

Show
Dirk Detering added a comment - Methods on class groovy.util.Node should be renamed too to allow property calls. E.g.: obj.children , obj.value, obj.attributes ....
Hide
Dirk Detering added a comment -

Sorry, I reported the above topic as isssue GROOVY-1134 too.

Show
Dirk Detering added a comment - Sorry, I reported the above topic as isssue GROOVY-1134 too.
Hide
John Wilson added a comment -

No. Node methods are named as they are deliberately. Renaming them would cause users problems when they were writing GPath expressions on documents whose element names clashed with there "properties"

Show
John Wilson added a comment - No. Node methods are named as they are deliberately. Renaming them would cause users problems when they were writing GPath expressions on documents whose element names clashed with there "properties"

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: