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

hm done #681

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

hm done #681

wants to merge 3 commits into from

Conversation

NSashchenko
Copy link

No description provided.

Copy link

@Ivan95kos Ivan95kos left a comment

Choose a reason for hiding this comment

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

Good job overall!


@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)

Choose a reason for hiding this comment

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

remove the empty line

Suggested change


@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})

Choose a reason for hiding this comment

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

Suggested change


public static Injector getInjector() {
return injector;
}

public Object getInstance(Class<?> interfaceClazz) {
return null;
if (!interfaceClazz.isInterface()) {
throw new RuntimeException("Неподдерживаемый класс: " + interfaceClazz.getName());

Choose a reason for hiding this comment

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

It is better to use English comments

import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})

Choose a reason for hiding this comment

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

We should inject only field

Suggested change
@Target({ElementType.FIELD, ElementType.TYPE})
@Target(ElementType.FIELD)

Comment on lines 72 to 77
if (interfaceClazz == FileReaderService.class) {
return FileReaderServiceImpl.class;
} else if (interfaceClazz == ProductParser.class) {
return ProductParserImpl.class;
} else if (interfaceClazz == ProductService.class) {
return ProductServiceImpl.class;
Copy link

Choose a reason for hiding this comment

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

create hashmap field instead

@NSashchenko NSashchenko requested a review from okuzan July 12, 2023 11:51
Copy link

@Ivan95kos Ivan95kos left a comment

Choose a reason for hiding this comment

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

Nice

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.

3 participants