~ubuntu-branches/ubuntu/wily/aspectj/wily-proposed

« back to all changes in this revision

Viewing changes to org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/Lint.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2011-03-15 23:54:31 UTC
  • mfrom: (1.2.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20110315235431-iq2gxbsx08kpwuiw
* New upstream release.
* Updated Standards-Version to 3.9.1 (no changes needed).
* Fix local Javadoc links:
  - d/patches/07_javadoc_links.diff: Use locally installed
   javadoc packages and hyperlink with them.
  - d/control: Add B-D on default-java-doc and libasm3-java-doc.
* d/control: Drop B-D on itself (our new bootstrap infrastructure doesn't need
  that anymore).
* Split packages into :
  - aspectj: only contains CLI tools.
  - libaspectj-java: JAR librairies for /usr/share/java.
  - libaspectj-java-doc: 4 API's Javadoc.
  - aspectj-doc: Programming Guides and SDK Documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
        private static Trace trace = TraceFactory.getTraceFactory().getTrace(Lint.class);
140
140
 
141
141
        public Lint(World world) {
142
 
                if (trace.isTraceEnabled())
 
142
                if (trace.isTraceEnabled()) {
143
143
                        trace.enter("<init>", this, world);
 
144
                }
144
145
                this.world = world;
145
 
                if (trace.isTraceEnabled())
 
146
                if (trace.isTraceEnabled()) {
146
147
                        trace.exit("<init>");
 
148
                }
147
149
        }
148
150
 
149
151
        public void setAll(String messageKind) {
150
 
                if (trace.isTraceEnabled())
 
152
                if (trace.isTraceEnabled()) {
151
153
                        trace.enter("setAll", this, messageKind);
 
154
                }
152
155
                setAll(getMessageKind(messageKind));
153
 
                if (trace.isTraceEnabled())
 
156
                if (trace.isTraceEnabled()) {
154
157
                        trace.exit("setAll");
 
158
                }
155
159
        }
156
160
 
157
161
        private void setAll(IMessage.Kind messageKind) {
161
165
        }
162
166
 
163
167
        public void setFromProperties(File file) {
164
 
                if (trace.isTraceEnabled())
 
168
                if (trace.isTraceEnabled()) {
165
169
                        trace.enter("setFromProperties", this, file);
 
170
                }
166
171
                InputStream s = null;
167
172
                try {
168
173
                        s = new FileInputStream(file);
169
174
                        setFromProperties(s);
170
175
                } catch (IOException ioe) {
171
 
                        MessageUtil.error(world.getMessageHandler(), WeaverMessages.format(WeaverMessages.XLINT_LOAD_ERROR, file.getPath(), ioe
172
 
                                        .getMessage()));
 
176
                        MessageUtil.error(world.getMessageHandler(),
 
177
                                        WeaverMessages.format(WeaverMessages.XLINT_LOAD_ERROR, file.getPath(), ioe.getMessage()));
173
178
                } finally {
174
179
                        if (s != null) {
175
180
                                try {
180
185
                        }
181
186
                }
182
187
 
183
 
                if (trace.isTraceEnabled())
 
188
                if (trace.isTraceEnabled()) {
184
189
                        trace.exit("setFromProperties");
 
190
                }
185
191
        }
186
192
 
187
193
        public void loadDefaultProperties() {
193
199
                try {
194
200
                        setFromProperties(s);
195
201
                } catch (IOException ioe) {
196
 
                        MessageUtil.error(world.getMessageHandler(), WeaverMessages.format(WeaverMessages.XLINTDEFAULT_LOAD_PROBLEM, ioe
197
 
                                        .getMessage()));
 
202
                        MessageUtil.error(world.getMessageHandler(),
 
203
                                        WeaverMessages.format(WeaverMessages.XLINTDEFAULT_LOAD_PROBLEM, ioe.getMessage()));
198
204
                } finally {
199
205
                        try {
200
206
                                s.close();
211
217
                setFromProperties(p);
212
218
        }
213
219
 
 
220
        @SuppressWarnings("rawtypes")
214
221
        public void setFromProperties(Properties properties) {
215
222
                for (Iterator i = properties.entrySet().iterator(); i.hasNext();) {
216
223
                        Map.Entry entry = (Map.Entry) i.next();
232
239
        }
233
240
 
234
241
        // temporarily suppress the given lint messages
235
 
        public void suppressKinds(Collection lintKind) {
236
 
                if (lintKind.isEmpty())
 
242
        public void suppressKinds(Collection<Kind> lintKind) {
 
243
                if (lintKind.isEmpty()) {
237
244
                        return;
238
 
                for (Iterator iter = lintKind.iterator(); iter.hasNext();) {
239
 
                        Kind k = (Kind) iter.next();
 
245
                }
 
246
                for (Kind k : lintKind) {
240
247
                        k.setSuppressed(true);
241
248
                }
242
249
        }
255
262
        }
256
263
 
257
264
        private IMessage.Kind getMessageKind(String v) {
258
 
                if (v.equals("ignore"))
 
265
                if (v.equals("ignore")) {
259
266
                        return null;
260
 
                else if (v.equals("warning"))
 
267
                } else if (v.equals("warning")) {
261
268
                        return IMessage.WARNING;
262
 
                else if (v.equals("error"))
 
269
                } else if (v.equals("error")) {
263
270
                        return IMessage.ERROR;
 
271
                }
264
272
 
265
273
                MessageUtil.error(world.getMessageHandler(), WeaverMessages.format(WeaverMessages.XLINT_VALUE_ERROR, v));
266
274
                return null;
308
316
                }
309
317
 
310
318
                public void signal(String info, ISourceLocation location) {
311
 
                        if (kind == null)
 
319
                        if (kind == null) {
312
320
                                return;
 
321
                        }
313
322
 
314
323
                        String text = MessageFormat.format(message, new Object[] { info });
315
324
                        text += " [Xlint:" + name + "]";
317
326
                }
318
327
 
319
328
                public void signal(String[] infos, ISourceLocation location, ISourceLocation[] extraLocations) {
320
 
                        if (kind == null)
 
329
                        if (kind == null) {
321
330
                                return;
 
331
                        }
322
332
 
323
333
                        String text = MessageFormat.format(message, (Object[]) infos);
324
334
                        text += " [Xlint:" + name + "]";