Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration against Eclipse 2021-12 (4.22.0) - V01 #15

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Eclipse-Copyright-Generator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
4 changes: 3 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ Plugin for Eclipse IDE to add and manage copyright headers at the beginning of t
Fork of the link:http://sourceforge.net/projects/eclipsecopyrigh/[Eclipse Copyright Generator project] on sourceforge.

Initial work by Eric Wuillai.
Contributors: Jeremie Bresson, Matthew Krupcale.
Contributors: Jeremie Bresson, Matthew Krupcale, Philippe Krief.

This new version runs on *Eclipse Version: 2021-12 (4.22.0)*

//end::description[]
Read more about installation, usage on the link:{homepage}[project home page].
Expand Down
8 changes: 4 additions & 4 deletions com.wdev91.eclipse.copyright.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="com.wdev91.eclipse.copyright.feature"
label="%featureName"
version="1.5.3"
version="1.6.2"
provider-name="%providerName">

<description>
Expand Down Expand Up @@ -48,11 +48,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</url>

<requires>
<import plugin="org.eclipse.core.runtime" version="3.5.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.resources" version="3.5.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui" version="3.5.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.ide"/>
<import plugin="org.eclipse.core.resources" version="3.16" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.runtime" version="3.24" match="greaterOrEqual"/>
<import plugin="org.eclipse.help"/>
<import plugin="org.eclipse.ui" version="3.2" match="greaterOrEqual"/>
</requires>

<plugin
Expand Down
2 changes: 1 addition & 1 deletion com.wdev91.eclipse.copyright.site/site.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/com.wdev91.eclipse.copyright.feature_1.5.3.jar" id="com.wdev91.eclipse.copyright.feature" version="1.5.3"/>
<feature url="features/com.wdev91.eclipse.copyright.feature_1.6.2.jar" id="com.wdev91.eclipse.copyright.feature" version="1.6.2"/>
</site>
6 changes: 5 additions & 1 deletion com.wdev91.eclipse.copyright/.classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
14 changes: 7 additions & 7 deletions com.wdev91.eclipse.copyright/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: com.wdev91.eclipse.copyright;singleton:=true
Bundle-Version: 1.5.3
Bundle-Version: 1.6.2
Bundle-Activator: com.wdev91.eclipse.copyright.Activator
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
org.eclipse.core.resources;bundle-version="3.5.0",
org.eclipse.ui;bundle-version="3.5.0",
org.eclipse.ui.ide
Eclipse-LazyStart: true
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources;bundle-version="3.16.0",
org.eclipse.ui.ide;bundle-version="3.18.400"
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.wdev91.eclipse.copyright
36 changes: 0 additions & 36 deletions com.wdev91.eclipse.copyright/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
point="org.eclipse.ui.actionSets">
<actionSet
description="%actionset_descr"
id="com.wdev91.eclipse.copyright.actionSet"
label="%actionset_label"
visible="true">
<action
class="com.wdev91.eclipse.copyright.actions.ApplyCopyrightAction"
icon="icons/copyright.gif"
id="com.wdev91.eclipse.copyright.ApplyCopyrightAction"
label="%actionApply_label"
menubarPath="project/additions"
tooltip="%actionApply_tooltip">
</action>
</actionSet>
</extension>
<extension
point="org.eclipse.ui.preferencePages">
<page
Expand Down Expand Up @@ -73,25 +56,6 @@
<command
commandId="com.wdev91.eclipse.copyright.ApplyCopyrightCommand"
style="push">
<visibleWhen
checkEnabled="false">
<with
variable="activeMenuSelection">
<iterate
ifEmpty="false">
<and>
<adapt
type="org.eclipse.core.resources.IResource">
</adapt>
<not>
<adapt
type="org.eclipse.core.resources.IProject">
</adapt>
</not>
</and>
</iterate>
</with>
</visibleWhen>
</command>
</menuContribution>
</extension>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {

/** The plug-in ID */
public static final String PLUGIN_ID = "com.wdev91.eclipse.copyright"; //$NON-NLS-1$

Expand All @@ -27,7 +28,6 @@ public class Activator extends AbstractUIPlugin {
* The constructor
*/
public Activator() {
plugin = this;
}

/**
Expand All @@ -46,6 +46,7 @@ public static Activator getDefault() {
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* Contributors:
* Eric Wuillai - initial API and implementation
* Philippe Krief - updated for Eclipse 4.x
******************************************************************************/
package com.wdev91.eclipse.copyright.actions;

Expand Down Expand Up @@ -55,15 +56,21 @@ private void addFile(IResource res, List<IFile> resources) {
addFile(member, resources);
}
} catch (CoreException e) {}
}
} else if ( res instanceof IProject ) {
try {
for (IResource member : ((IProject) res).members(IFolder.EXCLUDE_DERIVED)) {
addFile(member, resources);
}
} catch (CoreException e) {}
}
}

