KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > umd > cs > findbugs > detect > InconsistentSyncWarningProperty


1 /*
2  * FindBugs - Find bugs in Java programs
3  * Copyright (C) 2005, University of Maryland
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19 package edu.umd.cs.findbugs.detect;
20
21 import edu.umd.cs.findbugs.props.AbstractWarningProperty;
22 import edu.umd.cs.findbugs.props.PriorityAdjustment;
23
24 /**
25  * Warning properties for inconsistent synchronization detector.
26  *
27  * @author David Hovemeyer
28  */

29 public class InconsistentSyncWarningProperty extends AbstractWarningProperty {
30     private InconsistentSyncWarningProperty(String JavaDoc name, PriorityAdjustment priorityAdjustment) {
31         super(name, priorityAdjustment);
32     }
33     
34 // /** Field is never accessed while locked. */
35
// public static final InconsistentSyncWarningProperty NEVER_LOCKED =
36
// new InconsistentSyncWarningProperty("NEVER_LOCKED", PriorityAdjustment.FALSE_POSITIVE);
37
// /** Field is never accessed while unlocked. */
38
// public static final InconsistentSyncWarningProperty NEVER_UNLOCKED =
39
// new InconsistentSyncWarningProperty("NEVER_UNLOCKED", PriorityAdjustment.FALSE_POSITIVE);
40
/**
41      * Field is accessed unlocked most of the time, and therefore is probably
42      * not intended to be safely used from multiple threads.
43      */

44     public static final InconsistentSyncWarningProperty MANY_BIASED_UNLOCKED =
45         new InconsistentSyncWarningProperty("MANY_BIASED_UNLOCKED", PriorityAdjustment.FALSE_POSITIVE);
46     /** Field is never written outside constructor. */
47     public static final InconsistentSyncWarningProperty NEVER_WRITTEN =
48         new InconsistentSyncWarningProperty("NEVER_WRITTEN", PriorityAdjustment.FALSE_POSITIVE);
49     /** Field is never read outside constructor. */
50     public static final InconsistentSyncWarningProperty NEVER_READ =
51         new InconsistentSyncWarningProperty("NEVER_READ", PriorityAdjustment.FALSE_POSITIVE);
52     /**
53      * Field is never locked in the definition of the class. (I.e., all locked
54      * accesses are in methods of other classes.)
55      */

56     public static final InconsistentSyncWarningProperty NO_LOCAL_LOCKS =
57         new InconsistentSyncWarningProperty("NO_LOCAL_LOCKS", PriorityAdjustment.FALSE_POSITIVE);
58     /** Below minimum percentage synchronized accesses. */
59     public static final InconsistentSyncWarningProperty BELOW_MIN_SYNC_PERCENT =
60         new InconsistentSyncWarningProperty("BELOW_MIN_SYNC_PERCENT", PriorityAdjustment.FALSE_POSITIVE);
61     /** The only unlocked accesses are in getter methods. */
62     public static final InconsistentSyncWarningProperty ONLY_UNSYNC_IN_GETTERS =
63         new InconsistentSyncWarningProperty("ONLY_UNSYNC_IN_GETTERS", PriorityAdjustment.LOWER_PRIORITY);
64     public static final InconsistentSyncWarningProperty ANNOTATED_AS_GUARDED_BY_THIS =
65         new InconsistentSyncWarningProperty("ANNOTATED_AS_GUARDED_BY_THIS", PriorityAdjustment.RAISE_PRIORITY_TO_AT_LEAST_NORMAL);
66     public static final InconsistentSyncWarningProperty ANNOTATED_AS_THREAD_SAFE =
67         new InconsistentSyncWarningProperty("ANNOTATED_AS_THREAD_SAFE", PriorityAdjustment.RAISE_PRIORITY);
68
69 }
70
Popular Tags