]> git.uio.no Git - ifi-stolz-refaktor.git/commitdiff
Adding to the thesis about property collectors.
authorErlend Kristiansen <erlenkr@ifi.uio.no>
Tue, 26 Nov 2013 15:37:18 +0000 (16:37 +0100)
committerErlend Kristiansen <erlenkr@ifi.uio.no>
Tue, 26 Nov 2013 15:37:18 +0000 (16:37 +0100)
thesis/master-thesis-erlenkr.aux
thesis/master-thesis-erlenkr.pdf
thesis/master-thesis-erlenkr.tdo
thesis/master-thesis-erlenkr.tex
thesis/master-thesis-erlenkr.toc

index 6a8a632042292b9137cc6c378a88e6bfad1f0443..0794af44904fbcf755f8040f6573ca75ad9ee428 100644 (file)
 \pp@pagectr{footnote}{25}{26}{14}
 \pp@pagectr{footnote}{26}{26}{14}
 \@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.3}The ExtractAndMoveMethodPrefixesExtractor Class}{14}}
-\pp@pagectr{footnote}{27}{26}{14}
 \citation{dp}
+\citation{dp}
+\pp@pagectr{footnote}{27}{27}{15}
 \pp@pagectr{footnote}{28}{27}{15}
-\@writefile{tdo}{\defcounter {refsection}{0}\relax }\@writefile{tdo}{\contentsline {todo}{Write about how prefixes and unfixes are chosen. And how the safe ones are computed}{15}}
-\pgfsyspdfmark {pgfid41}{10269865}{47463037}
-\pgfsyspdfmark {pgfid44}{33785118}{47429500}
-\pgfsyspdfmark {pgfid45}{37143838}{47181923}
-\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.4}The Prefix Class}{15}}
-\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.5}The PrefixSet Class}{15}}
-\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.6}Hacking the Refactoring Undo History}{15}}
-\newlabel{hacking_undo_history}{{3.2.6}{15}}
-\@writefile{tdo}{\defcounter {refsection}{0}\relax }\@writefile{tdo}{\contentsline {todo}{Where to put this section?}{15}}
-\pgfsyspdfmark {pgfid46}{6178078}{41011416}
-\pgfsyspdfmark {pgfid49}{33785118}{41006574}
-\pgfsyspdfmark {pgfid50}{37143838}{40758997}
 \pp@pagectr{footnote}{29}{27}{15}
 \pp@pagectr{footnote}{30}{27}{15}
 \pp@pagectr{footnote}{31}{27}{15}
+\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsubsection}{The PrefixesCollector}{15}}
 \pp@pagectr{footnote}{32}{27}{15}
 \pp@pagectr{footnote}{33}{27}{15}
+\@writefile{tdo}{\defcounter {refsection}{0}\relax }\@writefile{tdo}{\contentsline {todo}{Rewrite in the case of changes to the way prefixes are found}{15}}
+\pgfsyspdfmark {pgfid41}{12333008}{36934521}
+\pgfsyspdfmark {pgfid44}{33785118}{36929679}
+\pgfsyspdfmark {pgfid45}{37143838}{36682102}
+\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsubsection}{The UnfixesCollector}{15}}
 \pp@pagectr{footnote}{34}{27}{15}
+\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsubsection}{Computing Safe Prefixes}{15}}
+\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.4}The Prefix Class}{15}}
+\@writefile{tdo}{\defcounter {refsection}{0}\relax }\@writefile{tdo}{\contentsline {todo}{?}{15}}
+\pgfsyspdfmark {pgfid46}{6178078}{20480241}
+\pgfsyspdfmark {pgfid49}{33785118}{20475399}
+\pgfsyspdfmark {pgfid50}{37143838}{20227822}
+\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.5}The PrefixSet Class}{15}}
+\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.6}Hacking the Refactoring Undo History}{15}}
+\newlabel{hacking_undo_history}{{3.2.6}{15}}
+\@writefile{tdo}{\defcounter {refsection}{0}\relax }\@writefile{tdo}{\contentsline {todo}{Where to put this section?}{15}}
+\pgfsyspdfmark {pgfid51}{6178078}{15631587}
+\pgfsyspdfmark {pgfid54}{33785118}{15626745}
+\pgfsyspdfmark {pgfid55}{37143838}{15379168}
+\pp@pagectr{footnote}{35}{27}{15}
+\pp@pagectr{footnote}{36}{28}{16}
+\pp@pagectr{footnote}{37}{28}{16}
+\pp@pagectr{footnote}{38}{28}{16}
+\pp@pagectr{footnote}{39}{28}{16}
+\pp@pagectr{footnote}{40}{28}{16}
index 9871c9eb2b8deae23495fb008d4d8e4a0d9b8353..8ee6d5d2b928ae31f773e9800184fa09ab4a6209 100644 (file)
Binary files a/thesis/master-thesis-erlenkr.pdf and b/thesis/master-thesis-erlenkr.pdf differ
index 59bd72785bd7bb333d8865cd3b55b85f5b49b9bd..753204f85665b117f88ee077e0f927d039261a14 100644 (file)
@@ -15,6 +15,8 @@
 \defcounter {refsection}{0}\relax 
 \contentsline {todo}{refine}{10}
 \defcounter {refsection}{0}\relax 
-\contentsline {todo}{Write about how prefixes and unfixes are chosen. And how the safe ones are computed}{15}
+\contentsline {todo}{Rewrite in the case of changes to the way prefixes are found}{15}
+\defcounter {refsection}{0}\relax 
+\contentsline {todo}{?}{15}
 \defcounter {refsection}{0}\relax 
 \contentsline {todo}{Where to put this section?}{15}
