This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 4516 - MapFormat does not seem to correctly process keys that are next to word-type characters.
Summary: MapFormat does not seem to correctly process keys that are next to word-type ...
Status: CLOSED INVALID
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P4 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-10-15 01:22 UTC by Jesse Glick
Modified: 2008-12-23 10:34 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 1999-10-15 01:22:05 UTC
Example: I have a template (JavaDataObject) which contains the following:

  protected get__NAME$Node$Children$MyChildren__ () {
    return (__NAME$Node$Children$MyChildren__) getChildren ();
  }

When substituted to a file, named e.g. "Shortcuts.java", this becomes:

  protected Shortcuts() {
    return (MyChildren) getChildren ();
  }

For some reason, the second occurrence was replaced correctly, but the first occurrence (1) did not use the leading "get", and (2) substituted the token with the __NAME__ and not the intelligent repla
cement. Problem for apisupport module.

[MRYZL]


Note.  " intelligent replacement" is performed by ...java.JMapFormat not by MapFormat

I tried the following example (JMapFormat used in JavaDataLoader applied on data above) and it works well.

package test.mapformat;

import com.netbeans.developer.modules.loaders.java.*;

public class MapFormatTest extends Object {

  public static void main (String args[]) {
    java.util.Map map = new java.util.HashMap();
    map.put("NAME", "Shortcuts");
    JMapFormat format = new JMapFormat(map);
    format.setLeftBrace("__");
    format.setRightBrace("__");
    format.setCondDelimiter("$");
    format.setExactMatch(false);
    System.out.println(format.format("   protected get__NAME$Node$Children$MyChildren__ () {/n" +
    "return (__NAME$Node$Children$MyChildren__) getChildren ();"));
  }
}


Result is:

   protected getMyChildren () {
return (MyChildren) getChildren ();

I also tried the original example and it seems there is following problem. The code in the example
has wrong syntax (missing return type).

protected get__NAME$Node$Children$MyChildren__ () {

If I correct the syntax, for example:

protected void get__NAME$Node$Children$MyChildren__ () {

the result is OK.
Comment 1 Marek Grummich 2000-07-25 09:25:59 UTC
Priority is changed to P4 (normal).
Comment 2 Quality Engineering 2003-07-02 15:23:11 UTC
Resolved for 3.4.x or earlier, no new info since then -> verify.

Comment 3 Quality Engineering 2003-07-02 15:40:44 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.