public Object execute(ExecutionEvent event) throws ExecutionException {
// Creates list of selected files
List<IFile> resources = new ArrayList<IFile>();
IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getActiveMenuSelection(event);
for (Object sel : selection.toArray()) {
if ( sel instanceof IFile || sel instanceof IFolder ) {
if ( sel instanceof IFile || sel instanceof IFolder || sel instanceof IProject ) {
addFile((IResource) sel, resources);
} else {
Object ao = null;
Expand Down Expand Up @@ -120,7 +127,7 @@ private IResource findJavaResource(Object obj) {
try {
Method m = obj.getClass().getMethod("getResource"); //$NON-NLS-1$
Object res = m.invoke(obj);
if ( res instanceof IFile || res instanceof IFolder ) {
if ( res instanceof IFile || res instanceof IFolder || res instanceof IProject ) {
return (IResource) res;
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@

public class CheckboxFilteredTree extends FilteredTree {

public CheckboxFilteredTree(Composite parent, boolean useNewLook) {
super(parent, useNewLook);
}

public CheckboxFilteredTree(Composite parent, int treeStyle,
PatternFilter filter, boolean useNewLook) {
super(parent, treeStyle, filter, useNewLook);
public CheckboxFilteredTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook) {
super(parent, treeStyle, filter, useNewLook, true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private static void applyCopyright(IFile file, final CopyrightSettings settings,
String charset = file.getCharset(true);

reader = new BufferedReader(new InputStreamReader(file.getContents(), charset));
buffer = new StringWriter(new Long(f.length()).intValue());
buffer = new StringWriter(Long.valueOf(f.length()).intValue());
writer = new PrintWriter(buffer);

// Reads the first line of the file
Expand Down Expand Up @@ -683,17 +683,17 @@ private static boolean isValidFile(IFile file, StringMatcher[] includeMatchers,
}
}
}
HeaderFormat format = getHeaderFormat(settings, file, ct);
if ( format == null ) {
// No format defined for this content type or its parents
return false;
} else if ( format.isExcluded() ) {
// Content type excluded from copyright
return false;
}

// Checks if the file already have a header
if ( ! settings.isForceApply() ) {
HeaderFormat format = getHeaderFormat(settings, file, ct);
if ( format == null ) {
// No format defined for this content type or its parents
return false;
} else if ( format.isExcluded() ) {
// Content type excluded from copyright
return false;
}
reader = new BufferedReader(new InputStreamReader(file.getContents()));
String line = reader.readLine();
if ( line != null && format.skipFirstLine(line) ) {
Expand Down
4 changes: 2 additions & 2 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.wdev91.eclipse.copyright</groupId>
<artifactId>docs</artifactId>
<version>1.5.3</version>
<version>1.6.0</version>
<packaging>pom</packaging>

<pluginRepositories>
Expand All @@ -22,7 +22,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<asciidoctor.maven.plugin.version>1.5.3</asciidoctor.maven.plugin.version>
<asciidoctor.maven.plugin.version>1.6.0</asciidoctor.maven.plugin.version>
<asciidoctorj.version>1.5.4</asciidoctorj.version>
<asciidoctorj.gh-edit.version>3.0.0</asciidoctorj.gh-edit.version>
<jruby.version>9.0.5.0</jruby.version>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.wdev91.eclipse.copyright</groupId>
<artifactId>root</artifactId>
<version>1.5.3</version>
<version>1.6</version>
<packaging>pom</packaging>

<modules>
Expand Down