Skip to content

Commit 2e4e512

Browse files
committed
Fixed issue of failing duplicate line ending removal
and therefore failing jhipster jdl command. Also workaround prettier formatting to cause producing duplicate entries in the class
1 parent f07e7f1 commit 2e4e512

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

generators/spring-boot-javers/__snapshots__/generator.spec.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ exports[`SubGenerator spring-boot-javers of entity-audit JHipster blueprint > sh
9494
"contents": "package com.mycompany.myapp.config.audit;
9595
9696
public enum AuditedEntity {
97-
CAMELCASE(com.mycompany.myapp.domain.CamelCase.class, "domain.CamelCase"),
98-
CUSTOM_WITHENTITYPACKAGE(com.mycompany.myapp.custom.domain.WithEntityPackage.class, "custom.domain.WithEntityPackage");
97+
CAMELCASE( com.mycompany.myapp.domain.CamelCase.class, "domain.CamelCase" ),
98+
CUSTOM_WITHENTITYPACKAGE( com.mycompany.myapp.custom.domain.WithEntityPackage.class, "custom.domain.WithEntityPackage" );
9999
// jhipster-needle-add-audited-entities - JHipster will add entities to this enum
100100
101101
private final Class<?> entityClass;

generators/spring-boot-javers/generator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class extends BaseApplicationGenerator {
2222
},
2323
async addNeedle({ application, source }) {
2424
source.addEntityToAuditedEntityEnum = ({ entityAuditEnumValue, entityAbsoluteClass, entityAuditEventType }) => {
25-
const enumValueDeclaration = `${entityAuditEnumValue}(${entityAbsoluteClass}.class, "${entityAuditEventType}")`;
25+
const enumValueDeclaration = `${entityAuditEnumValue}( ${entityAbsoluteClass}.class, "${entityAuditEventType}" )`;
2626
this.editFile(
2727
`${application.javaPackageSrcDir}config/audit/AuditedEntity.java`,
2828
createNeedleCallback({
@@ -39,7 +39,7 @@ export default class extends BaseApplicationGenerator {
3939
const needleIndex = content.indexOf(' // jhipster-needle-add-audited-entities');
4040
let beforeContent = content.substring(0, needleIndex);
4141
// Drop extra line ending if it exists, can be caused by prettier formatting
42-
beforeContent = beforeContent.endsWith('/n/n') ? beforeContent.slice(0, -1) : beforeContent;
42+
beforeContent = beforeContent.endsWith('\n\n') ? beforeContent.slice(0, -1) : beforeContent;
4343
const afterContent = content.substring(needleIndex);
4444

4545
if (!beforeContent.includes(needleValuePrefix) || !beforeContent.endsWith(needleValueSuffix)) {

0 commit comments

Comments
 (0)