diff options
author | Clément DAVID <clement.david@scilab.org> | 2010-05-17 15:08:42 +0200 |
---|---|---|
committer | Yann Collette <yann.collette@scilab.org> | 2010-05-21 12:41:16 +0200 |
commit | 8cdaf9c72ee18386cd8f64f3353fcc1c1b0d45dd (patch) | |
tree | dd9c6ef41dc26a95fca628325a218ecc01d08b61 /scilab | |
parent | c3be8852b0649f5ffff05947a062a3244fe41e92 (diff) | |
download | scilab-8cdaf9c72ee18386cd8f64f3353fcc1c1b0d45dd.zip scilab-8cdaf9c72ee18386cd8f64f3353fcc1c1b0d45dd.tar.gz |
Xcos: improve scicos decoding
On BIGSOM_f, the 'set' method may modify model.in size but not model.in2 size. To handle this case, InputPortElement have to catch exception and restore an always valid value.
Bug: 7130
Change-Id: Ib50cf7cd0e9b51c859a48c8fc102650137df199d
Diffstat (limited to 'scilab')
-rw-r--r-- | scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/InputPortElement.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/InputPortElement.java b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/InputPortElement.java index 7d3ad7e..3c78854 100644 --- a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/InputPortElement.java +++ b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/InputPortElement.java | |||
@@ -113,6 +113,7 @@ public class InputPortElement extends AbstractElement<InputPort> { | |||
113 | private InputPort allocatePort() { | 113 | private InputPort allocatePort() { |
114 | InputPort ret; | 114 | InputPort ret; |
115 | ScilabType inImpl = graphics.get(GRAPHICS_INIMPL_INDEX); | 115 | ScilabType inImpl = graphics.get(GRAPHICS_INIMPL_INDEX); |
116 | |||
116 | /* | 117 | /* |
117 | * backward compatibility, use explicit as default. | 118 | * backward compatibility, use explicit as default. |
118 | */ | 119 | */ |
@@ -166,7 +167,12 @@ public class InputPortElement extends AbstractElement<InputPort> { | |||
166 | // The number of column of the port | 167 | // The number of column of the port |
167 | int nbColumns; | 168 | int nbColumns; |
168 | if (dataColumns.getRealPart() != null) { | 169 | if (dataColumns.getRealPart() != null) { |
169 | nbColumns = (int) dataColumns.getRealPart()[alreadyDecodedCount][0]; | 170 | |
171 | try { | ||
172 | nbColumns = (int) dataColumns.getRealPart()[alreadyDecodedCount][0]; | ||
173 | } catch (ArrayIndexOutOfBoundsException e) { | ||
174 | nbColumns = 1; | ||
175 | } | ||
170 | } else { | 176 | } else { |
171 | nbColumns = 1; | 177 | nbColumns = 1; |
172 | } | 178 | } |