Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 137691 Details for
Bug 235572
[relengtool] "Fix copyrights" doesnt detect existing Copyright in Windows .bat files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Simple patch fixing the issue
bug235572_detectRem.diff.txt (text/plain), 3.44 KB, created by
Martin Oberhuber
on 2009-05-29 14:16:09 EDT
(
hide
)
Description:
Simple patch fixing the issue
Filename:
MIME Type:
Creator:
Martin Oberhuber
Created:
2009-05-29 14:16:09 EDT
Size:
3.44 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.releng.tools >Index: src/org/eclipse/releng/tools/SourceFile.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.releng.tools/src/org/eclipse/releng/tools/SourceFile.java,v >retrieving revision 1.8 >diff -u -r1.8 SourceFile.java >--- src/org/eclipse/releng/tools/SourceFile.java 31 Dec 2008 14:56:41 -0000 1.8 >+++ src/org/eclipse/releng/tools/SourceFile.java 29 May 2009 18:11:00 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Martin Oberhuber (Wind River) - [235572] detect existing comments in bat files > *******************************************************************************/ > package org.eclipse.releng.tools; > >@@ -70,6 +71,16 @@ > initialize(); > } > >+ /** >+ * Test if the given line marks the start of a potential Copyright comment. >+ * Can be overridden in subclasses to perform advanced detection. >+ * @param aLine a line of text to check >+ * @return <code>true</code> if the line can mark a copyright comment start. >+ * @since 3.5 >+ */ >+ public boolean isCommentStart(String aLine) { >+ return aLine.trim().startsWith(getCommentStart()); >+ } > public abstract String getCommentStart(); > public abstract String getCommentEnd(); > >@@ -106,7 +117,7 @@ > while (aLine != null) { > contentsWriter.write(aLine); > contentsWriter.newLine(); >- if (!inComment && aLine.trim().startsWith(getCommentStart())) { >+ if (!inComment && isCommentStart(aLine)) { > // start saving comment > inComment = true; > commentStart = lineNumber; >Index: src/org/eclipse/releng/tools/BatFile.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.releng.tools/src/org/eclipse/releng/tools/BatFile.java,v >retrieving revision 1.5 >diff -u -r1.5 BatFile.java >--- src/org/eclipse/releng/tools/BatFile.java 20 May 2009 19:07:04 -0000 1.5 >+++ src/org/eclipse/releng/tools/BatFile.java 29 May 2009 18:10:59 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Martin Oberhuber (Wind River) - [235572] detect existing comments in bat files > *******************************************************************************/ > package org.eclipse.releng.tools; > >@@ -18,6 +19,11 @@ > super(file); > } > >+ public boolean isCommentStart(String aLine) { >+ String s = aLine.trim().toLowerCase(); >+ return s.startsWith("@rem **") || s.startsWith("rem **"); >+ } >+ > public String getCommentStart() { > return "@rem **"; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 235572
:
137691
|
137702