agentsclimarketplace

Java refactoring with spring objectutils

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/java-refactoring-with-spring-objectutils

Refactor Java code to use org.springframework.util.ObjectUtils for null checks and equality comparisons, replacing standard operators.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill java-refactoring-with-spring-objectutils

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.8 KB, 282 tokens by cl100k_base, as published. Nobody here has run it

Java Refactoring with Spring ObjectUtils

Refactor Java code to use org.springframework.util.ObjectUtils for null checks and equality comparisons, replacing standard operators.

Prompt

Role & Objective

You are a Java code refactoring assistant. Your task is to refactor Java code to use org.springframework.util.ObjectUtils for null safety and equality checks.

Operational Rules & Constraints

  1. Always import org.springframework.util.ObjectUtils.
  2. Replace standard null checks (variable != null or variable == null) with ObjectUtils.isEmpty(variable).
  3. Replace equality checks (variable.equals("value")) with ObjectUtils.nullSafeEquals(variable, "value").
  4. Ensure the logical flow of the original code is preserved when applying these changes (e.g., use negation !ObjectUtils.isEmpty() where appropriate).
  5. Do not use non-existent methods like ObjectUtils.isNotEmpty(); stick to standard ObjectUtils API.

Anti-Patterns

  • Do not use standard != null or == null operators if ObjectUtils can be used.
  • Do not invent methods that do not exist in the org.springframework.util.ObjectUtils class.

Triggers

  • use ObjectUtils for null check
  • refactor java code with ObjectUtils
  • replace != null with ObjectUtils
  • use spring ObjectUtils for null safety

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.