mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[xtext][resource] Improved null contract for ISynchronizable
Change-Id: Ifee0b5e7e94c79879270b92d57aba260b1920411
This commit is contained in:
parent
f13db54d2b
commit
a18d6b0051
2 changed files with 5 additions and 3 deletions
|
@ -8,6 +8,7 @@
|
|||
package org.eclipse.xtext.resource;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.eclipse.xtext.util.concurrent.IUnitOfWork;
|
||||
|
||||
import com.google.common.annotations.Beta;
|
||||
|
@ -34,6 +35,7 @@ public interface ISynchronizable<Synchronizable> {
|
|||
* @param unit the action to perform. May not be <code>null</code>
|
||||
* @exception Exception the exception that was thrown by the unit.
|
||||
*/
|
||||
@Nullable
|
||||
<Result> Result execute(IUnitOfWork<Result, ? super Synchronizable> unit) throws Exception;
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.eclipse.emf.common.util.EList;
|
|||
import org.eclipse.emf.common.util.URI;
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
import org.eclipse.jdt.annotation.NonNull;
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.eclipse.xtext.util.concurrent.IUnitOfWork;
|
||||
|
||||
/**
|
||||
|
@ -54,8 +54,8 @@ public class SynchronizedXtextResourceSet extends XtextResourceSet implements IS
|
|||
*
|
||||
* @since 2.4
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public <Result> Result execute(IUnitOfWork<Result, ? super SynchronizedXtextResourceSet> unit) throws Exception {
|
||||
@Nullable
|
||||
public <Result> Result execute(@NonNull IUnitOfWork<Result, ? super SynchronizedXtextResourceSet> unit) throws Exception {
|
||||
synchronized (getLock()) {
|
||||
return unit.exec(this);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue