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.
Summary: | "Convert SwingUtilities Methods" transformer tries to reformat runnables | ||
---|---|---|---|
Product: | contrib | Reporter: | Jesse Glick <jglick> |
Component: | Jackpot | Assignee: | _ tball <tball> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Jesse Glick
2005-11-14 20:33:28 UTC
Perl? Anything but that! I'll get right on it!!! Fixed issues 2 and 3 by using a more narrow rule match. I am splitting off issue 1 to a separate issue, 68779. Re. "fixed issues 2 and 3 by using a more narrow rule match" - seems to me that the bug was in the patching engine, not the rule; $su.invokeLater($r) => java.awt.EventQueue.invokeLater($r) uses the same term $r on both sides, so IMHO any text characters within the physical bounds of what the expression $r represents - from 'n' to '}' - should be left untouched, with the exception that it is permissible to add or remove a fixed amount of indentation whitespace on each contained line (though even that should be a configurable option, since for really long or heavily edited blocks it is often better to leave the indentation broken rather than touch interior lines). You are right, it's a hack. The underlying problem is that the patching engine works on trees, not lines, and a transform involves rewriting one tree with another. By removing the "($r$)" from both method invocations, only their select children are matched and not their argument lists -- okay for this transformation, but not a general solution. I've special-cased class and method trees where you obviously don't want all of their children rewritten but need to enhance the tree-diff'er to do a better job comparing children of other tree types. I'll file a separate bug for this, but don't want to rewrite the tree-diff'er until there is a better regression suite in place. The block simplifier needs work, too, and can be done as part of this rewrite. |