index e7d19b55f8d1391eef67fffd25fbcb8c8f7ac48c..b498398e8af8f2fd4ac270592c25039253cf3ab2 100644 (file)
@@ -622,10 +622,12 @@ will never return \type{null}.
 Before extracting the new method, the possible targets for the move operation is 
 found with the help of an
 \typewithref{no.uio.ifi.refaktor.extractors}{ExtractAndMoveMethodPrefixesExtractor}.  
-The possible targets is those that the extractor returns from its
+The possible targets is computed from the prefixes that the extractor returns 
+from its
 \methodwithref{no.uio.ifi.refaktor.extractors.ExtractAndMoveMethodPrefixesExtractor}{getSafePrefixes} 
 method. The changer then choose the most suitable target by finding the most 
-frequent occurring prefix among the safe ones.
+frequent occurring prefix among the safe ones. The target is the type of the 
+first part of the prefix.
 
 After finding a suitable target, the \type{ExtractAndMoveMethodChanger} first 
 creates an \type{ExtractMethodRefactoring} and performs it as explained in 
@@ -635,15 +637,46 @@ changes done by the Extract Method refactoring.
 
 \subsection{The ExtractAndMoveMethodPrefixesExtractor Class}
 This extractor extracts properties needed for building the Extract and Move 
-Method refactoring. It searches through the given selection to find safe targets 
-for the move part of the refactoring. It finds both the candidates, in the form 
-of prefixes, and the non-candidates, called unfixes. All prefixes (and unfixes) 
-are represented by a \typewithref{no.uio.ifi.refaktor.extractors}{Prefix}, and 
-they are collected into prefix 
-sets.\typeref{no.uio.ifi.refaktor.extractors.PrefixSet}. \todo{Write about how 
-prefixes and unfixes are chosen. And how the safe ones are computed}.
+Method refactoring. It searches through the given selection to find safe 
+prefixes, and those prefixes form a base that can be used to compute possible 
+targets for the move part of the refactoring.  It finds both the candidates, in 
+the form of prefixes, and the non-candidates, called unfixes. All prefixes (and 
+unfixes) are represented by a 
+\typewithref{no.uio.ifi.refaktor.extractors}{Prefix}, and they are collected 
+into prefix sets.\typeref{no.uio.ifi.refaktor.extractors.PrefixSet}. 
+
+The prefixes and unfixes are found by property 
+collectors\typeref{no.uio.ifi.refaktor.extractors.collectors.PropertyCollector}.  
+A property collector follows the visitor pattern \cite{dp} and is of the 
+\typewithref{org.eclipse.jdt.core.dom}{ASTVisitor} type.  An \type{ASTVisitor} 
+visits nodes in an abstract syntax tree that forms the Java document object 
+model. The tree consists of nodes of type 
+\typewithref{org.eclipse.jdt.core.do}{ASTNode}.
+
+\subsubsection{The PrefixesCollector}
+The \typewithref{no.uio.ifi.refaktor.extractors.collectors}{PrefixesCollector} 
+is of type \type{PropertyCollector}. It visits expression 
+statements\typeref{org.eclipse.jdt.core.dom.ExpressionStatement} and creates 
+prefixes from its expressions in the case of method invocations. The prefixes 
+found is registered with a prefix set, together with all its sub-prefixes.
+\todo{Rewrite in the case of changes to the way prefixes are found}
+
+\subsubsection{The UnfixesCollector}
+The \typewithref{no.uio.ifi.refaktor.extractors.collectors}{UnfixesCollector} 
+finds unfixes within the selection. An unfix is a name that is assigned to 
+within the selection. The reason that this cannot be allowed, is that the result 
+would be an assignment to the \type{this} keyword, which is not valid in Java.
+
+\subsubsection{Computing Safe Prefixes}
+A safe prefix is a prefix that does not enclose an unfix. A prefix is enclosing 
+an unfix if the unfix is in the set of its sub-prefixes. As an example, 
+\texttt{``a.b''} is enclosing \texttt{``a''}, as is \texttt{``a''}. The safe 
+prefixes is unified in a \type{PrefixSet} and can be fetched calling the 
+\method{getSafePrefixes} method of the 
+\type{ExtractAndMoveMethodPrefixesExtractor}.
 
 \subsection{The Prefix Class}
+\todo{?}
 \subsection{The PrefixSet Class}
 
 \subsection{Hacking the Refactoring Undo 
index c97fae6b6943171731795d7bcc4c9deaf51aa86e..1fc427d0b2b275da327269a6677e88938f081c2a 100644 (file)
 \defcounter {refsection}{0}\relax 
 \contentsline {subsection}{\numberline {3.2.3}The ExtractAndMoveMethodPrefixesExtractor Class}{14}
 \defcounter {refsection}{0}\relax 
+\contentsline {subsubsection}{The PrefixesCollector}{15}
+\defcounter {refsection}{0}\relax 
+\contentsline {subsubsection}{The UnfixesCollector}{15}
+\defcounter {refsection}{0}\relax 
+\contentsline {subsubsection}{Computing Safe Prefixes}{15}
+\defcounter {refsection}{0}\relax 
 \contentsline {subsection}{\numberline {3.2.4}The Prefix Class}{15}
 \defcounter {refsection}{0}\relax 
 \contentsline {subsection}{\numberline {3.2.5}The PrefixSet Class}{15}