|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2008 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 7-12
Link Here
|
| 7 |
* |
7 |
* |
| 8 |
* Contributors: |
8 |
* Contributors: |
| 9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
|
|
10 |
* Martin Oberhuber (Wind River) - [235572] detect existing comments in bat files |
| 10 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
| 11 |
package org.eclipse.releng.tools; |
12 |
package org.eclipse.releng.tools; |
| 12 |
|
13 |
|
|
Lines 70-75
Link Here
|
| 70 |
initialize(); |
71 |
initialize(); |
| 71 |
} |
72 |
} |
| 72 |
|
73 |
|
|
|
74 |
/** |
| 75 |
* Test if the given line marks the start of a potential Copyright comment. |
| 76 |
* Can be overridden in subclasses to perform advanced detection. |
| 77 |
* @param aLine a line of text to check |
| 78 |
* @return <code>true</code> if the line can mark a copyright comment start. |
| 79 |
* @since 3.5 |
| 80 |
*/ |
| 81 |
public boolean isCommentStart(String aLine) { |
| 82 |
return aLine.trim().startsWith(getCommentStart()); |
| 83 |
} |
| 73 |
public abstract String getCommentStart(); |
84 |
public abstract String getCommentStart(); |
| 74 |
public abstract String getCommentEnd(); |
85 |
public abstract String getCommentEnd(); |
| 75 |
|
86 |
|
|
Lines 106-112
Link Here
|
| 106 |
while (aLine != null) { |
117 |
while (aLine != null) { |
| 107 |
contentsWriter.write(aLine); |
118 |
contentsWriter.write(aLine); |
| 108 |
contentsWriter.newLine(); |
119 |
contentsWriter.newLine(); |
| 109 |
if (!inComment && aLine.trim().startsWith(getCommentStart())) { |
120 |
if (!inComment && isCommentStart(aLine)) { |
| 110 |
// start saving comment |
121 |
// start saving comment |
| 111 |
inComment = true; |
122 |
inComment = true; |
| 112 |
commentStart = lineNumber; |
123 |
commentStart = lineNumber; |