Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
da9fbe4
Tempmaster2 (#31)
carstenartur Oct 14, 2025
d459839
Merge branch 'eclipse-jdt:master' into master
carstenartur Oct 18, 2025
f4e7b6f
Merge branch 'eclipse-jdt:master' into master
carstenartur Oct 26, 2025
2a92e5d
Merge branch 'eclipse-jdt:master' into master
carstenartur Nov 23, 2025
ff98667
Merge branch 'eclipse-jdt:master' into master
carstenartur Dec 7, 2025
bed9329
Merge branch 'eclipse-jdt:master' into master
carstenartur Dec 14, 2025
92191e1
Merge branch 'eclipse-jdt:master' into master
carstenartur Dec 20, 2025
ef4aa4f
Update CI to JDK 21 for Tycho 5.0.0 compatibility (#33)
Copilot Dec 20, 2025
a638db9
Align Tycho version to 5.0.1 in extensions.xml (#34)
Copilot Dec 20, 2025
8acb85d
Unify Tycho version to 5.0.1 across all POMs (#35)
Copilot Dec 20, 2025
4739ba4
Fix Maven/Tycho configuration for CI builds (#36)
Copilot Dec 20, 2025
23d7d5d
Initial plan (#37)
Copilot Dec 20, 2025
eccd74d
Downgrade Tycho from 5.0.1 to 5.0.0 to fix build failure (#39)
Copilot Dec 20, 2025
0aca2df
Upgrade Tycho from 5.0.0 to 5.0.1 to fix build ProvisionException (#40)
Copilot Dec 20, 2025
8c82f28
Add missing .mvn/extensions.xml for Tycho pomless extension (#38)
Copilot Dec 20, 2025
50eae99
Merge branch 'eclipse-jdt:master' into master
carstenartur Dec 24, 2025
cc7728f
Merge branch 'eclipse-jdt:master' into master
carstenartur Dec 31, 2025
b0d1f14
Add explicit encoding cleanup feature from explicitencoding branch
Copilot Dec 20, 2025
a78e368
Register UseExplicitEncodingCleanUp in plugin.xml
Copilot Dec 20, 2025
b53a1e6
Add explicit encoding cleanup UI integration
Copilot Dec 20, 2025
3b029e6
Fix code review issues - use Collections.emptyMap() and Locale.ROOT f…
Copilot Dec 20, 2025
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
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "maven" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
67 changes: 67 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow checks out code, performs a Codacy security scan
# and integrates the results with the
# GitHub Advanced Security code scanning feature. For more information on
# the Codacy security scan action usage and parameters, see
# https://github.com/codacy/codacy-analysis-cli-action.
# For more information on Codacy Analysis CLI in general, see
# https://github.com/codacy/codacy-analysis-cli.

name: Codacy Security Scan

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '24 8 * * 2'

permissions:
contents: read

jobs:
codacy-security-scan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v4

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
# uses: codacy/codacy-analysis-cli-action@33d455949345bddfdb845fba76b57b70cc83754b
env:
CODEQL_ACTION_EXTRA_OPTIONS: '{"database":{"interpret-results":["--max-paths", 1]}}'

with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647




# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
71 changes: 67 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,76 @@
name: CodeQL call

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "master" ]
branches: [ master ]
pull_request:
branches: [ "master" ]
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '15 8 * * 1'
- cron: '20 9 * * 2'

jobs:
callCodeQLworkflow:
uses: eclipse-platform/eclipse.platform.releng.aggregator/.github/workflows/codeQLworkflow.yml@master
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Maven
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
maven-version: 3.9.5
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# For Tycho/Eclipse projects, we need to use explicit Maven build instead
- name: Build with Maven
run: mvn -B package -Pbuild-individual-bundles --file pom.xml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
env:
CODEQL_ACTION_EXTRA_OPTIONS: '{"database":{"interpret-results":["--max-paths", 1]}}'
31 changes: 31 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Set up Maven
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
maven-version: 3.9.5
- name: Build with Maven
# run: mvn -B package -Dmaven.resolver.transport=wagon -Pbuild-individual-bundles --file pom.xml
run: mvn -B package -Pbuild-individual-bundles --file pom.xml
4 changes: 2 additions & 2 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.7
uses: cirrus-actions/rebase@1.8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<extension>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-build</artifactId>
<version>5.0.0</version>
<version>5.0.1</version>
</extension>
</extensions>
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# JDT UI

[![Java CI with Maven](https://github.com/carstenartur/eclipse.jdt.ui/actions/workflows/maven.yml/badge.svg)](https://github.com/carstenartur/eclipse.jdt.ui/actions/workflows/maven.yml)

[![Check Code Freeze Period](https://github.com/carstenartur/eclipse.jdt.ui/actions/workflows/verifyFreezePeriod.yml/badge.svg)](https://github.com/carstenartur/eclipse.jdt.ui/actions/workflows/verifyFreezePeriod.yml)

[![CodeQL](https://github.com/carstenartur/eclipse.jdt.ui/actions/workflows/codeql.yml/badge.svg)](https://github.com/carstenartur/eclipse.jdt.ui/actions/workflows/codeql.yml)

[![Codacy Security Scan](https://github.com/carstenartur/eclipse.jdt.ui/actions/workflows/codacy.yml/badge.svg)](https://github.com/carstenartur/eclipse.jdt.ui/actions/workflows/codacy.yml)

Thanks for your interest in this project.

This is the UI part of Eclipse's Java development tools, the user interface for the Java IDE.
This includes views like Package Explorer and JUnit, the Java and properties files editors, Java search, and refactorings.


For more information and important links, refer to the [JDT wiki page](https://github.com/eclipse-jdt/eclipse.jdt.core/wiki) or the [JDT project overview page](https://projects.eclipse.org/projects/eclipse.jdt).


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ private MultiFixMessages() {
public static String StringConcatToTextBlockCleanUp_description;
public static String StringConcatToTextBlockStringBuffer_description;
public static String StringBuilderForLocalVarsOnlyCleanUp_description;
public static String ExplicitEncodingCleanUp_description;
public static String ExplicitEncodingCleanUpFix_refactor;

static {
// initialize resource bundle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,5 @@ StringBufferToStringBuilderCleanUp_description=Convert StringBuffer to StringBui
StringConcatToTextBlockCleanUp_description=Convert String concatenation to Text Block
StringConcatToTextBlockStringBuffer_description=Convert String/StringBuffer/StringBuilder concatenation to Text Block
StringBuilderForLocalVarsOnlyCleanUp_description=Convert StringBuffer to StringBuilder for local variables
ExplicitEncodingCleanUp_description=Set explicit encoding or default encoding where applicable using {0}
ExplicitEncodingCleanUpFix_refactor=Use explicit encoding
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/*******************************************************************************
* Copyright (c) 2025 Carsten Hammer.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Carsten Hammer
*******************************************************************************/
package org.eclipse.jdt.internal.ui.fix;

import static org.eclipse.jdt.internal.corext.fix.CleanUpConstants.EXPLICITENCODING_CLEANUP;
import static org.eclipse.jdt.internal.corext.fix.CleanUpConstants.EXPLICITENCODING_INSERT_UTF8;
import static org.eclipse.jdt.internal.corext.fix.CleanUpConstants.EXPLICITENCODING_KEEP_BEHAVIOR;
import static org.eclipse.jdt.internal.ui.fix.MultiFixMessages.ExplicitEncodingCleanUpFix_refactor;
import static org.eclipse.jdt.internal.ui.fix.MultiFixMessages.ExplicitEncodingCleanUp_description;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.eclipse.core.runtime.CoreException;

import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.CompilationUnit;

import org.eclipse.jdt.internal.corext.fix.CompilationUnitRewriteOperationsFixCore;
import org.eclipse.jdt.internal.corext.fix.CompilationUnitRewriteOperationsFixCore.CompilationUnitRewriteOperation;
import org.eclipse.jdt.internal.corext.fix.UseExplicitEncodingFixCore;
import org.eclipse.jdt.internal.corext.fix.helper.ChangeBehavior;
import org.eclipse.jdt.internal.corext.util.Messages;

import org.eclipse.jdt.ui.cleanup.CleanUpContext;
import org.eclipse.jdt.ui.cleanup.CleanUpRequirements;
import org.eclipse.jdt.ui.cleanup.ICleanUpFix;

public class UseExplicitEncodingCleanUpCore extends AbstractCleanUp {
public UseExplicitEncodingCleanUpCore(final Map<String, String> options) {
super(options);
}
public UseExplicitEncodingCleanUpCore() {
}

@Override
public CleanUpRequirements getRequirements() {
return new CleanUpRequirements(requireAST(), false, false, null);
}

public boolean requireAST() {
return isEnabled(EXPLICITENCODING_CLEANUP)&& !computeFixSet().isEmpty();
}
@Override
public ICleanUpFix createFix(final CleanUpContext context) throws CoreException {
CompilationUnit compilationUnit= context.getAST();
if (compilationUnit == null) {
return null;
}
EnumSet<UseExplicitEncodingFixCore> computeFixSet= computeFixSet();
if(!isEnabled(EXPLICITENCODING_CLEANUP) || computeFixSet.isEmpty()) {
return null;
}

ChangeBehavior cb= computeRefactorDeepth();
Set<CompilationUnitRewriteOperation> operations= new LinkedHashSet<>();
Set<ASTNode> nodesprocessed= new HashSet<>();
computeFixSet.forEach(i->i.findOperations(compilationUnit,operations,nodesprocessed,cb));
if (operations.isEmpty()) {
return null;
}

CompilationUnitRewriteOperation[] array= operations.toArray(new CompilationUnitRewriteOperationsFixCore.CompilationUnitRewriteOperation[0]);
return new CompilationUnitRewriteOperationsFixCore(ExplicitEncodingCleanUpFix_refactor,
compilationUnit, array);
}

private ChangeBehavior computeRefactorDeepth() {
ChangeBehavior cb=ChangeBehavior.KEEP_BEHAVIOR;
if(isEnabled(EXPLICITENCODING_KEEP_BEHAVIOR)) {
cb=ChangeBehavior.KEEP_BEHAVIOR;
}
if(isEnabled(EXPLICITENCODING_INSERT_UTF8)) {
cb=ChangeBehavior.ENFORCE_UTF8;
}
return cb;
}

@Override
public String[] getStepDescriptions() {
List<String> result= new ArrayList<>();
if (isEnabled(EXPLICITENCODING_CLEANUP)) {
String with=computeRefactorDeepth().toString();
result.add(Messages.format(ExplicitEncodingCleanUp_description,new Object[] {with}));
}
return result.toArray(new String[0]);
}

@Override
public String getPreview() {
StringBuilder sb=new StringBuilder();
EnumSet<UseExplicitEncodingFixCore> computeFixSet= computeFixSet();
ChangeBehavior cb= computeRefactorDeepth();
EnumSet.allOf(UseExplicitEncodingFixCore.class).forEach(e->sb.append(e.getPreview(computeFixSet.contains(e),cb)));
return sb.toString();
}

private EnumSet<UseExplicitEncodingFixCore> computeFixSet() {
EnumSet<UseExplicitEncodingFixCore> fixSet= EnumSet.noneOf(UseExplicitEncodingFixCore.class);

if(isEnabled(EXPLICITENCODING_CLEANUP)) {
fixSet= EnumSet.allOf(UseExplicitEncodingFixCore.class);
}
return fixSet;
}
}
Loading
Loading