Bug 92398

Summary: [compiler] Leverage access rule support in batch compiler
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Maxime Daniel <maxime_daniel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Batch compiler test class extension to take command lines into account
none
Add function as '[+-~pattern]' extension to classpath values
none
Batch compiler test class improvements + access rules tests
none
function as '[+-~pattern]' extension to classpath values
none
Batch compiler tests improvements + access rules tests
none
Tests -- HEAD catchup (tolerate timestamps in logs, etc.) none

Description Philipe Mulet CLA 2005-04-22 11:35:40 EDT
3.1m6

The batch compiler should allow to be specified access rules on a per classpath
entry basis
Comment 1 Maxime Daniel CLA 2005-05-06 12:35:20 EDT
Created attachment 20782 [details]
Batch compiler test class extension to take command lines into account

The rationale is to enable a command line invocation that does not talk to the
underlying APIs. The suggested patch specializes runConformTest and
runNegativeTest, then leverages these from a couple of concrete tests.
Comment 2 Maxime Daniel CLA 2005-05-11 01:54:24 EDT
Created attachment 20929 [details]
Add function as '[+-~pattern]' extension to classpath values

Adds the function as follows:
- each classpath (or bootclasspath) entry can be followed by a '[' ']' enclosed

  list of access rules;
- each access rule is composed of a one-character permission specification and
  a rule pattern; the permission specification is '+' for accessible, '~' for
  discourage, and '-' for forbidden; patterns are the same as in the UI;
- rules must be separated by the file separator (aka ';' on Windows).

Further work for consideration:
- consolidate classpaths lists;
- factorize common behavior between ClasspathDirectory and ClasspathJar;
- revisit command line analyzer.
Comment 3 Maxime Daniel CLA 2005-05-11 01:56:43 EDT
Created attachment 20930 [details]
Batch compiler test class improvements + access rules tests

Improves the test class in the following respects:
- more complete output in case of mismatch;
- normalize the OUTPUT_DIR value in comparison.
Adds test cases for 20929.
Comment 4 Maxime Daniel CLA 2005-05-16 11:11:46 EDT
See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=95349, that should impact
test cases.
Comment 5 Maxime Daniel CLA 2005-05-19 06:44:27 EDT
Created attachment 21413 [details]
function as '[+-~pattern]' extension to classpath values

Refactoring as suggested in comments to attachment 20929 [details].
Comment 6 Maxime Daniel CLA 2005-05-19 06:47:53 EDT
Created attachment 21414 [details]
Batch compiler tests improvements + access rules tests

Improves 20930 by adding some tests and being more resilient to changes in test
machine configuration.
Also integrates log file tests (used by
https://bugs.eclipse.org/bugs/show_bug.cgi?id=95349).
Comment 7 Maxime Daniel CLA 2005-05-19 06:51:16 EDT
(In reply to comment #6)
> Also integrates log file tests (used by
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=95349).
Pls read instead https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904 (apologies).

Comment 8 Olivier Thomann CLA 2005-05-24 12:05:14 EDT
Maxime, Could you please provide a patch based on HEAD?

I cannot apply your patch (provided in comment 5) directly on top of HEAD.
Comment 9 Maxime Daniel CLA 2005-05-25 10:10:59 EDT
Created attachment 21716 [details]
Tests -- HEAD catchup (tolerate timestamps in logs, etc.)
Comment 10 Olivier Thomann CLA 2005-05-25 10:14:59 EDT
Fixed and release in HEAD.
Regression tests added in
org.eclipse.jdt.core.tests.compiler.regression.BatchCompilerTest.

Changes in:
org.eclipse.jdt.internal.compiler.batch.messages.properties
org.eclipse.jdt.internal.compiler.batch.ClasspathDirectory
org.eclipse.jdt.internal.compiler.batch.ClasspathJar
org.eclipse.jdt.internal.compiler.batch.ClasspathLocation
org.eclipse.jdt.internal.compiler.batch.FileSystem
org.eclipse.jdt.internal.compiler.batch.Main

org.eclipse.jdt.internal.compiler.env.AccessRuleSet
Comment 11 Frederic Fusier CLA 2005-05-27 10:02:42 EDT
Verified for 3.1 RC1 with build I20050527-0010.