]
Petr Široký resolved DROOLS-271.
--------------------------------
Fix Version/s: 6.1.0.Final
Resolution: Done
Overriden encoding taken from InputStreamReader in ReaderResource
constructor
-----------------------------------------------------------------------------
Key: DROOLS-271
URL:
https://issues.jboss.org/browse/DROOLS-271
Project: Drools
Issue Type: Bug
Affects Versions: 6.0.0.CR3
Environment: All platforms.
Reporter: Jacek Walkowiak
Assignee: Petr Široký
Priority: Minor
Labels: encoding, read-resource
Fix For: 6.1.0.Final
If encoding of resource is passes as null and reader is InputStreamReader encoding taken
from reader is overriden to null.
"this.encoding = encoding;" should be in else block in my opinion.
public ReaderResource(Reader reader, String encoding, ResourceType type ) {
if ( reader == null ) {
throw new IllegalArgumentException( "reader cannot be null" );
}
if ( encoding == null && reader instanceof InputStreamReader ) {
this.encoding = ((InputStreamReader)reader).getEncoding(); <== encoding
assigned here
}
this.reader = reader;
this.encoding = encoding; <== encoding assigned to null
setResourceType( type );
this.timestamp = System.currentTimeMillis();
this.lastRead = this.timestamp;
}