Skip to content

Package: CooHelper

CooHelper

nameinstructionbranchcomplexitylinemethod
CooHelper()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package de.fhdw.wtf.walker.tasks;
2:
3: import java.util.HashMap;
4: import java.util.Set;
5:
6: import de.fhdw.wtf.common.ast.Attribute;
7: import de.fhdw.wtf.common.ast.Constructor;
8: import de.fhdw.wtf.common.ast.ConstructorOrOperation;
9: import de.fhdw.wtf.common.ast.Group;
10: import de.fhdw.wtf.common.ast.Model;
11: import de.fhdw.wtf.common.ast.Operation;
12: import de.fhdw.wtf.common.ast.type.AtomicType;
13: import de.fhdw.wtf.common.ast.type.ClassType;
14: import de.fhdw.wtf.common.ast.type.CompositeType;
15: import de.fhdw.wtf.common.ast.type.ThrownType;
16: import de.fhdw.wtf.common.ast.type.Type;
17: import de.fhdw.wtf.common.ast.type.TypeProxy;
18: import de.fhdw.wtf.common.ast.visitor.ConstructorOrOperationExceptionVisitor;
19: import de.fhdw.wtf.common.ast.visitor.TypeVisitor;
20: import de.fhdw.wtf.common.exception.walker.TaskException;
21: import de.fhdw.wtf.common.task.TaskExecutor;
22: import de.fhdw.wtf.walker.walker.SimpleWalkerTask;
23:
24: public class CovarianceInExceptionInheritanceChecker extends SimpleWalkerTask {
25:         
26:         public CovarianceInExceptionInheritanceChecker(final Model m, final TaskExecutor taskmanager) {
27:                 super(m, taskmanager);
28:                 this.helper = new ExceptionInhHelper();
29:                 // TODO Auto-generated constructor stub
30:         }
31:         
32:         ExceptionInhHelper helper;
33:         
34:         @Override
35:         public void handleClass(final ClassType c) throws TaskException {
36:                 // Nothing to do here!
37:                 
38:         }
39:         
40:         @Override
41:         public void handleGroup(final Group g) throws TaskException {
42:                 // Nothing to do here!
43:                 
44:         }
45:         
46:         @Override
47:         public void handleAttribute(final Attribute a, final ClassType owner) throws TaskException {
48:                 // Nothing to do here!
49:                 
50:         }
51:         
52:         @Override
53:         public void handleConstructorOrOperation(final ConstructorOrOperation coo, final ClassType owner)
54:                         throws TaskException {
55:                 coo.accept(new ConstructorOrOperationExceptionVisitor<TaskException>() {
56:                         
57:                         @Override
58:                         public void handleOperation(final Operation operation) throws TaskException {
59:                                 
60:                                 operation.getReturnType().accept(new TypeVisitor() {
61:                                         
62:                                         @Override
63:                                         public void handle(final TypeProxy typeProxy) {
64:                                                 // TODO Auto-generated method stub
65:                                                 
66:                                         }
67:                                         
68:                                         @Override
69:                                         public void handle(final CompositeType compositeType) {
70:                                                 // TODO Auto-generated method stub
71:                                                 
72:                                         }
73:                                         
74:                                         @Override
75:                                         public void handle(final AtomicType atomicType) {
76:                                                 // TODO Auto-generated method stub
77:                                                 
78:                                         }
79:                                 });
80:                                 
81:                         }
82:                         
83:                         @Override
84:                         public void handleConstructor(final Constructor constructor) throws TaskException {
85:                                 // TODO Auto-generated method stub
86:                                 
87:                         }
88:                 });
89:         }
90:         
91:         @Override
92:         public void finalizeTask() throws TaskException {
93:                 // TODO Auto-generated method stub
94:                 
95:         }
96:         
97:         @Override
98:         public void beginTask() throws TaskException {
99:                 // TODO Auto-generated method stub
100:                 
101:         }
102: }
103:
104: /*
105: * This Class is a Helper. It Contains a Map of all Classes with their Functions and their Exceptions.
106: */
107: class ExceptionInhHelper {
108:         
109: }
110:
111: /**
112: * @author Dumann This Class is a Helper for the Covariance-Check... It Contains a List of Types with all Constructors
113: * or Operations in the Helper Format...
114: */
115: class TypeHelper {
116:         HashMap<Type, CooHelper> map;
117: }
118:
119: /**
120: * @author Dumann
121: *
122: */
123: class CooHelper {
124:         HashMap<ConstructorOrOperation, Set<ThrownType>> map;
125: }