Current Java API Annotations

Here are my current Java API annotations, both in XML form:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<?xml version="1.0" encoding="UTF-8"?>
<concutest>
  <threadcheck>
    <javax>
      <swing>
        <plaf>
          <TextUI>
            <class>
              <method sig="modelToView(Ljavax/swing/text/JTextComponent;I)
               Ljava/awt/Rectangle;">

                <eventThread type="only" value="true"/>
              </method>
              <method sig="modelToView(Ljavax/swing/text/JTextComponent;I
               Ljavax/swing/text/Position$Bias;)Ljava/awt/Rectangle;">

                <eventThread type="only" value="true"/>
              </method>
            </class>
          </TextUI>
        </plaf>
        <text>
          <DefaultCaret>
            <class>
              <method sig="repaintNewCaret()V">
                <eventThread type="only" value="true"/>
              </method>
              <method sig="repaint()V">
                <eventThread type="only" value=".*"/>
              </method>
            </class>
          </DefaultCaret>
          <JTextComponent>
            <class>
              <method sig="replaceSelection(Ljava/lang/String;)V">
                <name type="only" value=".*"/>
              </method>
              <method sig="setText(Ljava/lang/String;)V">
                <name type="only" value=".*"/>
              </method>
            </class>
          </JTextComponent>
          <Document>
            <class>
              <method sig="render(Ljava/lang/Runnable;)V">
                <name type="only" value=".*"/>
              </method>
            </class>
          </Document>
          <PlainDocument>
            <class>
              <method sig="insertString(ILjava/lang/String;
               Ljavax/swing/text/AttributeSet;)V">

                <name type="only" value=".*"/>
              </method>
            </class>
          </PlainDocument>
          <DefaultStyledDocument>
            <class>
              <method sig="insert(I[Ljavax/swing/text/DefaultStyledDocument
               $ElementSpec;)V">

                <name type="only" value=".*"/>
              </method>
              <method sig="setLogicalStyle(ILjavax/swing/text/Style;)V">
                <name type="only" value=".*"/>
              </method>
              <method sig="setCharacterAttributes(IILjavax/swing/text/AttributeSet;Z)V">
                <name type="only" value=".*"/>
              </method>
              <method sig="setParagraphAttributes(IILjavax/swing/text/AttributeSet;Z)V">
                <name type="only" value=".*"/>
              </method>
            </class>
          </DefaultStyledDocument>
          <StyleContext>
            <class>
              <method sig="addAttribute(Ljavax/swing/text/AttributeSet;Ljava/lang/Object;
               Ljava/langObject;)Ljavax/swing/text/AttributeSet;">

                <name type="only" value=".*"/>
              </method>
              <method sig="addAttributes(Ljavax/swing/text/AttributeSet;
               Ljavax/swing/text/AttributeSet;)Ljavax/swing/text/AttributeSet;">

                <name type="only" value=".*"/>
              </method>
              <method sig="removeAttribute(Ljavax/swing/text/AttributeSet;
               Ljava/lang/Object;)Ljavax/swing/text/AttributeSet;">

                <name type="only" value=".*"/>
              </method>
              <method sig="removeAttributes(Ljavax/swing/text/AttributeSet;
               Ljava/util/Enumeration;)Ljavax/swing/text/AttributeSet;">

                <name type="only" value=".*"/>
              </method>
              <method sig="removeAttributes(Ljavax/swing/text/AttributeSet;
               Ljavax/swing/text/AttributeSet;)Ljavax/swing/text/AttributeSet;">

                <name type="only" value=".*"/>
              </method>
              <method sig="reclaim(Ljavax/swing/text/AttributeSet;)V">
                <name type="only" value=".*"/>
              </method>
            </class>
          </StyleContext>
          <html>
            <HTMLEditorKit-Parser>
              <class>
                <method sig="parse(Ljava/io/Reader;Ljavax/swing/text/html/
                 HTMLEditorKit$ParserCallback;Z)V">

                  <name type="only" value=".*"/>
                </method>
              </class>
            </HTMLEditorKit-Parser>
          </html>
        </text>
        <undo>
          <UndoManager>
            <class>
              <method sig="addEdit(Ljavax/swing/undo/UndoableEdit;)Z">
                <name type="only" value=".*"/>
              </method>
              <method sig="canRedo()Z">
                <name type="only" value=".*"/>
              </method>
              <method sig="canUndo()Z">
                <name type="only" value=".*"/>
              </method>
              <method sig="canUndoOrRedo()Z">
                <name type="only" value=".*"/>
              </method>
              <method sig="discardAllEdits()V">
                <name type="only" value=".*"/>
              </method>
              <method sig="end()V">
                <name type="only" value=".*"/>
              </method>
              <method sig="getLimit()I">
                <name type="only" value=".*"/>
              </method>
              <method sig="getRedoPresentationName()Ljava/lang/String;">
                <name type="only" value=".*"/>
              </method>
              <method sig="getUndoPresentationName()Ljava/lang/String;">
                <name type="only" value=".*"/>
              </method>
              <method sig="getUndoOrRedoPresentationName()Ljava/lang/String;">
                <name type="only" value=".*"/>
              </method>
              <method sig="redo()V">
                <name type="only" value=".*"/>
              </method>
              <method sig="setLimit(I)V">
                <name type="only" value=".*"/>
              </method>
              <method sig="undo()V">
                <name type="only" value=".*"/>
              </method>
              <method sig="undoOrRedo()V">
                <name type="only" value=".*"/>
              </method>
            </class>
          </UndoManager>
        </undo>
        <JComponent>
          <class>
            <method sig="revalidate()V">
              <name type="only" value=".*"/>
            </method>
          </class>
        </JComponent>
        <JTextArea>
          <class>
            <method sig="append(Ljava/lang/String;)V">
              <name type="only" value=".*"/>
            </method>
            <method sig="insert(Ljava/lang/String;I)V">
              <name type="only" value=".*"/>
            </method>
            <method sig="replaceRange(Ljava/lang/String;II)V">
              <name type="only" value=".*"/>
            </method>
          </class>
        </JTextArea>
        <JTextPane>
          <class>
            <method sig="insertComponent(Ljava/awt/Component;)V">
              <name type="only" value=".*"/>
            </method>
            <method sig="insertIcon(Ljavax/swing/Icon;)V">
              <name type="only" value=".*"/>
            </method>
            <method sig="setLogicalStyle(Ljavax/swing/text/Style;)V">
              <name type="only" value=".*"/>
            </method>
            <method sig="setCharacterAttributes(Ljavax/swing/text/AttributeSet;Z)V">
              <name type="only" value=".*"/>
            </method>
            <method sig="setParagraphAttributes(Ljavax/swing/text/AttributeSet;Z)V">
              <name type="only" value=".*"/>
            </method>
          </class>
        </JTextPane>
      </swing>
    </javax>
    <java>
      <awt>
        <Component>
          <class>
            <method sig="repaint()V">
              <name type="only" value=".*"/>
            </method>
            <method sig="invalidate()V">
              <name type="only" value=".*"/>
            </method>
          </class>
        </Component>
      </awt>
    </java>
  </threadcheck>
