[jboss-jira] [JBoss JIRA] (DROOLS-271) Overriden encoding taken from InputStreamReader in ReaderResource constructor
Mark Proctor (JIRA)
issues at jboss.org
Thu Jul 23 13:00:08 EDT 2015
[ https://issues.jboss.org/browse/DROOLS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Proctor reassigned DROOLS-271:
-----------------------------------
Assignee: Petr Široký (was: Mark Proctor)
> 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
>
> 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;
> }
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
More information about the jboss-jira
mailing list