{"thread":{"id":"19401","subject":"[JGIT PATCH] FindBugs: Superclass uses subclass during initialization","startedAt":"2009-05-18T13:11:58Z","lastAt":"2009-05-18T13:11:58Z","messageCount":1,"participants":["Sohn, Matthias"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"114177","messageId":"366BBB1215D0AB4B8A153AF047A287800319BD13@dewdfe18.wdf.sap.corp","threadId":"19401","inReplyTo":null,"subject":"[JGIT PATCH] FindBugs: Superclass uses subclass during initialization","fromName":"Sohn, Matthias","fromEmail":"matthias.sohn@sap.com","sentAt":"2009-05-18T13:11:58Z","receivedAt":"2009-05-18T13:11:58Z","isPatch":true,"sender":{"key":"matthias.sohn@sap.com","avatar":"https://gravatar.com/avatar/88bbb2733bcb977ec2d2cc1916ba8a70d6d41432c146bb8dab4f7f802261194e?d=mp&s=160"},"body":"From: Matthias Sohn <matthias.sohn@sap.com>\n\nFindBugs reported the following problem with high priority:\n/usr/src/egit/org.spearce.jgit/src/org/spearce/jgit/merge/MergeStrategy.java:58\nInitialization of org.spearce.jgit.merge.MergeStrategy accesses class\norg.spearce.jgit.merge.StrategySimpleTwoWayInCore, which isn't\ninitialized yet.\n\nTo fix this problem move instantiation from StrategySimpleTwoWayInCore\nup to the abstract superclass MergeStrategy.\n\nSigned-off-by: Matthias Sohn <matthias.sohn@sap.com>\n---\n .../src/org/spearce/jgit/merge/MergeStrategy.java  |    2 +-\n .../jgit/merge/StrategySimpleTwoWayInCore.java     |    2 --\n 2 files changed, 1 insertions(+), 3 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/merge/MergeStrategy.java b/org.spearce.jgit/src/org/spearce/jgit/merge/MergeStrategy.java\nindex 5439e5c..f5ced72 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/merge/MergeStrategy.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/merge/MergeStrategy.java\n@@ -55,7 +55,7 @@\n \tpublic static final MergeStrategy THEIRS = new StrategyOneSided(\"theirs\", 1);\n \n \t/** Simple strategy to merge paths, without simultaneous edits. */\n-\tpublic static final ThreeWayMergeStrategy SIMPLE_TWO_WAY_IN_CORE = StrategySimpleTwoWayInCore.INSTANCE;\n+\tpublic static final ThreeWayMergeStrategy SIMPLE_TWO_WAY_IN_CORE = new StrategySimpleTwoWayInCore();\n \n \tprivate static final HashMap<String, MergeStrategy> STRATEGIES = new HashMap<String, MergeStrategy>();\n \ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java b/org.spearce.jgit/src/org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java\nindex 5d4447c..626fe06 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/merge/StrategySimpleTwoWayInCore.java\n@@ -61,8 +61,6 @@\n  * file contents.\n  */\n public class StrategySimpleTwoWayInCore extends ThreeWayMergeStrategy {\n-\tstatic final ThreeWayMergeStrategy INSTANCE = new StrategySimpleTwoWayInCore();\n-\n \t/** Create a new instance of the strategy. */\n \tprotected StrategySimpleTwoWayInCore() {\n \t\t//\n-- \n1.6.3.1.30.g55524\n\n"}]}