</concutest>

and in a more human-readable form after being processed by the XMLAnnotToText tool:

class javax.swing.plaf.TextUI {

	@OnlyRunBy(@ThreadDesc(eventthread="true"))
	java.awt.Rectangle modelToView(javax.swing.text.JTextComponent a, int b);

	@OnlyRunBy(@ThreadDesc(eventthread="true"))
	java.awt.Rectangle modelToView(javax.swing.text.JTextComponent a, int b,
	   javax.swing.text.Position$Bias c);
}

class javax.swing.text.DefaultCaret {

	@OnlyRunBy(@ThreadDesc(eventthread="true"))
	void repaintNewCaret();

	@OnlyRunBy(@ThreadDesc(eventthread=".*"))
	void repaint();
}

class javax.swing.text.JTextComponent {

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void replaceSelection(java.lang.String a);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void setText(java.lang.String a);
}

class javax.swing.text.Document {

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void render(java.lang.Runnable a);
}

class javax.swing.text.PlainDocument {

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void insertString(int a, java.lang.String b, javax.swing.text.AttributeSet c);
}

class javax.swing.text.DefaultStyledDocument {

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void insert(int a, javax.swing.text.DefaultStyledDocument$ElementSpec[] b);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void setLogicalStyle(int a, javax.swing.text.Style b);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void setCharacterAttributes(int a, int b, javax.swing.text.AttributeSet c, boolean d);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void setParagraphAttributes(int a, int b, javax.swing.text.AttributeSet c, boolean d);
}

class javax.swing.text.StyleContext {

	@OnlyRunBy(@ThreadDesc(name=".*"))
	javax.swing.text.AttributeSet addAttribute(javax.swing.text.AttributeSet a,
	  java.lang.Object b, java.langObject c);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	javax.swing.text.AttributeSet addAttributes(javax.swing.text.AttributeSet a,
	  javax.swing.text.AttributeSet b);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	javax.swing.text.AttributeSet removeAttribute(javax.swing.text.AttributeSet a,
	  java.lang.Object b);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	javax.swing.text.AttributeSet removeAttributes(javax.swing.text.AttributeSet a,
	  java.util.Enumeration b);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	javax.swing.text.AttributeSet removeAttributes(javax.swing.text.AttributeSet a,
	  javax.swing.text.AttributeSet b);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void reclaim(javax.swing.text.AttributeSet a);
}

class javax.swing.text.html.HTMLEditorKit$Parser {

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void parse(java.io.Reader a, javax.swing.text.html.HTMLEditorKit$
	  ParserCallback b, boolean c);
}

class javax.swing.undo.UndoManager {

	@OnlyRunBy(@ThreadDesc(name=".*"))
	boolean addEdit(javax.swing.undo.UndoableEdit a);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	boolean canRedo();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	boolean canUndo();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	boolean canUndoOrRedo();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void discardAllEdits();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void end();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	int getLimit();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	java.lang.String getRedoPresentationName();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	java.lang.String getUndoPresentationName();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	java.lang.String getUndoOrRedoPresentationName();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void redo();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void setLimit(int a);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void undo();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void undoOrRedo();
}

class javax.swing.JComponent {

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void revalidate();
}

class javax.swing.JTextArea {

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void append(java.lang.String a);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void insert(java.lang.String a, int b);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void replaceRange(java.lang.String a, int b, int c);
}

class javax.swing.JTextPane {

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void insertComponent(java.awt.Component a);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void insertIcon(javax.swing.Icon a);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void setLogicalStyle(javax.swing.text.Style a);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void setCharacterAttributes(javax.swing.text.AttributeSet a, boolean b);

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void setParagraphAttributes(javax.swing.text.AttributeSet a, boolean b);
}

class java.awt.Component {

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void repaint();

	@OnlyRunBy(@ThreadDesc(name=".*"))
	void invalidate();
}
Share

About Mathias

Software development engineer. Principal developer of DrJava. Recent Ph.D. graduate from the Department of Computer Science at Rice University.
This entry was posted in Concurrent Unit Testing. Bookmark the permalink.

Leave a Reply