DhavalSPatel / googlechartwrapper

Automatically exported from code.google.com/p/googlechartwrapper
0 stars 0 forks source link

Color.getMatchingColorHexValue - causes Exception and contains System.out.println #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

de.toolforge.googlechartwrapper.Color c = new 
de.toolforge.googlechartwrapper.Color(255, 255, 255, 0);

String rgba = c.getMatchingColorHexValue();

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String 
index out of range: 8
    at java.lang.String.substring(Unknown Source)
    at de.toolforge.googlechartwrapper.Color.getEightCharacterHexValue(Color.java:175)
    at de.toolforge.googlechartwrapper.Color.getMatchingColorHexValue(Color.java:234)
    at com.thunderingherd.incubator.chart.Test.main(Test.java:12)

What is the expected output? What do you see instead?

No exception and no output to std out.

What version of the product are you using? On what operating system?

revision 189, Win 7.

Please provide any additional information below.

As a work around, I replaced getEightCharacterHexValue with the following:

    public String getEightCharacterHexValue() {
        return String.format("%02x%02x%02x%02x", red, green, blue, alpha);
    }

Original issue reported on code.google.com by chris.lo...@gmail.com on 13 Feb 2011 at 11:52

GoogleCodeExporter commented 9 years ago

Original comment by steffan....@outlook.com on 15 Feb 2011 at 9:32

GoogleCodeExporter commented 9 years ago

Original comment by steffan....@outlook.com on 15 Feb 2011 at 9:34