Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-11-29 12:42:38 -0500
committerHenrik Rentz-Reichert2012-11-29 12:42:38 -0500
commit7802294a804627ebd1c065025238e02afa5690e6 (patch)
tree5ea01e069a01cb40ec6a6017e2c91cfbbd94803d
parent8e378055dd353ec98d7e1c9421127d5b19e34812 (diff)
downloadorg.eclipse.etrice-7802294a804627ebd1c065025238e02afa5690e6.tar.gz
org.eclipse.etrice-7802294a804627ebd1c065025238e02afa5690e6.tar.xz
org.eclipse.etrice-7802294a804627ebd1c065025238e02afa5690e6.zip
[core.room] fixed two problems detected by CheckStyle
-rw-r--r--plugins/org.eclipse.etrice.core.room/.checkstyle11
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/RoomJavaValidator.java4
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidationUtil.java8
3 files changed, 18 insertions, 5 deletions
diff --git a/plugins/org.eclipse.etrice.core.room/.checkstyle b/plugins/org.eclipse.etrice.core.room/.checkstyle
new file mode 100644
index 000000000..d417d3b25
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room/.checkstyle
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="eTrice checks" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+ <filter name="WriteProtectedFiles" enabled="true"/>
+ <filter name="FilesFromPackage" enabled="true">
+ <filter-data value="src-gen"/>
+ </filter>
+</fileset-config>
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/RoomJavaValidator.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/RoomJavaValidator.java
index 71bc7f72e..e02320001 100644
--- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/RoomJavaValidator.java
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/RoomJavaValidator.java
@@ -139,9 +139,9 @@ public class RoomJavaValidator extends AbstractRoomJavaValidator {
@Check
public void checkRefHasFixedMultiplicityPorts(ActorRef ar) {
- if (ar.getSize()>1) {
+ if (ar!=null) {
ActorClass ac = ar.getType();
- if (ar!=null) {
+ if (ar.getSize()>1) {
for (Port p : ac.getIfPorts()) {
if (p.getMultiplicity()<0) {
int idx = ((ActorContainerClass)ar.eContainer()).getActorRefs().indexOf(ar);
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidationUtil.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidationUtil.java
index 8eebd878f..9a7340e42 100644
--- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidationUtil.java
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidationUtil.java
@@ -330,8 +330,9 @@ public class ValidationUtil {
spc2 = (ProtocolClass) pc2;
else if (sub2.getProtocol() instanceof ProtocolClass)
spc2 = (ProtocolClass) sub2.getProtocol();
- if (spc1.getCommType()!=spc2.getCommType())
- return Result.error("protocol communication types don't match");
+ if (spc1!=null && spc2!=null)
+ if (spc1.getCommType()!=spc2.getCommType())
+ return Result.error("protocol communication types don't match");
}
if (compoundInvolved) {
List<Match> matches = CompoundProtocolHelpers.getMatches(p1, ref1, p2, ref2, sc, exclude);
@@ -951,7 +952,8 @@ public class ValidationUtil {
tr.eContainer(),
RoomPackage.eINSTANCE.getStateGraph_Transitions(),
((StateGraph)tr.eContainer()).getTransitions().indexOf(tr));
- } }
+ }
+ }
return Result.ok();
}

Back to the top