| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AbstractAnalyzer |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * This file is part of dependency-check-core. | |
| 3 | * | |
| 4 | * Dependency-check-core is free software: you can redistribute it and/or modify it | |
| 5 | * under the terms of the GNU General Public License as published by the Free | |
| 6 | * Software Foundation, either version 3 of the License, or (at your option) any | |
| 7 | * later version. | |
| 8 | * | |
| 9 | * Dependency-check-core is distributed in the hope that it will be useful, but | |
| 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | |
| 12 | * details. | |
| 13 | * | |
| 14 | * You should have received a copy of the GNU General Public License along with | |
| 15 | * dependency-check-core. If not, see http://www.gnu.org/licenses/. | |
| 16 | * | |
| 17 | * Copyright (c) 2012 Jeremy Long. All Rights Reserved. | |
| 18 | */ | |
| 19 | package org.owasp.dependencycheck.analyzer; | |
| 20 | ||
| 21 | import java.util.Collections; | |
| 22 | import java.util.HashSet; | |
| 23 | import java.util.Set; | |
| 24 | ||
| 25 | /** | |
| 26 | * | |
| 27 | * @author Jeremy Long (jeremy.long@owasp.org) | |
| 28 | */ | |
| 29 | 56 | public abstract class AbstractAnalyzer implements Analyzer { |
| 30 | ||
| 31 | /** | |
| 32 | * Utility method to help in the creation of the extensions set. This | |
| 33 | * constructs a new Set that can be used in a final static | |
| 34 | * declaration.<br/><br/> | |
| 35 | * | |
| 36 | * This implementation was copied from | |
| 37 | * http://stackoverflow.com/questions/2041778/initialize-java-hashset-values-by-construction | |
| 38 | * | |
| 39 | * @param strings a list of strings to add to the set. | |
| 40 | * @return a Set of strings. | |
| 41 | */ | |
| 42 | protected static Set<String> newHashSet(String... strings) { | |
| 43 | 5 | final Set<String> set = new HashSet<String>(); |
| 44 | ||
| 45 | 5 | Collections.addAll(set, strings); |
| 46 | 5 | return set; |
| 47 | } | |
| 48 | ||
| 49 | /** | |
| 50 | * The initialize method does nothing for this Analyzer. | |
| 51 | * | |
| 52 | * @throws Exception thrown if there is an exception | |
| 53 | */ | |
| 54 | @Override | |
| 55 | public void initialize() throws Exception { | |
| 56 | //do nothing | |
| 57 | 19 | } |
| 58 | ||
| 59 | /** | |
| 60 | * The close method does nothing for this Analyzer. | |
| 61 | * | |
| 62 | * @throws Exception thrown if there is an exception | |
| 63 | */ | |
| 64 | @Override | |
| 65 | public void close() throws Exception { | |
| 66 | //do nothing | |
| 67 | 19 | } |
| 68 | } |