diff options
author | Jürg Billeter <j@bitron.ch> | 2010-03-20 12:10:54 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2010-03-20 12:10:54 +0100 |
commit | 98602e201c4032bac943ede2149f6de62a1d8f4f (patch) | |
tree | 856f4f52ca59126178d052101008266a038676ae | |
parent | 898564ab223f016484bc792b7b32cfd6d7040f28 (diff) | |
download | vala-98602e201c4032bac943ede2149f6de62a1d8f4f.tar.gz |
Drop ReadOnly* collection classes
They are not very useful in the compiler as they are not immutable,
which means that they do not allow iteration while modifying the
underlying collection.
39 files changed, 78 insertions, 452 deletions
diff --git a/ccode/valaccodecommaexpression.vala b/ccode/valaccodecommaexpression.vala index 7f16ffd94..6010428e0 100644 --- a/ccode/valaccodecommaexpression.vala +++ b/ccode/valaccodecommaexpression.vala @@ -42,7 +42,7 @@ public class Vala.CCodeCommaExpression : CCodeExpression { } public List<CCodeExpression> get_inner () { - return new ReadOnlyList<CCodeExpression> (inner); + return inner; } public override void write (CCodeWriter writer) { diff --git a/ccode/valaccodefragment.vala b/ccode/valaccodefragment.vala index e13c4e385..0e229fffa 100644 --- a/ccode/valaccodefragment.vala +++ b/ccode/valaccodefragment.vala @@ -43,7 +43,7 @@ public class Vala.CCodeFragment : CCodeNode { * @return children list */ public List<CCodeNode> get_children () { - return new ReadOnlyList<CCodeNode> (children); + return children; } public override void write (CCodeWriter writer) { diff --git a/ccode/valaccodefunctioncall.vala b/ccode/valaccodefunctioncall.vala index ffa659501..e9e7d14c3 100644 --- a/ccode/valaccodefunctioncall.vala +++ b/ccode/valaccodefunctioncall.vala @@ -56,7 +56,7 @@ public class Vala.CCodeFunctionCall : CCodeExpression { * @return list of arguments */ public List<CCodeExpression> get_arguments () { - return new ReadOnlyList<CCodeExpression> (arguments); + return arguments; } public override void write (CCodeWriter writer) { diff --git a/gee/Makefile.am b/gee/Makefile.am index 322ca63b6..5b358c56d 100644 --- a/gee/Makefile.am +++ b/gee/Makefile.am @@ -21,10 +21,6 @@ libgee_la_VALASOURCES = \ iterator.vala \ list.vala \ map.vala \ - readonlycollection.vala \ - readonlylist.vala \ - readonlymap.vala \ - readonlyset.vala \ set.vala \ $(NULL) diff --git a/gee/readonlycollection.vala b/gee/readonlycollection.vala deleted file mode 100644 index d0e34584c..000000000 --- a/gee/readonlycollection.vala +++ /dev/null @@ -1,85 +0,0 @@ -/* readonlycollection.vala - * - * Copyright (C) 2007-2008 Jürg Billeter - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: - * Jürg Billeter <j@bitron.ch> - */ - -using GLib; - -/** - * Represents a read-only collection of items. - */ -public class Vala.ReadOnlyCollection<G> : CollectionObject, Iterable<G>, Collection<G> { - public int size { - get { return _collection.size; } - } - - public Collection<G> collection { - set { _collection = value; } - } - - private Collection<G> _collection; - - public ReadOnlyCollection (Collection<G>? collection = null) { - this.collection = collection; - } - - public Type get_element_type () { - return typeof (G); - } - - public Vala.Iterator<G> iterator () { - if (_collection == null) { - return new Iterator<G> (); - } - - return _collection.iterator (); - } - - public bool contains (G item) { - if (_collection == null) { - return false; - } - - return _collection.contains (item); - } - - public bool add (G item) { - assert_not_reached (); - } - - public bool remove (G item) { - assert_not_reached (); - } - - public void clear () { - assert_not_reached (); - } - - private class Iterator<G> : CollectionObject, Vala.Iterator<G> { - public bool next () { - return false; - } - - public G? get () { - return null; - } - } -} - diff --git a/gee/readonlylist.vala b/gee/readonlylist.vala deleted file mode 100644 index d3793bf9a..000000000 --- a/gee/readonlylist.vala +++ /dev/null @@ -1,113 +0,0 @@ -/* readonlylist.vala - * - * Copyright (C) 2007-2008 Jürg Billeter - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: - * Jürg Billeter <j@bitron.ch> - */ - -using GLib; - -/** - * Represents a read-only collection of items in a well-defined order. - */ -public class Vala.ReadOnlyList<G> : CollectionObject, Iterable<G>, Collection<G>, List<G> { - public int size { - get { return _list.size; } - } - - public List<G> list { - set { _list = value; } - } - - private List<G> _list; - - public ReadOnlyList (List<G>? list = null) { - this.list = list; - } - - public Type get_element_type () { - return typeof (G); - } - - public Vala.Iterator<G> iterator () { - if (_list == null) { - return new Iterator<G> (); - } - - return _list.iterator (); - } - - public bool contains (G item) { - if (_list == null) { - return false; - } - - return _list.contains (item); - } - - public int index_of (G item) { - if (_list == null) { - return -1; - } - - return _list.index_of (item); - } - - public bool add (G item) { - assert_not_reached (); - } - - public bool remove (G item) { - assert_not_reached (); - } - - public void insert (int index, G item) { - assert_not_reached (); - } - - public void remove_at (int index) { - assert_not_reached (); - } - - public G? get (int index) { - if (_list == null) { - return null; - } - - return _list.get (index); - } - - public void set (int index, G o) { - assert_not_reached (); - } - - public void clear () { - assert_not_reached (); - } - - class Iterator<G> : CollectionObject, Vala.Iterator<G> { - public bool next () { - return false; - } - - public G? get () { - return null; - } - } -} - diff --git a/gee/readonlymap.vala b/gee/readonlymap.vala deleted file mode 100644 index 264cbee3e..000000000 --- a/gee/readonlymap.vala +++ /dev/null @@ -1,87 +0,0 @@ -/* readonlymap.vala - * - * Copyright (C) 2007-2008 Jürg Billeter - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: - * Jürg Billeter <j@bitron.ch> - */ - -using GLib; - -/** - * Represents a read-only collection of key/value pairs. - */ -public class Vala.ReadOnlyMap<K,V> : CollectionObject, Map<K,V> { - public int size { - get { return _map.size; } - } - - public Map<K,V> map { - set { _map = value; } - } - - private Map<K,V> _map; - - public ReadOnlyMap (Map<K,V>? map = null) { - this.map = map; - } - - public Set<K> get_keys () { - if (_map == null) { - return new ReadOnlySet<K> (); - } - - return _map.get_keys (); - } - - public Collection<V> get_values () { - if (_map == null) { - return new ReadOnlyCollection<V> (); - } - - return _map.get_values (); - } - - public bool contains (K key) { - if (_map == null) { - return false; - } - - return _map.contains (key); - } - - public V? get (K key) { - if (_map == null) { - return null; - } - - return _map.get (key); - } - - public void set (K key, V value) { - assert_not_reached (); - } - - public bool remove (K key) { - assert_not_reached (); - } - - public void clear () { - assert_not_reached (); - } -} - diff --git a/gee/readonlyset.vala b/gee/readonlyset.vala deleted file mode 100644 index 3d8034373..000000000 --- a/gee/readonlyset.vala +++ /dev/null @@ -1,85 +0,0 @@ -/* readonlyset.vala - * - * Copyright (C) 2007-2008 Jürg Billeter - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: - * Jürg Billeter <j@bitron.ch> - */ - -using GLib; - -/** - * Represents a read-only collection of items without duplicates. - */ -public class Vala.ReadOnlySet<G> : CollectionObject, Iterable<G>, Collection<G>, Set<G> { - public int size { - get { return _set.size; } - } - - public Set<G> set { - set { _set = value; } - } - - private Set<G> _set; - - public ReadOnlySet (Set<G>? set = null) { - this.set = set; - } - - public Type get_element_type () { - return typeof (G); - } - - public Vala.Iterator<G> iterator () { - if (_set == null) { - return new Iterator<G> (); - } - - return _set.iterator (); - } - - public bool contains (G item) { - if (_set == null) { - return false; - } - - return _set.contains (item); - } - - public bool add (G item) { - assert_not_reached (); - } - - public bool remove (G item) { - assert_not_reached (); - } - - public void clear () { - assert_not_reached (); - } - - private class Iterator<G> : CollectionObject, Vala.Iterator<G> { - public bool next () { - return false; - } - - public G? get () { - return null; - } - } -} - diff --git a/vala/valaarraycreationexpression.vala b/vala/valaarraycreationexpression.vala index c2cb9af9a..80f4367cb 100644 --- a/vala/valaarraycreationexpression.vala +++ b/vala/valaarraycreationexpression.vala @@ -79,7 +79,7 @@ public class Vala.ArrayCreationExpression : Expression { * Get the sizes for all dimensions ascending from left to right. */ public List<Expression> get_sizes () { - return new ReadOnlyList<Expression> (sizes); + return sizes; } public ArrayCreationExpression (DataType element_type, int rank, InitializerList? initializer_list, SourceReference source_reference) { diff --git a/vala/valabasicblock.vala b/vala/valabasicblock.vala index 7339224d5..ef32e051e 100644 --- a/vala/valabasicblock.vala +++ b/vala/valabasicblock.vala @@ -70,11 +70,11 @@ public class Vala.BasicBlock { } public List<weak BasicBlock> get_predecessors () { - return new ReadOnlyList<weak BasicBlock> (predecessors); + return predecessors; } public List<weak BasicBlock> get_successors () { - return new ReadOnlyList<weak BasicBlock> (successors); + return successors; } public void add_child (BasicBlock block) { diff --git a/vala/valablock.vala b/vala/valablock.vala index 59eba4467..3a7eac7aa 100644 --- a/vala/valablock.vala +++ b/vala/valablock.vala @@ -108,7 +108,7 @@ public class Vala.Block : Symbol, Statement { * @return variable declarator list */ public List<LocalVariable> get_local_variables () { - return new ReadOnlyList<LocalVariable> (local_variables); + return local_variables; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valaclass.vala b/vala/valaclass.vala index dd39f8f18..4fc73a24c 100644 --- a/vala/valaclass.vala +++ b/vala/valaclass.vala @@ -146,7 +146,7 @@ public class Vala.Class : ObjectTypeSymbol { * @return list of classes */ public List<Class> get_classes () { - return new ReadOnlyList<Class> (classes); + return classes; } /** @@ -155,7 +155,7 @@ public class Vala.Class : ObjectTypeSymbol { * @return list of structs */ public List<Struct> get_structs () { - return new ReadOnlyList<Struct> (structs); + return structs; } /** @@ -164,7 +164,7 @@ public class Vala.Class : ObjectTypeSymbol { * @return list of enums */ public List<Enum> get_enums () { - return new ReadOnlyList<Enum> (enums); + return enums; } /** @@ -173,7 +173,7 @@ public class Vala.Class : ObjectTypeSymbol { * @return list of delegates */ public List<Delegate> get_delegates () { - return new ReadOnlyList<Delegate> (delegates); + return delegates; } /** @@ -263,7 +263,7 @@ public class Vala.Class : ObjectTypeSymbol { * @return list of base types */ public List<DataType> get_base_types () { - return new ReadOnlyList<DataType> (base_types); + return base_types; } /** @@ -297,7 +297,7 @@ public class Vala.Class : ObjectTypeSymbol { * @return list of fields */ public List<Field> get_fields () { - return new ReadOnlyList<Field> (fields); + return fields; } /** @@ -306,7 +306,7 @@ public class Vala.Class : ObjectTypeSymbol { * @return list of constants */ public List<Constant> get_constants () { - return new ReadOnlyList<Constant> (constants); + return constants; } /** @@ -354,7 +354,7 @@ public class Vala.Class : ObjectTypeSymbol { * @return list of methods */ public override List<Method> get_methods () { - return new ReadOnlyList<Method> (methods); + return methods; } /** @@ -380,7 +380,7 @@ public class Vala.Class : ObjectTypeSymbol { * @return list of properties */ public override List<Property> get_properties () { - return new ReadOnlyList<Property> (properties); + return properties; } /** @@ -399,7 +399,7 @@ public class Vala.Class : ObjectTypeSymbol { * @return list of signals */ public override List<Signal> get_signals () { - return new ReadOnlyList<Signal> (signals); + return signals; } /** diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala index c1559f113..9b24fcb07 100644 --- a/vala/valacodecontext.vala +++ b/vala/valacodecontext.vala @@ -229,7 +229,7 @@ public class Vala.CodeContext { * @return list of source files */ public List<SourceFile> get_source_files () { - return new ReadOnlyList<SourceFile> (source_files); + return source_files; } /** @@ -238,7 +238,7 @@ public class Vala.CodeContext { * @return list of C source files */ public List<string> get_c_source_files () { - return new ReadOnlyList<string> (c_source_files); + return c_source_files; } /** @@ -265,7 +265,7 @@ public class Vala.CodeContext { * @return list of used packages */ public List<string> get_packages () { - return new ReadOnlyList<string> (packages); + return packages; } /** diff --git a/vala/valacodenode.vala b/vala/valacodenode.vala index 8f83cfd50..feaf60ad3 100644 --- a/vala/valacodenode.vala +++ b/vala/valacodenode.vala @@ -96,7 +96,7 @@ public abstract class Vala.CodeNode { return _error_types; } if (_empty_type_list == null) { - _empty_type_list = new ReadOnlyList<DataType> (new ArrayList<DataType> ()); + _empty_type_list = new ArrayList<DataType> (); } return _empty_type_list; } diff --git a/vala/valadatatype.vala b/vala/valadatatype.vala index bba74622f..2027bb9a2 100644 --- a/vala/valadatatype.vala +++ b/vala/valadatatype.vala @@ -85,7 +85,7 @@ public abstract class Vala.DataType : CodeNode { return type_argument_list; } if (_empty_type_list == null) { - _empty_type_list = new ReadOnlyList<DataType> (new ArrayList<DataType> ()); + _empty_type_list = new ArrayList<DataType> (); } return _empty_type_list; } diff --git a/vala/valadelegate.vala b/vala/valadelegate.vala index a882d3a2a..d152714ac 100644 --- a/vala/valadelegate.vala +++ b/vala/valadelegate.vala @@ -130,7 +130,7 @@ public class Vala.Delegate : TypeSymbol { * @return parameter list */ public List<FormalParameter> get_parameters () { - return new ReadOnlyList<FormalParameter> (parameters); + return parameters; } /** diff --git a/vala/valaelementaccess.vala b/vala/valaelementaccess.vala index c96ee7a03..8f9bd165f 100644 --- a/vala/valaelementaccess.vala +++ b/vala/valaelementaccess.vala @@ -54,7 +54,7 @@ public class Vala.ElementAccess : Expression { } public List<Expression> get_indices () { - return new ReadOnlyList<Expression> (indices); + return indices; } public ElementAccess (Expression container, SourceReference source_reference) { diff --git a/vala/valaenum.vala b/vala/valaenum.vala index 0e488adb6..f5c21489b 100644 --- a/vala/valaenum.vala +++ b/vala/valaenum.vala @@ -96,7 +96,7 @@ public class Vala.Enum : TypeSymbol { * @return list of enum values */ public List<EnumValue> get_values () { - return new ReadOnlyList<EnumValue> (values); + return values; } /** @@ -105,7 +105,7 @@ public class Vala.Enum : TypeSymbol { * @return list of methods */ public List<Method> get_methods () { - return new ReadOnlyList<Method> (methods); + return methods; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valaerrordomain.vala b/vala/valaerrordomain.vala index 7ccc78aad..dbc6b4567 100644 --- a/vala/valaerrordomain.vala +++ b/vala/valaerrordomain.vala @@ -81,7 +81,7 @@ public class Vala.ErrorDomain : TypeSymbol { * @return list of error codes */ public List<ErrorCode> get_codes () { - return new ReadOnlyList<ErrorCode> (codes); + return codes; } /** @@ -90,7 +90,7 @@ public class Vala.ErrorDomain : TypeSymbol { * @return list of methods */ public List<Method> get_methods () { - return new ReadOnlyList<Method> (methods); + return methods; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valaexpression.vala b/vala/valaexpression.vala index 334ed2986..afd54aa0c 100644 --- a/vala/valaexpression.vala +++ b/vala/valaexpression.vala @@ -101,7 +101,7 @@ public abstract class Vala.Expression : CodeNode { * ascending from left to right. */ public List<CCodeExpression> get_array_sizes () { - return new ReadOnlyList<CCodeExpression> (array_sizes); + return array_sizes; } public Statement? parent_statement { diff --git a/vala/valaforstatement.vala b/vala/valaforstatement.vala index 44fac128a..99301fe9f 100644 --- a/vala/valaforstatement.vala +++ b/vala/valaforstatement.vala @@ -90,7 +90,7 @@ public class Vala.ForStatement : CodeNode, Statement { * @return initializer list */ public List<Expression> get_initializer () { - return new ReadOnlyList<Expression> (initializer); + return initializer; } /** @@ -109,7 +109,7 @@ public class Vala.ForStatement : CodeNode, Statement { * @return iterator */ public List<Expression> get_iterator () { - return new ReadOnlyList<Expression> (iterator); + return iterator; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valainitializerlist.vala b/vala/valainitializerlist.vala index 82aa6e91e..927f5cee2 100644 --- a/vala/valainitializerlist.vala +++ b/vala/valainitializerlist.vala @@ -46,7 +46,7 @@ public class Vala.InitializerList : Expression { * @return expression list */ public List<Expression> get_initializers () { - return new ReadOnlyList<Expression> (initializers); + return initializers; } /** diff --git a/vala/valainterface.vala b/vala/valainterface.vala index a76998aa7..0ff381d17 100644 --- a/vala/valainterface.vala +++ b/vala/valainterface.vala @@ -51,7 +51,7 @@ public class Vala.Interface : ObjectTypeSymbol { * @return list of classes */ public List<Class> get_classes () { - return new ReadOnlyList<Class> (classes); + return classes; } /** @@ -60,7 +60,7 @@ public class Vala.Interface : ObjectTypeSymbol { * @return list of structs */ public List<Struct> get_structs () { - return new ReadOnlyList<Struct> (structs); + return structs; } /** @@ -69,7 +69,7 @@ public class Vala.Interface : ObjectTypeSymbol { * @return list of enums */ public List<Enum> get_enums () { - return new ReadOnlyList<Enum> (enums); + return enums; } /** @@ -78,7 +78,7 @@ public class Vala.Interface : ObjectTypeSymbol { * @return list of delegates */ public List<Delegate> get_delegates () { - return new ReadOnlyList<Delegate> (delegates); + return delegates; } /** @@ -119,7 +119,7 @@ public class Vala.Interface : ObjectTypeSymbol { * @return list of base types */ public List<DataType> get_prerequisites () { - return new ReadOnlyList<DataType> (prerequisites); + return prerequisites; } /** @@ -153,7 +153,7 @@ public class Vala.Interface : ObjectTypeSymbol { * @return list of methods */ public override List<Method> get_methods () { - return new ReadOnlyList<Method> (methods); + return methods; } /** @@ -173,7 +173,7 @@ public class Vala.Interface : ObjectTypeSymbol { * @return list of fields */ public List<Field> get_fields () { - return new ReadOnlyList<Field> (fields); + return fields; } /** @@ -192,7 +192,7 @@ public class Vala.Interface : ObjectTypeSymbol { * @return list of constants */ public List<Constant> get_constants () { - return new ReadOnlyList<Constant> (constants); + return constants; } /** @@ -214,7 +214,7 @@ public class Vala.Interface : ObjectTypeSymbol { * @return list of properties */ public override List<Property> get_properties () { - return new ReadOnlyList<Property> (properties); + return properties; } /** @@ -233,7 +233,7 @@ public class Vala.Interface : ObjectTypeSymbol { * @return list of signals */ public override List<Signal> get_signals () { - return new ReadOnlyList<Signal> (signals); + return signals; } /** diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala index a6c2dba9b..25e54b0f6 100644 --- a/vala/valalambdaexpression.vala +++ b/vala/valalambdaexpression.vala @@ -85,7 +85,7 @@ public class Vala.LambdaExpression : Expression { * @return parameter list */ public List<string> get_parameters () { - return new ReadOnlyList<string> (parameters); + return parameters; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valamember.vala b/vala/valamember.vala index 602c06a65..1c25c3619 100644 --- a/vala/valamember.vala +++ b/vala/valamember.vala @@ -57,7 +57,7 @@ public abstract class Vala.Member : Symbol { cheader_filenames.add (source_reference.file.get_cinclude_filename ()); } } - return new ReadOnlyList<string> (cheader_filenames); + return cheader_filenames; } diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala index 5e95a98ca..ebb60d941 100644 --- a/vala/valamemberaccess.vala +++ b/vala/valamemberaccess.vala @@ -112,7 +112,7 @@ public class Vala.MemberAccess : Expression { * @return type argument list */ public List<DataType> get_type_arguments () { - return new ReadOnlyList<DataType> (type_argument_list); + return type_argument_list; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valamethod.vala b/vala/valamethod.vala index f98336e62..04ec4230e 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -281,7 +281,7 @@ public class Vala.Method : Member { } public List<FormalParameter> get_parameters () { - return new ReadOnlyList<FormalParameter> (parameters); + return parameters; } /** @@ -579,7 +579,7 @@ public class Vala.Method : Member { * @return list of type parameters */ public List<TypeParameter> get_type_parameters () { - return new ReadOnlyList<TypeParameter> (type_parameters); + return type_parameters; } public int get_type_parameter_index (string name) { @@ -609,7 +609,7 @@ public class Vala.Method : Member { * @return list of preconditions */ public List<Expression> get_preconditions () { - return new ReadOnlyList<Expression> (preconditions); + return preconditions; } /** @@ -628,7 +628,7 @@ public class Vala.Method : Member { * @return list of postconditions */ public List<Expression> get_postconditions () { - return new ReadOnlyList<Expression> (postconditions); + return postconditions; } public override void replace_type (DataType old_type, DataType new_type) { diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala index 7db46ba4d..047df7e63 100644 --- a/vala/valamethodcall.vala +++ b/vala/valamethodcall.vala @@ -73,7 +73,7 @@ public class Vala.MethodCall : Expression { * @return argument list */ public List<Expression> get_argument_list () { - return new ReadOnlyList<Expression> (argument_list); + return argument_list; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valanamespace.vala b/vala/valanamespace.vala index e3a0f9037..1417f1006 100644 --- a/vala/valanamespace.vala +++ b/vala/valanamespace.vala @@ -78,7 +78,7 @@ public class Vala.Namespace : Symbol { * @return comment list */ public List<Comment> get_comments () { - return new ReadOnlyList<Comment> (comments); + return comments; } /** @@ -142,7 +142,7 @@ public class Vala.Namespace : Symbol { * @return namespace list */ public List<Namespace> get_namespaces () { - return new ReadOnlyList<Namespace> (namespaces); + return namespaces; } /** @@ -251,7 +251,7 @@ public class Vala.Namespace : Symbol { * @return struct list */ public List<Struct> get_structs () { - return new ReadOnlyList<Struct> (structs); + return structs; } /** @@ -260,7 +260,7 @@ public class Vala.Namespace : Symbol { * @return class list */ public List<Class> get_classes () { - return new ReadOnlyList<Class> (classes); + return classes; } /** @@ -269,7 +269,7 @@ public class Vala.Namespace : Symbol { * @return interface list */ public List<Interface> get_interfaces () { - return new ReadOnlyList<Interface> (interfaces); + return interfaces; } /** @@ -278,7 +278,7 @@ public class Vala.Namespace : Symbol { * @return enum list */ public List<Enum> get_enums () { - return new ReadOnlyList<Enum> (enums); + return enums; } /** @@ -287,7 +287,7 @@ public class Vala.Namespace : Symbol { * @return error domain list */ public List<ErrorDomain> get_error_domains () { - return new ReadOnlyList<ErrorDomain> (error_domains); + return error_domains; } /** @@ -296,7 +296,7 @@ public class Vala.Namespace : Symbol { * @return field list */ public List<Field> get_fields () { - return new ReadOnlyList<Field> (fields); + return fields; } /** @@ -305,7 +305,7 @@ public class Vala.Namespace : Symbol { * @return constant list */ public List<Constant> get_constants () { - return new ReadOnlyList<Constant> (constants); + return constants; } /** @@ -314,7 +314,7 @@ public class Vala.Namespace : Symbol { * @return delegate list */ public List<Delegate> get_delegates () { - return new ReadOnlyList<Delegate> (delegates); + return delegates; } /** @@ -323,7 +323,7 @@ public class Vala.Namespace : Symbol { * @return method list */ public List<Method> get_methods () { - return new ReadOnlyList<Method> (methods); + return methods; } /** @@ -518,7 +518,7 @@ public class Vala.Namespace : Symbol { } public override List<string> get_cheader_filenames () { - return new ReadOnlyList<string> (cheader_filenames); + return cheader_filenames; } /** diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala index 9f1def9e4..2c8ad17b3 100644 --- a/vala/valaobjectcreationexpression.vala +++ b/vala/valaobjectcreationexpression.vala @@ -85,7 +85,7 @@ public class Vala.ObjectCreationExpression : Expression { * @return argument list */ public List<Expression> get_argument_list () { - return new ReadOnlyList<Expression> (argument_list); + return argument_list; } /** @@ -104,7 +104,7 @@ public class Vala.ObjectCreationExpression : Expression { * @return member initializer list */ public List<MemberInitializer> get_object_initializer () { - return new ReadOnlyList<MemberInitializer> (object_initializer); + return object_initializer; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valaobjecttypesymbol.vala b/vala/valaobjecttypesymbol.vala index 8849ae7ee..c7dec45ae 100644 --- a/vala/valaobjecttypesymbol.vala +++ b/vala/valaobjecttypesymbol.vala @@ -55,7 +55,7 @@ public abstract class Vala.ObjectTypeSymbol : TypeSymbol { * @return list of type parameters */ public List<TypeParameter> get_type_parameters () { - return new ReadOnlyList<TypeParameter> (type_parameters); + return type_parameters; } public override int get_type_parameter_index (string name) { diff --git a/vala/valascope.vala b/vala/valascope.vala index cfa2781e3..046546123 100644 --- a/vala/valascope.vala +++ b/vala/valascope.vala @@ -123,7 +123,7 @@ public class Vala.Scope { } public Map<string,Symbol> get_symbol_table () { - return new ReadOnlyMap<string,Symbol> (symbol_table); + return symbol_table; } } diff --git a/vala/valasignal.vala b/vala/valasignal.vala index 94e3623d7..1b509a36a 100644 --- a/vala/valasignal.vala +++ b/vala/valasignal.vala @@ -101,7 +101,7 @@ public class Vala.Signal : Member, Lockable { } public List<FormalParameter> get_parameters () { - return new ReadOnlyList<FormalParameter> (parameters); + return parameters; } /** diff --git a/vala/valasourcefile.vala b/vala/valasourcefile.vala index df8436694..97c6a2fd4 100644 --- a/vala/valasourcefile.vala +++ b/vala/valasourcefile.vala @@ -104,7 +104,7 @@ public class Vala.SourceFile { * @return list of comments */ public List<Comment> get_comments () { - return new ReadOnlyList<Comment> (comments); + return comments; } /** @@ -142,7 +142,7 @@ public class Vala.SourceFile { * @return code node list */ public List<CodeNode> get_nodes () { - return new ReadOnlyList<CodeNode> (nodes); + return nodes; } public void accept (CodeVisitor visitor) { diff --git a/vala/valastruct.vala b/vala/valastruct.vala index 737663576..0e5513c49 100644 --- a/vala/valastruct.vala +++ b/vala/valastruct.vala @@ -125,7 +125,7 @@ public class Vala.Struct : TypeSymbol { * @return list of type parameters */ public List<TypeParameter> get_type_parameters () { - return new ReadOnlyList<TypeParameter> (type_parameters); + return type_parameters; } /** @@ -157,7 +157,7 @@ public class Vala.Struct : TypeSymbol { * @return list of fields */ public List<Field> get_fields () { - return new ReadOnlyList<Field> (fields); + return fields; } /** @@ -166,7 +166,7 @@ public class Vala.Struct : TypeSymbol { * @return list of constants */ public List<Constant> get_constants () { - return new ReadOnlyList<Constant> (constants); + return constants; } /** @@ -210,7 +210,7 @@ public class Vala.Struct : TypeSymbol { * @return list of methods */ public List<Method> get_methods () { - return new ReadOnlyList<Method> (methods); + return methods; } /** @@ -236,7 +236,7 @@ public class Vala.Struct : TypeSymbol { * @return list of properties */ public List<Property> get_properties () { - return new ReadOnlyList<Property> (properties); + return properties; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valaswitchsection.vala b/vala/valaswitchsection.vala index 334f6a7e8..5247f3729 100644 --- a/vala/valaswitchsection.vala +++ b/vala/valaswitchsection.vala @@ -54,7 +54,7 @@ public class Vala.SwitchSection : Block { * @return switch label list */ public List<SwitchLabel> get_labels () { - return new ReadOnlyList<SwitchLabel> (labels); + return labels; } public bool has_default_label () { diff --git a/vala/valaswitchstatement.vala b/vala/valaswitchstatement.vala index b8341cd5f..eb038bbf4 100644 --- a/vala/valaswitchstatement.vala +++ b/vala/valaswitchstatement.vala @@ -70,7 +70,7 @@ public class Vala.SwitchStatement : CodeNode, Statement { * @return section list */ public List<SwitchSection> get_sections () { - return new ReadOnlyList<SwitchSection> (sections); + return sections; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valatrystatement.vala b/vala/valatrystatement.vala index 19be21c11..4bf6e7a61 100644 --- a/vala/valatrystatement.vala +++ b/vala/valatrystatement.vala @@ -83,7 +83,7 @@ public class Vala.TryStatement : CodeNode, Statement { * @return list of catch clauses */ public List<CatchClause> get_catch_clauses () { - return new ReadOnlyList<CatchClause> (catch_clauses); + return catch_clauses; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valatypesymbol.vala b/vala/valatypesymbol.vala index 2614f8af9..7be7b97ff 100644 --- a/vala/valatypesymbol.vala +++ b/vala/valatypesymbol.vala @@ -232,7 +232,7 @@ public abstract class Vala.TypeSymbol : Symbol { cheader_filenames.add (source_reference.file.get_cinclude_filename ()); } } - return new ReadOnlyList<string> (cheader_filenames); + return cheader_filenames; } /** |