blob: 720fa4775c174d7cb7041d990f77de02bf1db366 [file] [log] [blame]
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="IBM">
<title>JDT/Core Breaking API changes</title>
</head>
<body>
<body text="#000000" bgcolor="#FFFFFF">
&nbsp;
<table border=0 cellspacing=5 cellpadding=2 width="100%" >
<tr>
<td align=left width="72%">
<font face="Verdana, Arial, Helvetica" size="+3"><b>jdt core - Breaking API changes from R2.1 to R3.0</b></font>
<br><font face="Arial, Helvetica, sans-serif" size="-2" color="#8080ff">java development tooling core</font></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td>
<font face="Arial, Helvetica, sans-serif" size="-1">
This document lists the breaking API changes that occured between R2.1 and R3.0 and how to migrate from the R2.1 API to
the R3.0 API.
</font>
</td>
</tr>
</table>
<p>
<ul>
<li>(in progress) <code>IWorkingCopy</code> now extends <code>ICompilationUnit</code>
(see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=36987 ">bug 36987 </a>)
<p>
Historically, <code>IWorkingCopy</code> gathered all working copy concerns,
and <code>ICompilationUnit</code> implement this interface, though only the
factory method makes sense for them; thus their implementation of the working
copy features do nothing relevant to clients. <code>IWorkingCopy</code> also
implements the spec'ed factory method, but it doesn't work for these.
</p>
<p>
Clients using <code>IWorkingCopy</code> and <code>ICompilationUnit</code> can
adapt to this change by referencing <code>IWorkingCopy</code> instead of
<code>ICompilationUnit</code> when a working copy is needed.
</p>
</li>
<li>(in progress) Factory methods that create <code>IWorkingCopies</code> (i.e.
<code>getWorkingCopy</code> and <code>getSharedWorkingCopy</code>) now return
an <code>IWorkingCopy</code> instead of an <code>IJavaElement</code>.
<p>
Working copies were initialy designed to be editable elements on any <code>IJavaElement</code>.
Pratice showed that they were used only to edit <code>ICompilationUnit</code>. To avoid
downcasting to <code>IWorkingCopy</code>, the factory methods now return an
<code>IWorkingCopy</code>.
</p>
<p>
Clients using factory methods to create working copies can now remove the cast from
<code>IJavaElement</code> to <code>IWorkingCopy</code>.
</p></li>
</ul>
</body>
</html>