View | Details | Raw Unified | Return to bug 125961
Collapse All | Expand All

(-)batch/org/eclipse/jdt/internal/compiler/batch/Main.java (-13 / +39 lines)
Lines 170-175 Link Here
170
		}
170
		}
171
		private PrintWriter err;
171
		private PrintWriter err;
172
		boolean isXml;
172
		boolean isXml;
173
		private boolean isEmacs;
173
		private PrintWriter log;
174
		private PrintWriter log;
174
		private PrintWriter out;
175
		private PrintWriter out;
175
		private int tab;
176
		private int tab;
Lines 179-184 Link Here
179
			this.out = out;
180
			this.out = out;
180
			this.err = err;
181
			this.err = err;
181
			this.isXml = false;
182
			this.isXml = false;
183
			this.isEmacs = false;
182
			this.parameters = new HashMap();
184
			this.parameters = new HashMap();
183
		}
185
		}
184
186
Lines 222-227 Link Here
222
			this.printlnOut(Main.bind("progress.compiling")); //$NON-NLS-1$
224
			this.printlnOut(Main.bind("progress.compiling")); //$NON-NLS-1$
223
		}
225
		}
224
		
226
		
227
		public void setEmacs() {
228
			this.isEmacs = true;
229
		}
230
		
225
		/**
231
		/**
226
		 * Used to stop logging problems.
232
		 * Used to stop logging problems.
227
		 * Only use in xml mode.
233
		 * Only use in xml mode.
Lines 492-517 Link Here
492
498
493
		private void logProblem(IProblem problem, int localErrorCount,
499
		private void logProblem(IProblem problem, int localErrorCount,
494
			int globalErrorCount, char[] unitSource) {
500
			int globalErrorCount, char[] unitSource) {
495
			if (localErrorCount == 0) {
501
			if (this.isEmacs) {
496
				this.printlnErr("----------"); //$NON-NLS-1$
502
				String result = (new String(problem.getOriginatingFileName())
503
						+ ":" //$NON-NLS-1$
504
						+ problem.getSourceLineNumber()
505
						+ ": " //$NON-NLS-1$
506
						+ (problem.isError() ? Main.bind("Main.emacs.error") : Main.bind("Main.emacs.warning")) //$NON-NLS-1$ //$NON-NLS-2$
507
						+ ": " //$NON-NLS-1$
508
						+ problem.getMessage());
509
				this.printlnErr(result);
510
			} else {
511
				if (localErrorCount == 0) {
512
					this.printlnErr("----------"); //$NON-NLS-1$
513
				}
514
				this.printlnErr(problem.isError() ?
515
						Main.bind(
516
								"requestor.error", //$NON-NLS-1$
517
								Integer.toString(globalErrorCount),
518
								new String(problem.getOriginatingFileName()))
519
								: Main.bind(
520
										"requestor.warning", //$NON-NLS-1$
521
										Integer.toString(globalErrorCount),
522
										new String(problem.getOriginatingFileName())));
497
			}
523
			}
498
			this.printlnErr(problem.isError() ?
499
				Main.bind(
500
					"requestor.error", //$NON-NLS-1$
501
					Integer.toString(globalErrorCount),
502
					new String(problem.getOriginatingFileName()))
503
				: Main.bind(
504
					"requestor.warning", //$NON-NLS-1$
505
					Integer.toString(globalErrorCount),
506
					new String(problem.getOriginatingFileName())));
507
			try {
524
			try {
508
				this.printlnErr(((DefaultProblem) problem).errorReportSource(unitSource));
525
				this.printlnErr(((DefaultProblem) problem).errorReportSource(unitSource));
509
				this.printlnErr(problem.getMessage());
526
				if (! this.isEmacs)
527
					this.printlnErr(problem.getMessage());
510
			} catch (Exception e) {
528
			} catch (Exception e) {
511
				this.printlnErr(Main.bind(
529
				this.printlnErr(Main.bind(
512
					"requestor.notRetrieveErrorMessage", problem.toString())); //$NON-NLS-1$
530
					"requestor.notRetrieveErrorMessage", problem.toString())); //$NON-NLS-1$
513
			}
531
			}
514
			this.printlnErr("----------"); //$NON-NLS-1$
532
			if (! this.isEmacs)
533
				this.printlnErr("----------"); //$NON-NLS-1$
515
		}
534
		}
516
		
535
		
517
		/**
536
		/**
Lines 578-583 Link Here
578
						}));
597
						}));
579
				}
598
				}
580
			}
599
			}
600
			if (this.isEmacs)
601
				this.printlnErr(""); //$NON-NLS-1$
581
		}
602
		}
582
603
583
		public int logProblems(IProblem[] problems, char[] unitSource, Main currentMain) {
604
		public int logProblems(IProblem[] problems, char[] unitSource, Main currentMain) {
Lines 1960-1965 Link Here
1960
				useEnableJavadoc = true;
1981
				useEnableJavadoc = true;
1961
				continue;
1982
				continue;
1962
			}
1983
			}
1984
			if (currentArg.equals("-Xemacs")) { //$NON-NLS-1$
1985
				mode = Default;
1986
				this.logger.setEmacs();
1987
				continue;
1988
			}
1963
			// tolerated javac options - quietly filtered out
1989
			// tolerated javac options - quietly filtered out
1964
			if (currentArg.startsWith("-X")) { //$NON-NLS-1$
1990
			if (currentArg.startsWith("-X")) { //$NON-NLS-1$
1965
				mode = Default;
1991
				mode = Default;
(-)batch/org/eclipse/jdt/internal/compiler/batch/messages.properties (+2 lines)
Lines 223-225 Link Here
223
template.restrictedAccess.field = The field {0} from the type {1} is not accessible due to restriction on classpath entry {2}
223
template.restrictedAccess.field = The field {0} from the type {1} is not accessible due to restriction on classpath entry {2}
224
template.restrictedAccess.method = The method {0} from the type {1} is not accessible due to restriction on classpath entry {2}
224
template.restrictedAccess.method = The method {0} from the type {1} is not accessible due to restriction on classpath entry {2}
225
225
226
Main.emacs.error=error
227
Main.emacs.warning=warning
(-).settings/org.eclipse.core.resources.prefs (+3 lines)
Added Link Here
1
#Tue Jan 31 16:52:17 MST 2006
2
eclipse.preferences.version=1
3
encoding//compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java=ISO-8859-1

Return to bug 125961