diff options
author | Juerg Billeter <j@bitron.ch> | 2008-04-14 19:07:37 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-04-14 19:07:37 +0000 |
commit | 89179ce042596bc60ec569a65cb9295324ff22a5 (patch) | |
tree | 56e4bda0beaa2d869adf40eef93e4b407742d7fe /gee | |
parent | 94979a22270adeab75d2bfdb74902591d7385450 (diff) | |
download | vala-89179ce042596bc60ec569a65cb9295324ff22a5.tar.gz |
report warning when using null literal as return expression of method
2008-04-14 Juerg Billeter <j@bitron.ch>
* vala/valasemanticanalyzer.vala: report warning when using null
literal as return expression of method returning non-null value
* */*.vala: fix warnings
svn path=/trunk/; revision=1228
Diffstat (limited to 'gee')
-rw-r--r-- | gee/arraylist.vala | 4 | ||||
-rw-r--r-- | gee/hashmap.vala | 6 | ||||
-rw-r--r-- | gee/hashset.vala | 2 | ||||
-rw-r--r-- | gee/iterator.vala | 4 | ||||
-rw-r--r-- | gee/list.vala | 2 | ||||
-rw-r--r-- | gee/map.vala | 2 | ||||
-rw-r--r-- | gee/readonlycollection.vala | 2 | ||||
-rw-r--r-- | gee/readonlylist.vala | 4 | ||||
-rw-r--r-- | gee/readonlymap.vala | 2 | ||||
-rw-r--r-- | gee/readonlyset.vala | 2 |
10 files changed, 15 insertions, 15 deletions
diff --git a/gee/arraylist.vala b/gee/arraylist.vala index c0a42e605..97ce9292d 100644 --- a/gee/arraylist.vala +++ b/gee/arraylist.vala @@ -68,7 +68,7 @@ public class Gee.ArrayList<G> : Object, Iterable<G>, Collection<G>, List<G> { return -1; } - public G get (int index) { + public G? get (int index) { assert (index >= 0 && index < _size); return _items[index]; @@ -178,7 +178,7 @@ public class Gee.ArrayList<G> : Object, Iterable<G>, Collection<G>, List<G> { return (_index < _list._size); } - public G get () { + public G? get () { assert (_stamp == _list._stamp); if (_index < 0 || _index >= _list._size) { diff --git a/gee/hashmap.vala b/gee/hashmap.vala index c4847ea02..9269c75bb 100644 --- a/gee/hashmap.vala +++ b/gee/hashmap.vala @@ -91,7 +91,7 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> { return (*node != null); } - public V get (K key) { + public V? get (K key) { Node<K,V>* node = (*lookup_node (key)); if (node != null) { return node->value; @@ -251,7 +251,7 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> { return (_node != null); } - public K get () { + public K? get () { assert (_stamp == _map._stamp); assert (_node != null); return _node.key; @@ -334,7 +334,7 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> { return (_node != null); } - public V get () { + public V? get () { assert (_stamp == _map._stamp); assert (_node != null); return _node.value; diff --git a/gee/hashset.vala b/gee/hashset.vala index aed8cadc0..96e85f47d 100644 --- a/gee/hashset.vala +++ b/gee/hashset.vala @@ -193,7 +193,7 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> { return (_node != null); } - public G get () { + public G? get () { assert (_stamp == _set._stamp); assert (_node != null); return _node.key; diff --git a/gee/iterator.vala b/gee/iterator.vala index d6fa94786..6642a9072 100644 --- a/gee/iterator.vala +++ b/gee/iterator.vala @@ -1,6 +1,6 @@ /* iterator.vala * - * Copyright (C) 2007 Jürg Billeter + * 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 @@ -37,6 +37,6 @@ public interface Gee.Iterator<G> : GLib.Object { * * @return the current element in the iteration */ - public abstract G get (); + public abstract G? get (); } diff --git a/gee/list.vala b/gee/list.vala index 52e864a73..d034a9107 100644 --- a/gee/list.vala +++ b/gee/list.vala @@ -31,7 +31,7 @@ public interface Gee.List<G> : Collection<G> { * * @return the item at the specified index in the list */ - public abstract G get (int index); + public abstract G? get (int index); /** * Sets the item at the specified index in this list. diff --git a/gee/map.vala b/gee/map.vala index 9c98c8cd5..78858ce40 100644 --- a/gee/map.vala +++ b/gee/map.vala @@ -60,7 +60,7 @@ public interface Gee.Map<K,V> : GLib.Object { * @return the value associated with the key, or null if the key * couldn't be found */ - public abstract V get (K key); + public abstract V? get (K key); /** * Inserts a new key and value into this map. diff --git a/gee/readonlycollection.vala b/gee/readonlycollection.vala index e0ec5637a..3a4ac77dd 100644 --- a/gee/readonlycollection.vala +++ b/gee/readonlycollection.vala @@ -77,7 +77,7 @@ public class Gee.ReadOnlyCollection<G> : Object, Iterable<G>, Collection<G> { return false; } - public G get () { + public G? get () { return null; } } diff --git a/gee/readonlylist.vala b/gee/readonlylist.vala index 27205213e..1ea988d8e 100644 --- a/gee/readonlylist.vala +++ b/gee/readonlylist.vala @@ -84,7 +84,7 @@ public class Gee.ReadOnlyList<G> : Object, Iterable<G>, Collection<G>, List<G> { assert_not_reached (); } - public G get (int index) { + public G? get (int index) { if (_list == null) { return null; } @@ -105,7 +105,7 @@ public class Gee.ReadOnlyList<G> : Object, Iterable<G>, Collection<G>, List<G> { return false; } - public G get () { + public G? get () { return null; } } diff --git a/gee/readonlymap.vala b/gee/readonlymap.vala index b891189e9..e62952703 100644 --- a/gee/readonlymap.vala +++ b/gee/readonlymap.vala @@ -64,7 +64,7 @@ public class Gee.ReadOnlyMap<K,V> : Object, Map<K,V> { return _map.contains (key); } - public V get (K key) { + public V? get (K key) { if (_map == null) { return null; } diff --git a/gee/readonlyset.vala b/gee/readonlyset.vala index 0439c8c24..15bcd52de 100644 --- a/gee/readonlyset.vala +++ b/gee/readonlyset.vala @@ -77,7 +77,7 @@ public class Gee.ReadOnlySet<G> : Object, Iterable<G>, Collection<G>, Set<G> { return false; } - public G get () { + public G? get () { return null; } } |