Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2018-03-05 09:19:56 -0500
committerJuergen Haug2018-03-05 09:19:56 -0500
commit621c23026acab07c7dd9fe42e0b1fd3faec62fff (patch)
tree1b92dbb6467dca8fc0debb50dca4e6b6fc6dd61c
parent374e54fd5d173e5d6ca9e89f82fa8a3ab557aa01 (diff)
downloadorg.eclipse.etrice-621c23026acab07c7dd9fe42e0b1fd3faec62fff.tar.gz
org.eclipse.etrice-621c23026acab07c7dd9fe42e0b1fd3faec62fff.tar.xz
org.eclipse.etrice-621c23026acab07c7dd9fe42e0b1fd3faec62fff.zip
compatibility with older guava versions
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/util/UIExpressionUtil.xtend12
-rw-r--r--plugins/org.eclipse.etrice.expressions.ui/src/org/eclipse/etrice/expressions/detailcode/DetailExpressionProvider.xtend8
2 files changed, 11 insertions, 9 deletions
diff --git a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/util/UIExpressionUtil.xtend b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/util/UIExpressionUtil.xtend
index dc27777da..5b6d876cd 100644
--- a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/util/UIExpressionUtil.xtend
+++ b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/util/UIExpressionUtil.xtend
@@ -15,6 +15,8 @@ package org.eclipse.etrice.core.ui.util
import com.google.common.collect.ImmutableList
import java.util.Map
import org.eclipse.emf.ecore.EObject
+import org.eclipse.emf.ecore.EReference
+import org.eclipse.etrice.core.fsm.fSM.DetailCode
import org.eclipse.etrice.core.fsm.fSM.ModelComponent
import org.eclipse.etrice.core.fsm.fSM.TransitionBase
import org.eclipse.etrice.core.genmodel.fsm.ExtendedFsmGenBuilder
@@ -27,16 +29,12 @@ import org.eclipse.etrice.core.ui.RoomUiModule
import org.eclipse.etrice.expressions.detailcode.DetailExpressionAssistParser
import org.eclipse.etrice.expressions.detailcode.DetailExpressionProvider
import org.eclipse.etrice.expressions.detailcode.IDetailExpressionProvider
+import org.eclipse.etrice.expressions.detailcode.IDetailExpressionProvider.EmptyDetailExpressionProvider
import org.eclipse.etrice.expressions.detailcode.IDetailExpressionProvider.ExpressionFeature
import org.eclipse.jface.text.Document
import org.eclipse.xtext.nodemodel.ILeafNode
import static org.eclipse.xtext.EcoreUtil2.getContainerOfType
-import org.eclipse.etrice.expressions.detailcode.IDetailExpressionProvider.EmptyDetailExpressionProvider
-import org.eclipse.emf.ecore.EReference
-import org.eclipse.etrice.core.fsm.fSM.DetailCode
-
-import static com.google.common.base.Verify.*
/**
* Utility to create and cache DetailExpressionProvider
@@ -68,9 +66,7 @@ class UIExpressionUtil {
/**
* DetailCode or eContainer + eContainmentReference
*/
- static def IDetailExpressionProvider getExpressionProvider(EObject ctx, EReference ref, ExpressionCache cache) {
- verifyNotNull(cache)
-
+ static def IDetailExpressionProvider getExpressionProvider(EObject ctx, EReference ref, ExpressionCache cache) {
if(ctx === null)
return new EmptyDetailExpressionProvider
diff --git a/plugins/org.eclipse.etrice.expressions.ui/src/org/eclipse/etrice/expressions/detailcode/DetailExpressionProvider.xtend b/plugins/org.eclipse.etrice.expressions.ui/src/org/eclipse/etrice/expressions/detailcode/DetailExpressionProvider.xtend
index e38b02ce1..c9d765677 100644
--- a/plugins/org.eclipse.etrice.expressions.ui/src/org/eclipse/etrice/expressions/detailcode/DetailExpressionProvider.xtend
+++ b/plugins/org.eclipse.etrice.expressions.ui/src/org/eclipse/etrice/expressions/detailcode/DetailExpressionProvider.xtend
@@ -46,7 +46,6 @@ import org.eclipse.xtext.EcoreUtil2
import org.eclipse.xtext.scoping.IGlobalScopeProvider
import org.eclipse.xtext.util.SimpleAttributeResolver
-import static com.google.common.base.Verify.*
import static org.eclipse.etrice.core.fsm.fSM.FSMPackage.Literals.*
import static extension org.eclipse.xtext.EcoreUtil2.getContainerOfType
@@ -334,4 +333,11 @@ class DetailExpressionProvider implements IDetailExpressionProvider {
return Sets.newHashSet(iterable);
}
+ private def <T> verifyNotNull(T ref) {
+ if(ref === null)
+ throw new NullPointerException
+
+ return ref
+ }
+
} \ No newline at end of file

Back to the top