1 | /******************************************************************************* |
2 | * Copyright (c) 2008, 2009 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.pde.api.tools.internal.builder; |
12 | |
13 | import java.util.Set; |
14 | |
15 | import org.eclipse.pde.api.tools.internal.provisional.builder.IReference; |
16 | import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblem; |
17 | import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblemTypes; |
18 | |
19 | /** |
20 | * Detects leaks in method return types |
21 | * |
22 | * @since 1.1 |
23 | */ |
24 | public class LeakReturnTypeDetector extends MethodLeakDetector { |
25 | |
26 | /** |
27 | * @param nonApiPackageNames |
28 | */ |
29 | public LeakReturnTypeDetector(Set nonApiPackageNames) { |
30 | super(nonApiPackageNames); |
31 | } |
32 | |
33 | /* (non-Javadoc) |
34 | * @see org.eclipse.pde.api.tools.internal.search.AbstractProblemDetector#getSeverityKey() |
35 | */ |
36 | protected String getSeverityKey() { |
37 | return IApiProblemTypes.LEAK_METHOD_RETURN_TYPE ; |
38 | } |
39 | |
40 | /* (non-Javadoc) |
41 | * @see org.eclipse.pde.api.tools.internal.provisional.search.IApiProblemDetector#getReferenceKinds() |
42 | */ |
43 | public int getReferenceKinds() { |
44 | return IReference.REF_RETURNTYPE; |
45 | } |
46 | |
47 | /* (non-Javadoc) |
48 | * @see org.eclipse.pde.api.tools.internal.search.AbstractProblemDetector#getProblemFlags(org.eclipse.pde.api.tools.internal.provisional.model.IReference) |
49 | */ |
50 | protected int getProblemFlags(IReference reference) { |
51 | return IApiProblem.LEAK_RETURN_TYPE; |
52 | } |
53 | |
54 | } |