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

Bug 333044

Summary: [compiler] Batch compiler does use -encoding to compile sources loaded on demand
Product: [Eclipse Project] JDT Reporter: Gennady Agranov <gagranov>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, Olivier_Thomann
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Gennady Agranov CLA 2010-12-21 16:03:45 EST
Build Identifier: 

If you specify -encoding ABC <sources> - all sources will be compiled using ABC encoding

But if some of the sources are not listed in the command line but loaded from -sourcepath location - they will be compiled with null encoding

it is not compatible with javac though I do not know whether it is a bug or not

Possible fix is to change call to setPaths in Main.configure - it passes customEncoding which is always null at this point.

defaultEncoding should be passes instead.




Reproducible: Always
Comment 1 Ayushman Jain CLA 2010-12-22 01:01:05 EST
Olivier, is this supposed to be the desired behaviour ?
Comment 2 Olivier Thomann CLA 2011-01-05 14:42:38 EST
Ayushman, I think we should pass it the specified encoding if we have it.
Before we should investigate exactly how javac is working when -sourcepath is mixed up with -encoding.

Thanks for investigating this.
Comment 3 Ayushman Jain CLA 2011-01-06 03:31:41 EST
Gennady, a small test case to reproduce this issue will be a great help. Thanks in advance!
Comment 4 Eclipse Genie CLA 2020-01-14 17:44:02 EST
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.