Closed rasoulinejad closed 5 years ago
Hi, before we can look at this, please could you fill provide us with the following information:
From the issue template, please let us know which client this bug is from:
Could you clarify if possible, the arguments that you are calling subscribe with please? Are you seeing any other errors?
Bug exists Release Version 1.2.0 ( Master Branch)
qos[i] = grantedQos[i] ; // *** this line cause exception ****
We would need more information on the circumstances that caused this error. Thanks.
java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 at org.eclipse.paho.client.mqttv3.MqttClient.subscribe(MqttClient.java:435) at org.eclipse.paho.client.mqttv3.MqttClient.subscribe(MqttClient.java:424)
public void subscribe(String[] topicFilters, int[] qos) throws MqttException { IMqttToken tok = this.aClient.subscribe(topicFilters, qos, (Object)null, (IMqttActionListener)null); tok.waitForCompletion(this.getTimeToWait()); int[] grantedQos = tok.getGrantedQos(); for(int i = 0; i < grantedQos.length; ++i) { qos[i] = grantedQos[i] ; // *** this line cause exception **** } if(grantedQos.length == 1 && qos[0] == 128) { throw new MqttException(128); } }