| Summary: | [templates] "Template Evaluation Error" error-dialog is displayed when formatter adds newline in code template | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Andre Bargull <andrebargull+eclipse> | ||||
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | daniel_megert, tobias.gierke | ||||
| Version: | 3.8 | Keywords: | helpwanted | ||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Works for me using latest 3.8 build (I20120429-2000). If you can still reproduce with a latest 3.8 or 4.2 build then please reopen and also attach your formatter profile. Also, check of there's anything in the .log. Does "formatter profile" refer to the current code formatter settings (under Preferences > Java > Code Style > Formatter) or that something else? If it's the former, the active profile is left as-is, that means "Eclipse [built-in]" is still selected.
Apart from that, bugzilla seems to have split the example 'systrace' template into several lines. Actually that should be one single line.
Also when trying to reproduce the bug, make sure that the parameters are emitted by the template engine across multiple lines. Like in:
---
deepToString(new Object[]{object1, <newline> object2})
---
where <newline> is the line-separator.
Created attachment 214802 [details]
log-file with stacktrace
The "BadLocationException" stacktrace entry from the log file is the important one for this bug. I'm not sure how the other exception (AssertionFailedException) got into the log-file.
Version used to reproduce the error message: "Eclipse 4.2.0 Integration Build: I20120429-1800"
> Apart from that, bugzilla seems to have split the example 'systrace' template
> into several lines. Actually that should be one single line.
That's the key. I can reproduce now.
Any news on this ? This bug is still present in Luna , Build id: 20140612-0600 (In reply to Tobias Gierke from comment #5) > Any news on this ? This bug is still present in Luna , Build id: > 20140612-0600 No one is working on this. A high quality patch is welcome. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. This works for me using https://download.eclipse.org/eclipse/downloads/drops4/S-4.12RC1a-201905310245/ |
Build Identifier: Version: Indigo Service Release 2 Build id: 20120216-1857 The following "Template Evaluation Error" is displayed when the formatter adds a newline in a generated code template: --- First position: 'object1, object2' at 251, this position: 'object1, ' at 345 --- Reproducible: Always Steps to Reproduce: Changed 'systrace' template to include actual parameters, Preferences > Java > Editor > Templates > 'systrace': --- System.out.println("${enclosing_type}.${enclosing_method}(${enclosing_method_arguments}) = " + java.util.Arrays.deepToString(new Object[]{${enclosing_method_arguments}})); --- Code to reproduce: --- package bugs; public class EclipseTemplateEvalError { public void someLongMethodName(Object object1, Object object2) { // Enter 'systrace' and hit ctrl+space } } ---