Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342295

Summary: [templates] Template variable names can only contain ASCII characters
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: TextAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P1 CC: daniel_megert
Version: 3.7   
Target Milestone: 3.7 M7   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix
none
Fix 2 none

Description Markus Keller CLA 2011-04-08 10:11:44 EDT
Created attachment 192836 [details]
Fix

HEAD

Template variable names can only contain ASCII characters. Templates like this one are rejected:

System.out.println(${blöd:var} + " with element type " + ${hä:elemType(blöd)});

The patch allows all Java identifiers as names.

I made a pass over my workspace to find similar problems as bug 341977, and that's the only other bad place I found.
Comment 1 Markus Keller CLA 2011-04-08 10:44:05 EDT
Fixed in HEAD.
Comment 2 Dani Megert CLA 2011-04-11 04:03:17 EDT
1. start Eclipse
2. start to use/load the templates
==> tons of exceptions and many templates disabled  :-(

For bg see also bug 21926.
Comment 3 Markus Keller CLA 2011-04-11 08:53:18 EDT
Created attachment 192927 [details]
Fix 2

(In reply to comment #2)
> ==> tons of exceptions and many templates disabled  :-(

The problem is that the EBNF in TemplateTranslator was not honest. It didn't define 'identifier', and the implementation accepted \w++. To support existing clients, Fix 2 allows numbers at the start of an 'identifier' again and adjusts the grammar to reality.


> For bg see also bug 21926.

That bug is about template names. This bug only deals with the template pattern.
Comment 4 Markus Keller CLA 2011-04-11 08:53:36 EDT
Fixed in HEAD.
Comment 5 Dani Megert CLA 2011-04-26 10:58:00 EDT
Verified in I20110425-1800. Also verified that exported templates which contain non-ASCII variables are silently ignored when imported into 3.6.x.