Lines 15-22
Link Here
|
15 |
*******************************************************************************/ |
15 |
*******************************************************************************/ |
16 |
package org.eclipse.jdt.internal.compiler.batch; |
16 |
package org.eclipse.jdt.internal.compiler.batch; |
17 |
|
17 |
|
|
|
18 |
import java.io.BufferedInputStream; |
18 |
import java.io.ByteArrayInputStream; |
19 |
import java.io.ByteArrayInputStream; |
19 |
import java.io.File; |
20 |
import java.io.File; |
|
|
21 |
import java.io.FileInputStream; |
20 |
import java.io.FileNotFoundException; |
22 |
import java.io.FileNotFoundException; |
21 |
import java.io.FileOutputStream; |
23 |
import java.io.FileOutputStream; |
22 |
import java.io.FilenameFilter; |
24 |
import java.io.FilenameFilter; |
Lines 41-46
Link Here
|
41 |
import java.util.Locale; |
43 |
import java.util.Locale; |
42 |
import java.util.Map; |
44 |
import java.util.Map; |
43 |
import java.util.MissingResourceException; |
45 |
import java.util.MissingResourceException; |
|
|
46 |
import java.util.Properties; |
44 |
import java.util.ResourceBundle; |
47 |
import java.util.ResourceBundle; |
45 |
import java.util.Set; |
48 |
import java.util.Set; |
46 |
import java.util.StringTokenizer; |
49 |
import java.util.StringTokenizer; |
Lines 1713-1718
Link Here
|
1713 |
final int INSIDE_PROCESSOR_start = 18; |
1716 |
final int INSIDE_PROCESSOR_start = 18; |
1714 |
final int INSIDE_S_start = 19; |
1717 |
final int INSIDE_S_start = 19; |
1715 |
final int INSIDE_CLASS_NAMES = 20; |
1718 |
final int INSIDE_CLASS_NAMES = 20; |
|
|
1719 |
final int INSIDE_WARNINGS_PROPERTIES = 21; |
1716 |
|
1720 |
|
1717 |
final int DEFAULT = 0; |
1721 |
final int DEFAULT = 0; |
1718 |
ArrayList bootclasspaths = new ArrayList(DEFAULT_SIZE_CLASSPATH); |
1722 |
ArrayList bootclasspaths = new ArrayList(DEFAULT_SIZE_CLASSPATH); |
Lines 2095-2101
Link Here
|
2095 |
continue; |
2099 |
continue; |
2096 |
} |
2100 |
} |
2097 |
if (currentArg.equals("-inlineJSR")) { //$NON-NLS-1$ |
2101 |
if (currentArg.equals("-inlineJSR")) { //$NON-NLS-1$ |
2098 |
mode = DEFAULT; |
2102 |
mode = DEFAULT; |
2099 |
this.options.put( |
2103 |
this.options.put( |
2100 |
CompilerOptions.OPTION_InlineJsr, |
2104 |
CompilerOptions.OPTION_InlineJsr, |
2101 |
CompilerOptions.ENABLED); |
2105 |
CompilerOptions.ENABLED); |
Lines 2368-2373
Link Here
|
2368 |
mode = INSIDE_CLASS_NAMES; |
2372 |
mode = INSIDE_CLASS_NAMES; |
2369 |
continue; |
2373 |
continue; |
2370 |
} |
2374 |
} |
|
|
2375 |
if (currentArg.equals("-properties")) { //$NON-NLS-1$ |
2376 |
mode = INSIDE_WARNINGS_PROPERTIES; |
2377 |
continue; |
2378 |
} |
2371 |
break; |
2379 |
break; |
2372 |
case INSIDE_TARGET : |
2380 |
case INSIDE_TARGET : |
2373 |
if (this.didSpecifyTarget) { |
2381 |
if (this.didSpecifyTarget) { |
Lines 2544-2549
Link Here
|
2544 |
} |
2552 |
} |
2545 |
mode = DEFAULT; |
2553 |
mode = DEFAULT; |
2546 |
continue; |
2554 |
continue; |
|
|
2555 |
case INSIDE_WARNINGS_PROPERTIES : |
2556 |
initializeWarnings(currentArg); |
2557 |
mode = DEFAULT; |
2558 |
continue; |
2547 |
} |
2559 |
} |
2548 |
|
2560 |
|
2549 |
// default is input directory, if no custom destination path exists |
2561 |
// default is input directory, if no custom destination path exists |
Lines 2720-2725
Link Here
|
2720 |
this.pendingErrors = null; |
2732 |
this.pendingErrors = null; |
2721 |
} |
2733 |
} |
2722 |
} |
2734 |
} |
|
|
2735 |
private void initializeWarnings(String propertiesFile) { |
2736 |
File file = new File(propertiesFile); |
2737 |
if (!file.exists()) { |
2738 |
throw new IllegalArgumentException(this.bind("configure.missingwarningspropertiesfile", propertiesFile)); //$NON-NLS-1$ |
2739 |
} |
2740 |
BufferedInputStream stream = null; |
2741 |
Properties properties = null; |
2742 |
try { |
2743 |
stream = new BufferedInputStream(new FileInputStream(propertiesFile)); |
2744 |
properties = new Properties(); |
2745 |
properties.load(stream); |
2746 |
} catch(IOException e) { |
2747 |
e.printStackTrace(); |
2748 |
throw new IllegalArgumentException(this.bind("configure.ioexceptionwarningspropertiesfile", propertiesFile)); //$NON-NLS-1$ |
2749 |
} finally { |
2750 |
if (stream != null) { |
2751 |
try { |
2752 |
stream.close(); |
2753 |
} catch(IOException e) { |
2754 |
// ignore |
2755 |
} |
2756 |
} |
2757 |
} |
2758 |
this.options.putAll(properties); |
2759 |
} |
2723 |
protected void disableWarnings() { |
2760 |
protected void disableWarnings() { |
2724 |
Object[] entries = this.options.entrySet().toArray(); |
2761 |
Object[] entries = this.options.entrySet().toArray(); |
2725 |
for (int i = 0, max = entries.length; i < max; i++) { |
2762 |
for (int i = 0, max = entries.length; i < max; i++) { |