KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > refactoring > code > flow > MessageSendFlowInfo


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.corext.refactoring.code.flow;
12
13 import org.eclipse.jdt.core.dom.IMethodBinding;
14 import org.eclipse.jdt.core.dom.ITypeBinding;
15
16 class MessageSendFlowInfo extends FlowInfo {
17
18     public MessageSendFlowInfo() {
19         super(NO_RETURN);
20     }
21     
22     public void mergeArgument(FlowInfo info, FlowContext context) {
23         if (info == null)
24             return;
25         mergeSequential(info, context);
26     }
27     
28     public void mergeReceiver(FlowInfo info, FlowContext context) {
29         if (info == null)
30             return;
31         mergeSequential(info, context);
32     }
33     
34     public void mergeExceptions(IMethodBinding binding, FlowContext context) {
35         if (binding == null)
36             return;
37         ITypeBinding[] exceptions= binding.getExceptionTypes();
38         if (exceptions == null)
39             return;
40         for (int i= 0; i < exceptions.length; i++) {
41             ITypeBinding exception= exceptions[i];
42             if (context.isExceptionCaught(exception))
43                 addException(exception);
44         }
45     }
46 }
47
Popular Tags