Commit fd8e133
Add a generic parameter <E> to getExternalInstance (#986)
* Add a generic parameter <E> to getExternalInstance
To avoid getting warning: [unchecked] unchecked cast when generated code uses this method.
So now instead of being declared as
public ArrayList getExternalInstance()
it is declared as
public <E> ArrayList<E> getExternalInstance()
with <E> being the type parameter.
You can then call the method passing an explicit parameter, e.g.:
chatHistory.<OpenAIResponse.Message>getExternalInstance();
which we currently don't generate, but just using
chatHistory.getExternalInstance();
also does not yield a warning.
* Add generics ni array creation and cast in add method
---------
Co-authored-by: Gustavo Brown Rodriguez <gustavo.brown@globant.com>
Co-authored-by: iroqueta <iroqueta@genexus.com>1 parent b977075 commit fd8e133
1 file changed
+3
-3
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
| 103 | + | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
0 commit comments