Move Constants.java to annot#2786
Conversation
📝 WalkthroughWalkthroughThis PR relocates the Constants.java file from the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/ok-to-test |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
annot/src/main/java/com/predic8/membrane/annot/Constants.java (1)
87-89:⚠️ Potential issue | 🟡 MinorBroken Javadoc
{@link}references after package move.The Javadoc on
HTTP_NSstill references{@linkRequest},{@linkResponse}, and{@linkREST2SOAPInterceptor}, but the corresponding imports fromcom.predic8.membrane.corewere removed. Since theannotmodule presumably does not depend oncore, these will produce Javadoc warnings/errors.Proposed fix: replace with plain text or FQCNs
/** - * Used for {`@link` Request}-to-XML and XML-to-{`@link` Response} conversions. - * See {`@link` REST2SOAPInterceptor}. + * Used for Request-to-XML and XML-to-Response conversions. + * See REST2SOAPInterceptor. */ public static final String HTTP_NS = "http://membrane-soa.org/schemas/http/v1/";
🤖 Fix all issues with AI agents
In `@core/src/main/java/com/predic8/membrane/core/util/TimerManager.java`:
- Around line 16-17: The new SLF4J logging additions in TimerManager should be
removed so this PR only moves Constants; delete the added imports
org.slf4j.Logger and org.slf4j.LoggerFactory and remove any added Logger field
(e.g., a Logger log or logger variable) and any new log statements within the
TimerManager class, restoring the original behavior of methods like TimerManager
(constructor/method names as present) so only the Constants-related import
changes remain; submit the logging changes in a separate PR.
In
`@distribution/src/test/java/com/predic8/membrane/examples/withoutinternet/env/ConsistentVersionNumbers.java`:
- Line 149: The call to handleConstants that constructs a File for
"annot/src/main/java/com/predic8/membrane/annot/Constants.java" is inconsistent
with adjacent calls because the path string lacks the leading "/"; update the
string argument passed to new File in the handleConstants invocation to include
the leading "/" (keep using baseDirectory and handleConstants as-is) so the path
format matches the other calls.
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; |
There was a problem hiding this comment.
Unrelated changes: Logging additions don't belong in this PR.
The PR objective is to move Constants.java to the annot package and update imports. However, this file:
- Contains no
Constantsimports (old or new) - Introduces new logging functionality that wasn't present before
These logging additions are a functional change unrelated to the stated refactoring goal. Mixing feature additions with simple refactoring PRs makes them harder to review, understand, and potentially revert.
Recommendation: Remove the logging changes from this PR and submit them separately, keeping this PR focused solely on the Constants relocation.
🤖 Prompt for AI Agents
In `@core/src/main/java/com/predic8/membrane/core/util/TimerManager.java` around
lines 16 - 17, The new SLF4J logging additions in TimerManager should be removed
so this PR only moves Constants; delete the added imports org.slf4j.Logger and
org.slf4j.LoggerFactory and remove any added Logger field (e.g., a Logger log or
logger variable) and any new log statements within the TimerManager class,
restoring the original behavior of methods like TimerManager (constructor/method
names as present) so only the Constants-related import changes remain; submit
the logging changes in a separate PR.
| handleHelpReference(new File(baseDirectory.getAbsolutePath(), "/annot/src/main/java/com/predic8/membrane/annot/generator/HelpReference.java"), versionTransformer); | ||
| handleRpmSpec(new File(baseDirectory.getAbsolutePath(), "/membrane.spec"), versionTransformer); | ||
| handleConstants(new File(baseDirectory.getAbsolutePath(), "core/src/main/java/com/predic8/membrane/core/Constants.java"), versionTransformer); | ||
| handleConstants(new File(baseDirectory.getAbsolutePath(), "annot/src/main/java/com/predic8/membrane/annot/Constants.java"), versionTransformer); |
There was a problem hiding this comment.
Minor: Missing leading / separator, inconsistent with adjacent paths.
All other path arguments in this method (lines 141–148) use a leading / (e.g., "/distribution/examples/..."), but this line omits it. While new File(parent, child) handles this correctly at runtime, it's inconsistent with the surrounding code.
Suggested fix
- handleConstants(new File(baseDirectory.getAbsolutePath(), "annot/src/main/java/com/predic8/membrane/annot/Constants.java"), versionTransformer);
+ handleConstants(new File(baseDirectory.getAbsolutePath(), "/annot/src/main/java/com/predic8/membrane/annot/Constants.java"), versionTransformer);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| handleConstants(new File(baseDirectory.getAbsolutePath(), "annot/src/main/java/com/predic8/membrane/annot/Constants.java"), versionTransformer); | |
| handleConstants(new File(baseDirectory.getAbsolutePath(), "/annot/src/main/java/com/predic8/membrane/annot/Constants.java"), versionTransformer); |
🤖 Prompt for AI Agents
In
`@distribution/src/test/java/com/predic8/membrane/examples/withoutinternet/env/ConsistentVersionNumbers.java`
at line 149, The call to handleConstants that constructs a File for
"annot/src/main/java/com/predic8/membrane/annot/Constants.java" is inconsistent
with adjacent calls because the path string lacks the leading "/"; update the
string argument passed to new File in the handleConstants invocation to include
the leading "/" (keep using baseDirectory and handleConstants as-is) so the path
format matches the other calls.
Summary by CodeRabbit