Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dprzybyl committed Jul 28, 2023
1 parent 2644d87 commit a94cb93
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions app/aem/actions.checks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ aem {
packageCompose {
installBundleProject(":app:aem:actions.checks")
vaultDefinition {
val currentVersion = rootProject.version as String
version.set(currentVersion)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
version.set(rootProject.version as String)
description.set(project.description)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public class ClearFromGroupDetacher {

static final Logger LOGGER = LoggerFactory.getLogger(ClearFromGroupDetacher.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ClearFromGroupDetacher.class);

private final Context context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public final class ContextImpl implements Context {
private Authorizable currentAuthorizable;

@Getter
private boolean compositeNodeStore;
private final boolean compositeNodeStore;

public ContextImpl(JackrabbitSession session, boolean compositeNodeStore) throws RepositoryException {
this.session = session;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public List<ProgressEntry> getExecutionSummary() {
}

@PostConstruct
protected void init() {
private void init() {
executionTimeCalendar = CalendarUtils.asCalendar(executionTime);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
@Model(adaptables = Resource.class, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class ScriptModel implements MutableScript {

private static Logger LOGGER = LoggerFactory.getLogger(ScriptModel.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ScriptModel.class);

private final String path;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public final class ScriptsRowModel {
private boolean isLaunchEnabled;

@PostConstruct
protected void afterCreated() {
private void afterCreated() {
this.isFolder = isFolder(resource);
this.scriptName = defaultIfEmpty(getProperty(resource, JcrConstants.JCR_TITLE), resource.getName());
if (!isFolder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ScriptValidationServlet : AbstractFormServlet<ScriptValidationForm>(Script

override fun doPost(form: ScriptValidationForm, resourceResolver: ResourceResolver): ResponseEntity<Any> {
return try {
val script = TransientScript.create(form.path, form.content);
val script = TransientScript.create(form.path, form.content)
val result = scriptManager.process(script, ExecutionMode.VALIDATION, resourceResolver)
if (result.isSuccess) {
ok {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ class RequestProcessor<F>(private val modelFactory: ModelFactory, private val fo
val form = modelFactory.createModel(httpRequest, formClass)
val response = process(form, httpRequest.resourceResolver)

httpResponse.setStatus(response.statusCode)
httpResponse.status = response.statusCode
ServletUtils.writeJson(httpResponse, body(response.body))
} catch (e: MissingElementsException) {
httpResponse.setStatus(HttpServletResponse.SC_BAD_REQUEST)
httpResponse.status = HttpServletResponse.SC_BAD_REQUEST
ServletUtils.writeJson(httpResponse, body(ErrorBody("Bad request", toErrors(e))))
} catch (e: Exception) {
httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR)
httpResponse.status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR
ServletUtils.writeJson(httpResponse, body(ErrorBody(e.message ?: "")))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ class ReferenceGraph(

other as Transition

if (other.id != this.id) return false

return true
return other.id == this.id
}

override fun hashCode(): Int {
Expand All @@ -100,9 +98,7 @@ class ReferenceGraph(

other as TreeNode

if (script.path != other.script.path) return false

return true
return script.path == other.script.path
}

override fun hashCode(): Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class VariableHolder {
contexts.peek().variables.putAll(variableHolder.contexts.peek().variables)
}

operator fun get(name: String): ApmType? {
operator fun get(name: String): ApmType {
val keys = name.split('.', '[', ']').filter { it.isNotEmpty() }
val context = contexts.firstOrNull { it.containsKey(keys[0]) }
var result: ApmType? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ParsedScript(val script: Script, val apm: ApmContext) {
companion object Factory {
fun create(script: Script): ParsedScript {
val logger: Logger = LoggerFactory.getLogger(ParsedScript::class.java)
logger.warn("Script parsing {}", script.path);
logger.warn("Script parsing {}", script.path)
val apmLangParser = ApmLangParserFactory.createParserForScriptContent(script.data)
return ParsedScript(script, apmLangParser.apm())
}
Expand Down
3 changes: 1 addition & 2 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ aem {
tasks {
packageCompose {
vaultDefinition {
val currentVersion = rootProject.version as String
version.set(currentVersion)
version.set(rootProject.version as String)
description.set(project.description)
property("installhook.apm.class", "com.cognifide.apm.core.tools.ApmInstallHook")
}
Expand Down

0 comments on commit a94cb93

Please sign in to comment.