Skip to content

Conversation

@badvision
Copy link
Contributor

This cleans up how primary type and resource type are managed. I removed the child content type feature because it was too confusing to use and even more confusing in the code implementation. Now if you want a jcr:content child, add a content property to your object and use a @nAmed("jcr:content") annotation. This means that the java object graph should be more or less identical to the jcr node graph.

*/
package org.apache.sling.models.persistor;

import com.drew.lang.annotations.NotNull;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@badvision any particular reason for changing annotation types? A number of other projects use the Jetbrains annotations, so it'd be better to be consistent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm good point, I think that was an oversight as I was having difficulty building in this one case -- happy to revert them back.

*/
package org.apache.sling.models.persistor.impl;

import com.drew.lang.annotations.NotNull;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment re:annotation

private static String getNodeType(Object obj) throws IllegalArgumentException, IllegalAccessException {
for (Field f : obj.getClass().getDeclaredFields()) {
Named namedAnnotation = f.getAnnotation(Named.class);
if (namedAnnotation != null && namedAnnotation.value().equals("jcr:primaryType")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, I try to avoid hard-coding too. Thanks for catching that.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 1, 2021

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

1 similar comment
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants