diff options
author | Pekka Enberg <penberg@kernel.org> | 2011-03-14 19:35:48 +0000 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2011-03-14 19:35:48 +0000 |
commit | 28789fb0abb54b1d4451516ec459edd71f37a72b (patch) | |
tree | c5cac6caab7c23f95fa17aa46943fe95f9c3c3b3 /ChangeLog | |
parent | c66bb894bbb5b92fee599155b29d9081567e379a (diff) | |
download | classpath-28789fb0abb54b1d4451516ec459edd71f37a72b.tar.gz |
Fix Use ArrayList.set() in StyleSheet.resolveStyle
The following cleanup patch:
More warning fixes.
2009-03-09 Andrew John Hughes <ahughes@redhat.com>
[snip]
* javax/swing/text/html/StyleSheet.java:
Add generic typing.
changed the code to do ArrayList.set() on an instance thats allocated like this:
List<Map<String,String>> attributes =
new ArrayList<Map<String,String>>(count);
This is, however, broken as ArrayList constructor only ensures capacity but
doesn't allow you to set() elements outside of ArrayList.size(). This causes
the following exception to happen upon JPC start-up:
penberg@jaguar:~/testing/jato$ /usr/local/jamvm/bin/jamvm -jar JPCApplication.jar
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.VMClass.forName(Native Method)
at java.lang.Class.forName(Class.java:233)
at jamvm.java.lang.JarLauncher.main(JarLauncher.java:46)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.raiseBoundsError(ArrayList.java:504)
at java.util.ArrayList.checkBoundExclusive(ArrayList.java:490)
at java.util.ArrayList.set(ArrayList.java:323)
at javax.swing.text.html.StyleSheet.resolveStyle(StyleSheet.java:417)
at javax.swing.text.html.StyleSheet.getResolvedStyle(StyleSheet.java:376)
at javax.swing.text.html.StyleSheet.getRule(StyleSheet.java:358)
at javax.swing.text.html.ViewAttributeSet.<init>(ViewAttributeSet.java:112)
at javax.swing.text.html.StyleSheet.getViewAttributes(StyleSheet.java:562)
[snip]
Fix that up.
2011-03-14 Pekka Enberg <penberg@kernel.org>
* javax/swing/text/html/StyleSheet.java:
(resolveStyle()): Fix misuse of ArrayList.set().
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2011-03-14 Pekka Enberg <penberg@kernel.org> + + * javax/swing/text/html/StyleSheet.java: + (resolveStyle()): Fix misuse of ArrayList.set(). + 2011-02-22 Andrew John Hughes <ahughes@redhat.com> PR classpath/42390 |