From 5b1581025463d73762ca9eacbed78736c23af481 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 7 Mar 2024 12:44:42 +0100 Subject: [PATCH 1/5] check get before remove --- .../iot/cygnus/aggregation/NGSIGenericColumnAggregator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java index 5e75c49ea..98ea04d91 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java @@ -244,7 +244,10 @@ public void aggregate(NGSIEvent event) { if (storedTS < currentTS) { ArrayList keys = new ArrayList<>(aggregation.keySet()); for (int j = 0 ; j < keys.size() ; j++) { - lastData.get(keys.get(j)).remove(i); + ArrayList lst = lastData.get(keys.get(j)); + if (lst) { + lst.remove(i); + } } updateLastData = true; break; From 4fa7fb4fa24bc947355e4b988ebc763e6ea45bf4 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 7 Mar 2024 12:49:41 +0100 Subject: [PATCH 2/5] update CNR --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index e69de29bb..185f7e1f3 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -0,0 +1 @@ +- [cygnus-ngsi][ColumnAggregator][LastData] Fix error when remove old values in lastData which does not exist From ce219ed6a3f43b7aac74f5968b7e40f8752fc7dc Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 7 Mar 2024 12:53:29 +0100 Subject: [PATCH 3/5] fix check --- .../iot/cygnus/aggregation/NGSIGenericColumnAggregator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java index 98ea04d91..e031211b9 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java @@ -245,7 +245,7 @@ public void aggregate(NGSIEvent event) { ArrayList keys = new ArrayList<>(aggregation.keySet()); for (int j = 0 ; j < keys.size() ; j++) { ArrayList lst = lastData.get(keys.get(j)); - if (lst) { + if (lst != null) { lst.remove(i); } } From 4783125fff3a8c2724dd6d48b17af391b9069192 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 8 Mar 2024 10:13:09 +0100 Subject: [PATCH 4/5] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 185f7e1f3..c9252fbd3 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ -- [cygnus-ngsi][ColumnAggregator][LastData] Fix error when remove old values in lastData which does not exist +- [cygnus-ngsi][ColumnAggregator][LastData] Fix error when remove old values in lastData which does not exist (i.e. creating and updating entiies) From dd606807bcd804a18a45cd7657a017d88826b7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Fri, 8 Mar 2024 14:57:23 +0100 Subject: [PATCH 5/5] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index c9252fbd3..be5fff215 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ -- [cygnus-ngsi][ColumnAggregator][LastData] Fix error when remove old values in lastData which does not exist (i.e. creating and updating entiies) +- [cygnus-ngsi][ColumnAggregator][LastData] Fix error when remove old values in lastData which does not exist (i.e. creating and updating entities)