Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javax.annotation dependency #489

Open
wants to merge 1 commit into
base: uinverse
Choose a base branch
from

Conversation

markusaksli-nc
Copy link

@markusaksli-nc markusaksli-nc commented Sep 22, 2020

Description

This PR adds this Javax dependency to the pom.xml file:

<dependency>
       <groupId>javax.annotation</groupId>
       <artifactId>javax.annotation-api</artifactId>
       <version>1.3.2</version>
    </dependency>

The aim of this change is to further improve the new employee experience when setting up the development environment for this project. Adding the dependency to the pom.xml file adds the dependency to Maven, thus adding the dependency to the project resolving the relevant missing import warnings a newly hired developer might run into. This import can be observed in multiple locations in the code, such as:

Which will otherwise result in errors such as:

Logs
Sep 22, 2020 10:09:29 PM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@7960847b: startup date [Tue Sep 22 22:09:29 EEST 2020]; root of context hierarchy
Sep 22, 2020 10:09:29 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [spring.xml]
Sep 22, 2020 10:09:30 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@11a9e7c8: defining beans [applicationContextHolder,buzzStrategyFactory,buzzStringPrinterFactory,buzzStringReturnerFactory,enterpriseGradeFizzBuzzSolutionStrategyFactory,fizzBuzzOutputGenerationContextVisitorFactory,fizzStrategyFactory,fizzStringPrinterFactory,fizzStringReturnerFactory,integerIntegerPrinterFactory,integerIntegerStringReturnerFactory,loopComponentFactory,newLineStringPrinterFactory,newLineStringReturnerFactory,noFizzNoBuzzStrategyFactory,systemOutFizzBuzzOutputStrategyFactory,loopCondition,loopInitializer,loopStep,integerDivider,numberIsMultipleOfAnotherNumberVerifier,buzzPrinter,buzzStringPrinter,fizzPrinter,fizzStringPrinter,integerIntegerPrinter,integerPrinter,newLinePrinter,newLineStringPrinter,standardFizzBuzz,buzzStrategy,firstIsLargerThanSecondDoubleComparator,firstIsSmallerThanSecondDoubleComparator,integerForEqualityComparator,threeWayIntegerComparator,buzzStrategyConstants,fizzStrategyConstants,noFizzNoBuzzStrategyConstants,doubleToIntConverter,intToDoubleConverter,enterpriseGradeFizzBuzzSolutionStrategy,fizzStrategy,noFizzNoBuzzStrategy,singleStepOutputGenerationStrategy,singleStepPayload,systemOutFizzBuzzOutputStrategy,buzzStringReturner,fizzStringReturner,integerIntegerStringReturner,newLineStringReturner,fizzBuzzOutputGenerationContextVisitor,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
Sep 22, 2020 10:09:30 PM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5aa9e4eb: startup date [Tue Sep 22 22:09:30 EEST 2020]; root of context hierarchy
Sep 22, 2020 10:09:30 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [spring.xml]
Sep 22, 2020 10:09:30 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@510f3d34: defining beans [applicationContextHolder,buzzStrategyFactory,buzzStringPrinterFactory,buzzStringReturnerFactory,enterpriseGradeFizzBuzzSolutionStrategyFactory,fizzBuzzOutputGenerationContextVisitorFactory,fizzStrategyFactory,fizzStringPrinterFactory,fizzStringReturnerFactory,integerIntegerPrinterFactory,integerIntegerStringReturnerFactory,loopComponentFactory,newLineStringPrinterFactory,newLineStringReturnerFactory,noFizzNoBuzzStrategyFactory,systemOutFizzBuzzOutputStrategyFactory,loopCondition,loopInitializer,loopStep,integerDivider,numberIsMultipleOfAnotherNumberVerifier,buzzPrinter,buzzStringPrinter,fizzPrinter,fizzStringPrinter,integerIntegerPrinter,integerPrinter,newLinePrinter,newLineStringPrinter,standardFizzBuzz,buzzStrategy,firstIsLargerThanSecondDoubleComparator,firstIsSmallerThanSecondDoubleComparator,integerForEqualityComparator,threeWayIntegerComparator,buzzStrategyConstants,fizzStrategyConstants,noFizzNoBuzzStrategyConstants,doubleToIntConverter,intToDoubleConverter,enterpriseGradeFizzBuzzSolutionStrategy,fizzStrategy,noFizzNoBuzzStrategy,singleStepOutputGenerationStrategy,singleStepPayload,systemOutFizzBuzzOutputStrategy,buzzStringReturner,fizzStringReturner,integerIntegerStringReturner,newLineStringReturner,fizzBuzzOutputGenerationContextVisitor,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
Sep 22, 2020 10:09:30 PM org.springframework.context.support.ClassPathXmlApplicationContext doClose
INFO: Closing org.springframework.context.support.ClassPathXmlApplicationContext@5aa9e4eb: startup date [Tue Sep 22 22:09:30 EEST 2020]; root of context hierarchy
Sep 22, 2020 10:09:30 PM org.springframework.beans.factory.support.DefaultListableBeanFactory destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@510f3d34: defining beans [applicationContextHolder,buzzStrategyFactory,buzzStringPrinterFactory,buzzStringReturnerFactory,enterpriseGradeFizzBuzzSolutionStrategyFactory,fizzBuzzOutputGenerationContextVisitorFactory,fizzStrategyFactory,fizzStringPrinterFactory,fizzStringReturnerFactory,integerIntegerPrinterFactory,integerIntegerStringReturnerFactory,loopComponentFactory,newLineStringPrinterFactory,newLineStringReturnerFactory,noFizzNoBuzzStrategyFactory,systemOutFizzBuzzOutputStrategyFactory,loopCondition,loopInitializer,loopStep,integerDivider,numberIsMultipleOfAnotherNumberVerifier,buzzPrinter,buzzStringPrinter,fizzPrinter,fizzStringPrinter,integerIntegerPrinter,integerPrinter,newLinePrinter,newLineStringPrinter,standardFizzBuzz,buzzStrategy,firstIsLargerThanSecondDoubleComparator,firstIsSmallerThanSecondDoubleComparator,integerForEqualityComparator,threeWayIntegerComparator,buzzStrategyConstants,fizzStrategyConstants,noFizzNoBuzzStrategyConstants,doubleToIntConverter,intToDoubleConverter,enterpriseGradeFizzBuzzSolutionStrategy,fizzStrategy,noFizzNoBuzzStrategy,singleStepOutputGenerationStrategy,singleStepPayload,systemOutFizzBuzzOutputStrategy,buzzStringReturner,fizzStringReturner,integerIntegerStringReturner,newLineStringReturner,fizzBuzzOutputGenerationContextVisitor,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
Exception in thread "main" java.lang.NullPointerException
	at com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.math.arithmetics.NumberIsMultipleOfAnotherNumberVerifier.numberIsMultipleOfAnotherNumber(NumberIsMultipleOfAnotherNumberVerifier.java:41)
	at com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies.FizzStrategy.isEvenlyDivisible(FizzStrategy.java:20)
	at com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.visitors.FizzBuzzOutputGenerationContextVisitor.visit(FizzBuzzOutputGenerationContextVisitor.java:24)
	at com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies.SingleStepOutputGenerationStrategy.performGenerationForCurrentStep(SingleStepOutputGenerationStrategy.java:71)
	at com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies.SingleStepPayload.runLoopPayload(SingleStepPayload.java:36)
	at com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.loop.LoopRunner.runLoop(LoopRunner.java:34)
	at com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.strategies.EnterpriseGradeFizzBuzzSolutionStrategy.runSolution(EnterpriseGradeFizzBuzzSolutionStrategy.java:36)
	at com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.StandardFizzBuzz.fizzBuzz(StandardFizzBuzz.java:33)
	at com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.Main.main(Main.java:23)

Process finished with exit code 1

Related Issues

Fixes #434

Tests

Not necessary, this is a development environment PR.

Checklist

Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the Contributors Non-Competition Clause.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation.
  • All existing and new tests are passing.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read [Handling breaking changes].

  • No, no existing tests failed, so this is not a breaking change.

                                            <groupId>javax.annotation</groupId>
                                            <artifactId>javax.annotation-api</artifactId>
                                            <version>1.3.2</version>
                                         </dependency>
                                         To the pom.xml file to further improve the functionality of the project in a Maven-oriented development environment. The aim of this commit message is to describe the purpose of this commit.
@banan314
Copy link

We need to establish daily meetings to discuss the Java upgrade strategy. In particular, I am a strong supporter of using jakarta instead of javax as it clearly conflicts with potential future upgrade.

Using the jakarta dependency instead

<dependency>
    <groupId>jakarta.annotation</groupId>
    <artifactId>jakarta.annotation-api</artifactId>
    <version>2.1.1</version>
</dependency>

would assure smoother upgrade to higher versions of Java.

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.

Null pointer on run
2 participants