Skip to content

Conversation

@sergejskovtuns
Copy link
Contributor

No description provided.

import com.neueda.jetbrains.plugin.graphdb.jetbrains.ui.datasource.metadata.tree.MutableTreeNodeProducers;
import com.neueda.jetbrains.plugin.graphdb.jetbrains.ui.datasource.metadata.tree.Root;
import com.neueda.jetbrains.plugin.graphdb.jetbrains.ui.datasource.metadata.tree.TreeNodeDirectory;
import com.neueda.jetbrains.plugin.graphdb.jetbrains.ui.datasource.tree.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't use imports with '*'. Use only imports what you need

public Directory getDirectory(String name) {
return directories.computeIfAbsent(
name,
(k) -> new Directory(k, directoryProducer, functionProducer)
Copy link
Contributor

Choose a reason for hiding this comment

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

what is 'k'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

'k' stands for key, however I changed it to 'newName' for more understanding


class Leaf implements TreeNode {
private final String name;
private Function<TreeNode, DefaultMutableTreeNode> mutableTreeNodeProducer;
Copy link
Contributor

Choose a reason for hiding this comment

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

mutableTreeNodeProducer should be final

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

);
}

private MutableTreeNodeProducers() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Constructor should be in the top of the class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

public Directory getDirectory(String name) {
return directories.computeIfAbsent(
name,
(k) -> new Directory(k, directoryProducer, functionProducer)
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't understand what is 'k'. Please use full names for the variables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

'k' stands for key, however I changed it to 'newName' for more understanding


public interface TreeNode {

public String getName();
Copy link
Contributor

Choose a reason for hiding this comment

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

Access modifier is 'public' is redudant here. In interfaces access modifier by default is public

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed


public String getName();

public DefaultMutableTreeNode getMutableTreeNode();
Copy link
Contributor

Choose a reason for hiding this comment

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

Access modifier is 'public' is redudant here. In interfaces access modifier by default is public

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed


public interface TreeNodeDirectory extends TreeNode {

public void addLeaf(String name);
Copy link
Contributor

Choose a reason for hiding this comment

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

Access modifier is 'public' is redudant here. In interfaces access modifier by default is public

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed


public void addLeaf(String name);

public TreeNodeDirectory getDirectory(String name);
Copy link
Contributor

Choose a reason for hiding this comment

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

Access modifier is 'public' is redudant here. In interfaces access modifier by default is public

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

- code style changed
@sergejskovtuns sergejskovtuns force-pushed the group-metadata-packages branch from d5dacb2 to 3dd24e6 Compare November 24, 2017 09:17
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