\documentclass[10pt]{article}

\usepackage{fullpage}
\usepackage{setspace}
\usepackage{parskip}
\usepackage{titlesec}
\usepackage[section]{placeins}
\usepackage{xcolor}
\usepackage{breakcites}
\usepackage{lineno}
\usepackage{hyphenat}





\PassOptionsToPackage{hyphens}{url}
\usepackage[colorlinks = true,
            linkcolor = blue,
            urlcolor  = blue,
            citecolor = blue,
            anchorcolor = blue]{hyperref}
\usepackage{etoolbox}
\makeatletter
\patchcmd\@combinedblfloats{\box\@outputbox}{\unvbox\@outputbox}{}{%
  \errmessage{\noexpand\@combinedblfloats could not be patched}%
}%
\makeatother


\usepackage{natbib}




\renewenvironment{abstract}
  {{\bfseries\noindent{\abstractname}\par\nobreak}\footnotesize}
  {\bigskip}

\titlespacing{\section}{0pt}{*3}{*1}
\titlespacing{\subsection}{0pt}{*2}{*0.5}
\titlespacing{\subsubsection}{0pt}{*1.5}{0pt}


\usepackage{authblk}


\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{latexsym}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{booktabs,array,multirow}
\usepackage{amsfonts,amsmath,amssymb}
\providecommand\citet{\cite}
\providecommand\citep{\cite}
\providecommand\citealt{\cite}
% You can conditionalize code for latexml or normal latex using this.
\newif\iflatexml\latexmlfalse
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}%

\AtBeginDocument{\DeclareGraphicsExtensions{.pdf,.PDF,.eps,.EPS,.png,.PNG,.tif,.TIF,.jpg,.JPG,.jpeg,.JPEG}}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}



\usepackage{float}








\begin{document}

\title{ReInstancer: An Automatic Refactoring Approach for Instancerof Pattern
Matching}



\author[1]{Yang Zhang}%
\author[1]{AR TI CLE}%
\affil[1]{Hebei University of Science and Technology}%


\vspace{-1em}



  
  \date{May 29, 2024}


\begingroup
\let\center\flushleft
\let\endcenter\endflushleft
\maketitle
\endgroup





\selectlanguage{english}
\begin{abstract}
The extit\{instanceof\} pattern matching is periodically previewed in
the latest published JDK by removing the redundant casting and
optimizing its usage in different scenarios, which improves the code
quality and readability. However, the existing integrated development
environment (IDE) does not provide sufficient support for refactoring of
extit\{instanceof\} pattern matching in all situations. This paper first
identifies several cases that cannot be handled by existing IDEs, and
then proposes a novel approach called extit\{ReInstancer\} to refactor
extit\{instanceof\} pattern matching automatically. extit\{ReInstancer\}
conducts visitor pattern analysis for extit\{if\} statement blocks with
extit\{instanceof\}. For the extit\{instanceof\} expression, a pattern
variable is obtained after removing the redundant type casting by
pattern analysis. For multi-branch statements, extit\{ReInstancer\}
employs class hierarchy analysis and control flow analysis to infer the
relationship of instance type in each branch and then optimize these
branches. Finally, the multi-branch statements are converted into switch
statements or switch expressions. extit\{ReInstancer\} is evaluated with
20 real-world applications. The experimental results demonstrate a total
of 3558 extit\{instanceof\} expressions and 228 multi-branch statements
applying the refactoring, and each application takes an average of
10.8s. extit\{ReInstancer\} not only reduces the redundant type casting
but also improves the code quality.%
\end{abstract}%



\sloppy




\selectlanguage{english}
\FloatBarrier
\end{document}

