Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4988891

Matcher.asResult should be named differently

XMLWordPrintable

    • b48
    • x86
    • linux



      Name: rl43681 Date: 02/04/2004


      FULL PRODUCT VERSION :
      java version "1.5.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b31)
      Java HotSpot(TM) Client VM (build 1.5.0-beta-b31, mixed mode)


      A DESCRIPTION OF THE PROBLEM :
      All methods of the type asXXX() only provide a different view on the same data so that changes to either are visible in the other: see Arrays.asList(), diverse java.nio asXXXBuffer() methods

      Matcher.asResult is not of that type: later changes to the Matcher do not affect the returned MatchResult; instead it contains copied data.

      (In fact, Matcher.asResult with the usual asXXX semantics would be pointless as the Matcher already implements MatchResult.)

      Please rename it.

      "toResult" would still not be good: as the Matcher already is a MatchResult, it make little sense to convert it to one.


      REPRODUCIBILITY :
      This bug can be reproduced always.
      (Incident Review ID: 236155)
      ======================================================================

            mmcclosksunw Michael Mccloskey (Inactive)
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: