Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Isn't this index wrong?
 Post subject: Isn't this index wrong? Post rating: 0   New post Posted: Tue 07 Oct, 2014, 14:31 

User rating: 1
Joined: Tue 14 Jan, 2014, 16:13
Posts: 21
Location: United KingdomUnited Kingdom
In the JForex platform, creation of a new indicator produces boilerplate code that includes these two methods:
public OptInputParameterInfo getOptInputParameterInfo(int index) {
        if (index <= optInputParameterInfos.length) {
            return optInputParameterInfos[index];
        }
        return null;
    }

    public OutputParameterInfo getOutputParameterInfo(int index) {
        if (index <= outputParameterInfos.length) {
            return outputParameterInfos[index];
        }
        return null;
    }

Surely the two occurrences of "<=" here should be "<", since if an array has length N, trying to access element N gives an out of bounds error?


 
 Post subject: Re: Isn't this index wrong? Post rating: 0   New post Posted: Tue 07 Oct, 2014, 15:47 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Looks like it is. We will fix that.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com