Q:

Listing inside table does not work after upgrade to MacTex 2015

I have updated my Latex installation to MacTex 2015 and the following latex code does not compile anymore:
\documentclass[10pt]{article}

\usepackage{listings}

\lstset{language={java},
        morekeywords={left,right}
        keywordstyle=\bfseries,
        basicstyle=\footnotesize\ttfamily
}

\def\java#1{\lstinline[language=java]{#1}}
\newcommand{\code}[1]{\java{#1}}

\begin{document}

\begin{table*}[t]\footnotesize
\centering
\def\arraystretch{1.1}
  \begin{tabular}{lll}
    A      & B     & C \\
    1      & 2     &  \code{left} and \code{right} \\
  \end{tabular}
  \caption{Summary}
  \label{table:summary}
\end{table*}

\end{document}

The error message is:
!  Missing } inserted. 
<inserted text> 
                }
l.24   \end
           {tabular}
?  
!  Misplaced \crcr. 
\endtabular ->\crcr 
                    \egroup \egroup $\egroup 
l.24   \end{tabular}

?  
!  Extra }, or forgotten $. 
\endtabular ->\crcr \egroup \egroup 
                                    $\egroup 
l.24   \end{tabular}

This is the output from the log file after adding \listfiles:
 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
 size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 listings.sty    2014/09/06 1.5e (Carsten Heinz)
 keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
 lstmisc.sty    2014/09/06 1.5e (Carsten Heinz)
 listings.cfg    2014/09/06 1.5e listings configuration
 lstlang1.sty    2014/09/06 1.5e listings language file

I could compile it on mactex 2014.  Also, if I change code to texttt or lstinline it will work.  Can anyone help? 

A:

The listings package had an upgrade that fixed a problem related to tabular (see the change history). 
Unfortunately, the fix was released after TeX Live had been frozen for producing the DVD, so one has to update the distribution using tlmgr or, with MacTeX, TeX Live Utility. 
The updated version should solve the issue. 

About your code, I'd use
\newcommand{\code}{\lstinline[language=java]}

without the argument, so you're free to use either
\code{whatever}

or
\code|whatever|

in case TeX special characters are needed (instead of | you can use any character not in the code to be printed, like for \verb).