Skip to content

Commit 293bf38

Browse files
joaodinissfclaude
andcommitted
chore: remove LfNormalizingFileSystemAccess (now superseded by config)
Delete `LfNormalizingFileSystemAccess.java` and remove its wrap calls from `CheckGenerator.xtend` and `CheckCfgGenerator.xtend`. The decorator was introduced in PR #1331 as a post-hoc normaliser against CRLF leaks from various emission paths. After: - step 1 of this stack (#1352) — `.mwe2` `lineDelimiter` and `ddk-configuration` runtime prefs both flipped to `\n` - step 2 (#1353) — `line.separator=\n` propagated to every source-bearing bundle's `.settings/org.eclipse.core.runtime.prefs` - the preceding commit on this branch — `KeywordAnalysisHelper` no longer uses `PrintWriter.println()` …every emission path now produces LF natively. The wrapper is no-op work and the conditional `instanceof IFileSystemAccess2` cast it introduced is no longer needed. Closes #1345 — the planned extension of the same wrapper to `Scope` / `Format` / `Export` generators is no longer needed for the same reason. Those generators are already clean of `Strings.newLine()`, `System.lineSeparator()`, and hardcoded `"\r\n"` emission (audited). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 765822d commit 293bf38

3 files changed

Lines changed: 6 additions & 137 deletions

File tree

‎com.avaloq.tools.ddk.check.core/src/com/avaloq/tools/ddk/check/generator/CheckGenerator.xtend‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import com.google.inject.Inject
1616
import org.eclipse.emf.ecore.resource.Resource
1717
import org.eclipse.xtext.generator.AbstractFileSystemAccess
1818
import org.eclipse.xtext.generator.IFileSystemAccess
19-
import org.eclipse.xtext.generator.IFileSystemAccess2
2019
import org.eclipse.xtext.xbase.compiler.JvmModelGenerator
2120

2221
import static org.eclipse.xtext.xbase.lib.IteratorExtensions.*
@@ -37,24 +36,23 @@ class CheckGenerator extends JvmModelGenerator {
3736
@Inject ICheckGeneratorConfigProvider generatorConfigProvider;
3837

3938
override void doGenerate(Resource resource, IFileSystemAccess fsa) {
40-
val lfFsa = new LfNormalizingFileSystemAccess(fsa as IFileSystemAccess2)
41-
super.doGenerate(resource, lfFsa); // Generate validator, catalog, and preference initializer from inferred Jvm models.
39+
super.doGenerate(resource, fsa); // Generate validator, catalog, and preference initializer from inferred Jvm models.
4240
val config = generatorConfigProvider.get(resource?.URI);
4341
for (catalog : toIterable(resource.allContents).filter(typeof(CheckCatalog))) {
4442

45-
lfFsa.generateFile(catalog.issueCodesFilePath, catalog.compileIssueCodes)
46-
lfFsa.generateFile(catalog.standaloneSetupPath, catalog.compileStandaloneSetup)
43+
fsa.generateFile(catalog.issueCodesFilePath, catalog.compileIssueCodes)
44+
fsa.generateFile(catalog.standaloneSetupPath, catalog.compileStandaloneSetup)
4745

4846
// change output path for service registry
49-
lfFsa.generateFile(
47+
fsa.generateFile(
5048
CheckUtil::serviceRegistryClassName,
5149
CheckGeneratorConstants::CHECK_REGISTRY_OUTPUT,
5250
catalog.generateServiceRegistry(CheckUtil::serviceRegistryClassName, fsa)
5351
)
5452
// generate documentation for SCA-checks only
5553
if(config !== null && (config.doGenerateDocumentationForAllChecks || !config.generateLanguageInternalChecks)){
5654
// change output path for html files to docs/
57-
lfFsa.generateFile(catalog.docFileName, CheckGeneratorConstants::CHECK_DOC_OUTPUT, catalog.compileDoc)
55+
fsa.generateFile(catalog.docFileName, CheckGeneratorConstants::CHECK_DOC_OUTPUT, catalog.compileDoc)
5856
}
5957
}
6058
}

‎com.avaloq.tools.ddk.check.core/src/com/avaloq/tools/ddk/check/generator/LfNormalizingFileSystemAccess.java‎

Lines changed: 0 additions & 126 deletions
This file was deleted.

‎com.avaloq.tools.ddk.checkcfg.core/src/com/avaloq/tools/ddk/checkcfg/generator/CheckCfgGenerator.xtend‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
*******************************************************************************/
1111
package com.avaloq.tools.ddk.checkcfg.generator
1212

13-
import com.avaloq.tools.ddk.check.generator.LfNormalizingFileSystemAccess
1413
import com.avaloq.tools.ddk.check.runtime.configuration.ICheckConfigurationStoreService
1514
import com.avaloq.tools.ddk.checkcfg.checkcfg.CheckConfiguration
1615
import com.google.inject.Inject
1716
import org.eclipse.emf.ecore.resource.Resource
1817
import org.eclipse.xtext.generator.AbstractFileSystemAccess
1918
import org.eclipse.xtext.generator.IFileSystemAccess
20-
import org.eclipse.xtext.generator.IFileSystemAccess2
2119
import org.eclipse.xtext.generator.IGenerator
2220

2321
import static org.eclipse.xtext.xbase.lib.IteratorExtensions.*
@@ -39,9 +37,8 @@ class CheckCfgGenerator implements IGenerator {
3937
if (fsa instanceof AbstractFileSystemAccess) {
4038
fsa.setOutputPath(outputPath)
4139
}
42-
val lfFsa = new LfNormalizingFileSystemAccess(fsa as IFileSystemAccess2)
4340
for (configuration:toIterable(resource.allContents).filter(typeof(CheckConfiguration))) {
44-
lfFsa.generateFile(configuration.fileName, configuration.compile)
41+
fsa.generateFile(configuration.fileName, configuration.compile)
4542
}
4643
}
4744

0 commit comments

Comments
 (0)