Bug 147461 - [compiler][batch][options] tighten the use of : and ; within access restriction specifications
Summary: [compiler][batch][options] tighten the use of : and ; within access restricti...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 161996
Blocks:
  Show dependency tree
 
Reported: 2006-06-16 11:17 EDT by Maxime Daniel CLA
Modified: 2007-03-20 11:45 EDT (History)
1 user (show)

See Also:


Attachments
Suggested fix (3.59 KB, patch)
2007-03-05 06:01 EST, Maxime Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Daniel CLA 2006-06-16 11:17:06 EDT
I20060602-1317

When using ':' as a separator for access restriction spec in a call to the batch compiler on Windows, the tokenizer gets lost, and the message is far from being clear. (See BatchCompilerTest#57).

The fact is that the batch compiler help message incorrectly states that access restriction rules should be separated by ':' - which is only true when File.pathSeparatorChar is ':'.
Since neither ':' nor ';' are valid characters in Java identifiers, and they are not used either as special characters within access rules, I believe we should:
- either explicitly diagnose their use as incorrect when the wrong one is used on a given platform, and resync the command line for further errors diagnostic;
- or be tolerant and normalize so that the result is the expected one; one variant in this case would be to privilege one style over the other (as Java does for '/' which can merely be used in place of File.separator in many instances - here, accept ':' in all cases, and ';' on W* only).

If the batch compiler gets more used than before (a side effect of its being made more visible), I believe that the second option would make more sense.

In any case, the help message needs some improvement.
Comment 1 Maxime Daniel CLA 2007-01-30 04:21:23 EST
While this bug does not need bug 161996 to be resolved before we can tackle it, it is expected that the other bug will introduce changes that will impact the solution for this bug.
Comment 2 Maxime Daniel CLA 2007-01-31 02:36:32 EST
After thinking more about it, I would no more support the 'tolerant' approach too much. Arguments:
- classpath entries are not tolerant to ':' use as path separator on W*, hence
  being tolerant inside rules has little added value;
- ':' is used in all absolute pathnames on W*; keeping the current obligation to
  use ';' as the rule separator should thus keep command lines more readable; 
  attempting to sort out legit ':' in paths from uses of ':' instead of ';' as 
  rules separator may also complicate the state machine and raise costs above 
  the expected benefits.

Having said that, I'll only fix the messages that wrongly suggest to use ':' as a rule separator on W*.
Comment 3 Maxime Daniel CLA 2007-03-05 06:01:24 EST
Created attachment 60253 [details]
Suggested fix
Comment 4 Maxime Daniel CLA 2007-03-05 06:52:01 EST
Released for 3.3 M6.
Comment 5 Olivier Thomann CLA 2007-03-05 09:20:40 EST
Is PDE/Build aware of this fix?
Comment 6 Maxime Daniel CLA 2007-03-05 09:58:24 EST
I do not think it is necessary since I only changed the help message. The impact should only be on our doc, right?
Comment 7 Olivier Thomann CLA 2007-03-05 15:31:42 EST
I thought that PDE/Build were always using ':'.
Comment 8 Maxime Daniel CLA 2007-03-06 02:04:17 EST
If they did, they would not get the rules to work at all, cause +OK:-KO is (and was) interpreted as 'plus upon path OK:-KO', which fails silently to match anything at all (no 'OK:-KO' path - in general).
Comment 9 Eric Jodet CLA 2007-03-20 04:44:10 EDT
Verified for 3.3 M6 using build I20070319-1335