Tofpu / SpeedBridge2

Local variables should not be assigned in return statements JAVA-W1037
Anti-pattern
Major
a year agoa year old
145                // if the returned material is null
146                if (material == null) {
147                    // reassign the material with the default block
148                    material = ConfigurationManager.INSTANCE.getBlockMenuCategory().getDefaultBlock();149                    // insert the player to the blocks database
150                    Databases.BLOCK_DATABASE.insert(bridgePlayer);
151                }
 79                    BoardPlayer value = toBoardPlayer(key, resultSet);
 80                    final BridgePlayer player = playerService.getIfPresent(key);
 81                    if (player != null && player.getScores().isEmpty()) {
 82                        value = new BoardPlayer(value.getName(), 0, key, value.getScore()); 83                    }
 84
 85                    boardPlayer.set(value);
107                URL url = new URL(String.format(UPDATE_URL, pluginID));
108                HttpURLConnection connection = (HttpURLConnection) url.openConnection();
109                connection.addRequestProperty("User-Agent", USER_AGENT);
110                responseCode = connection.getResponseCode();111
112                JsonParser parser = new JsonParser();
113                JsonReader reader = new JsonReader(new InputStreamReader(connection.getInputStream()));