Aklakan commented on code in PR #2925: URL: https://github.com/apache/jena/pull/2925#discussion_r1915156203
########## jena-arq/src/main/java/org/apache/jena/sparql/algebra/table/TableData.java: ########## @@ -18,23 +18,21 @@ package org.apache.jena.sparql.algebra.table ; +import java.util.Collections; import java.util.List ; import org.apache.jena.sparql.ARQException ; import org.apache.jena.sparql.core.Var ; import org.apache.jena.sparql.engine.binding.Binding ; +/** Immutable table. */ public class TableData extends TableN { public TableData(List<Var> variables, List<Binding> rows) { - super(variables, rows) ; + super(Collections.unmodifiableList(variables), Collections.unmodifiableList(rows)) ; Review Comment: The constructor already existed. The wrappers prevent mutation via `TableData.getRows().add()` which wasn't the case before. Its not perfect, but from your comment > It should be "immutable once built" its a step closer towards `TableData` being immutable. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org For additional commands, e-mail: pr-h...@jena.apache.org