]> git.uio.no Git - ifi-stolz-refaktor.git/commitdiff
Thesis: ambiguous return values
authorErlend Kristiansen <erlenkr@ifi.uio.no>
Mon, 14 Apr 2014 16:20:54 +0000 (18:20 +0200)
committerErlend Kristiansen <erlenkr@ifi.uio.no>
Mon, 14 Apr 2014 16:20:54 +0000 (18:20 +0200)
thesis/master-thesis-erlenkr.tex

index 7d2de7d68f54ff87e58c9cc0a455555efc391b82..69ee2bdb713284b591e2926924eea5354803ad4e 100644 (file)
@@ -1718,6 +1718,20 @@ Try-statements are handled much the same way as if-statements. The body of a
 try-statement must contain a return or throw. The same applies to its catch 
 clauses and finally body. 
 
+\subsection{Ambiguous return values}
+The problem with ambiguous return values arise when a selection is chosen to be 
+extracted into a new method, but it needs to return more than one value from 
+that method.
+
+This problem occurs in two situations. The first situation arise when there is 
+more than one local variable that is both assigned to within a selection and 
+also referenced after the selection. The other situation occur when there is 
+only one such assignment, but the selection also contain return statements.
+
+Therefore we must examine the selection for assignments to local variables that 
+are referenced after the text selection. Then we must verify that not more than 
+one such reference is done, or zero if any return statements are found.
+
 
 \chapter{Refactorings in Eclipse JDT: Design, Shortcomings and Wishful 
 Thinking}\label{ch:jdt_refactorings}
@@ -3078,14 +3092,9 @@ If the checker does not complain at any point, the selection is considered valid
 with respect to return statements.
 
 \subsection{The AmbiguousReturnValueChecker}
-This checker verifies that there are no \emph{ambiguous return statements} in a 
-selection. The problem with ambiguous return statements arise when a selection 
-is chosen to be extracted into a new method, but it needs to return more than 
-one value from that method.  This problem occurs in two situations.  The first 
-situation arise when there is more than one local variable that is both assigned 
-to within a selection and also referenced after the selection. The other 
-situation occur when there is only one such assignment, but there is also one or 
-more return statements in the selection.
+\todoin{revisit}
+This checker verifies that there are no \emph{ambiguous return values} in a 
+selection.
 
 First the checker needs to collect some data. Those data are the binding keys 
 for all simple names that are assigned to within the selection, including