auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public GitUser getUser() throws GitException { User user = EnvironmentContext.getCurrent().getUser(); GitUser gitUser = newDto(GitUser.class); if (user.isTemporary()) { gitUser.setEmail("anonymous@noemail.com"); gitUser.setName("Anonymous"); } else { String name = null; String email = null; try { Map<String, String> preferences = preferenceDao.getPreferences(EnvironmentContext.getCurrent().getUser().getId(), "git.committer.\\w+"); name = preferences.get("git.committer.name"); email = preferences.get("git.committer.email"); } catch (ServerException ignored) { LOG.error(ignored.getLocalizedMessage(), ignored); } gitUser.setName(isNullOrEmpty(name) ? "Anonymous" : name); gitUser.setEmail(isNullOrEmpty(email) ? "anonymous@noemail.com" : email); } return gitUser; }

Target:
public GitUser getUser() throws GitException { User user = EnvironmentContext.getCurrent().getUser(); GitUser gitUser = newDto(GitUser.class); if (user.isTemporary()) { gitUser.setEmail("anonymous@noemail.com"); gitUser.setName("Anonymous"); } else { String name = null; String email = null; try { Map<String, String> preferences = preferenceDao.getPreferences(EnvironmentContext.getCurrent().getUser().getId(), "git.committer.\\w+"); name = preferences.get("git.committer.name"); email = preferences.get("git.committer.email"); } catch (ServerException e) { LOG.error(e.getLocalizedMessage(), e); } gitUser.setName(isNullOrEmpty(name) ? "Anonymous" : name); gitUser.setEmail(isNullOrEmpty(email) ? "anonymous@noemail.com" : email); } return gitUser; }
Source:
private static ApiRoleList getRoles(RolesResourceApi rolesResourceApi, String clusterName, String serviceName) { ApiRoleList roles = null; try { if(CM_SERVICE_TYPE.equalsIgnoreCase(serviceName)) { final ApiRoleList roleList = new ApiRoleList(); final ApiRole cmRole = new ApiRole(); cmRole.setName(CM_ROLE_TYPE); cmRole.setType(CM_ROLE_TYPE); roleList.addItemsItem(cmRole); return roleList; } else { roles = rolesResourceApi.readRoles(clusterName, serviceName, "", VIEW_SUMMARY); } } catch (Exception e) { log.failedToAccessServiceRoleConfigs(clusterName, e); } return roles; }

Target:
private static ApiRoleList getRoles(RolesResourceApi rolesResourceApi, String clusterName, String serviceName) { ApiRoleList roles = null; try { if(CM_SERVICE_TYPE.equalsIgnoreCase(serviceName)) { roles = new ApiRoleList(); final ApiRole cmRole = new ApiRole(); cmRole.setName(CM_ROLE_TYPE); cmRole.setType(CM_ROLE_TYPE); roles.addItemsItem(cmRole); return roles; } else { roles = rolesResourceApi.readRoles(clusterName, serviceName, "", VIEW_SUMMARY); } } catch (Exception e) { log.failedToAccessServiceRoleConfigs(clusterName, e); } return roles; }
Source:
static void sortByInsertionTime(List<RemoteTaskRunnerWorkItem> tasks) { Collections.sort( tasks, new Comparator<RemoteTaskRunnerWorkItem>() { @Override public int compare(RemoteTaskRunnerWorkItem o1, RemoteTaskRunnerWorkItem o2) { return o1.getQueueInsertionTime().compareTo(o2.getQueueInsertionTime()); } } ); }

Target:
static void sortByInsertionTime(List<RemoteTaskRunnerWorkItem> tasks) { Collections.sort(tasks, Comparator.comparing(RemoteTaskRunnerWorkItem::getQueueInsertionTime)); }
Source:
public void testEntries() throws Exception { final Path p = Mockito.mock(Path.class); final Stream s = Mockito.mock(Stream.class); Mockito.when(context.entries(Mockito.any(), Mockito.anyBoolean())).thenReturn(s); Assert.assertThat(context.entries(p), Matchers.sameInstance(s)); Mockito.verify(context).entries(p, true); }

Target:
public void testEntries() throws Exception { final Path path = Mockito.mock(Path.class); final Stream stream = Mockito.mock(Stream.class); Mockito.when(context.entries(Mockito.any(), Mockito.anyBoolean())).thenReturn(stream); Assert.assertThat(context.entries(path), Matchers.sameInstance(stream)); Mockito.verify(context).entries(path, true); }
Source:
HelixPropertyStore<T> getHelixPropertyStore(HelixPropertyStoreConfig storeConfig, List<String> subscribedPaths) { if (storeConfig == null) { throw new IllegalArgumentException("storeConfig cannot be null"); } String storeRootPath = storeConfig.zkClientConnectString + storeConfig.rootPath; MockHelixPropertyStore<T> store = storeKeyToMockStoreMap.get(storeRootPath); if (store == null) { store = new MockHelixPropertyStore<>(); storeKeyToMockStoreMap.put(storeRootPath, store); } return store; }

Target:
HelixPropertyStore<T> getHelixPropertyStore(HelixPropertyStoreConfig storeConfig, List<String> subscribedPaths) { if (storeConfig == null) { throw new IllegalArgumentException("storeConfig cannot be null"); } String storeRootPath = storeConfig.zkClientConnectString + storeConfig.rootPath; MockHelixPropertyStore<T> store = storeKeyToMockStoreMap.get(storeRootPath); if (store == null) { store = new MockHelixPropertyStore<>(shouldFailSetOperation, shouldRemoveRecordBeforeNotify); storeKeyToMockStoreMap.put(storeRootPath, store); } return store; }
Source:
public static LocalDate parseDate(String date) { int defaultYear = LocalDate.now(DateTimeZone.UTC).getYear(); int defaultMonth = 01; int defaultDay = 01; int year = Integer.parseInt(date.substring(0, 4)); int month = Integer.parseInt(date.substring(4, 6)); int day = Integer.parseInt(date.substring(6, 8)); if (year == 0) { year = defaultYear; } if (month == 0) { month = defaultMonth; } if (day == 0) { day = defaultDay; } return new LocalDate(year, month, day); }

Target:
public static LocalDate parseDate(String date) { checkArgument(date.length() == 8, "Input date String should be 8 characters long"); int defaultYear = LocalDate.now(DateTimeZone.UTC).getYear(); int defaultMonth = 01; int defaultDay = 01; int year = Integer.parseInt(date.substring(0, 4)); int month = Integer.parseInt(date.substring(4, 6)); int day = Integer.parseInt(date.substring(6, 8)); if (year == 0) { year = defaultYear; } if (month == 0) { month = defaultMonth; } if (day == 0) { day = defaultDay; } return new LocalDate(year, month, day); }
Source:
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context) { requireNonNull(config, "config is null"); try { Bootstrap app = new Bootstrap( new JsonModule(), new DruidModule(), binder -> { binder.bind(TypeManager.class).toInstance(context.getTypeManager()); binder.bind(FunctionMetadataManager.class).toInstance(context.getFunctionMetadataManager()); binder.bind(RowExpressionService.class).toInstance(context.getRowExpressionService()); binder.bind(LogicalRowExpressions.class).toInstance(new LogicalRowExpressions(context.getRowExpressionService().getDeterminismEvaluator(), context.getStandardFunctionResolution(), context.getFunctionMetadataManager())); binder.bind(StandardFunctionResolution.class).toInstance(context.getStandardFunctionResolution()); }); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(config) .initialize(); return injector.getInstance(DruidConnector.class); } catch (Exception e) { throwIfUnchecked(e); throw new RuntimeException(e); } }

Target:
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context) { requireNonNull(config, "config is null"); try { Bootstrap app = new Bootstrap( new JsonModule(), new DruidModule(), binder -> { binder.bind(TypeManager.class).toInstance(context.getTypeManager()); binder.bind(FunctionMetadataManager.class).toInstance(context.getFunctionMetadataManager()); binder.bind(RowExpressionService.class).toInstance(context.getRowExpressionService()); binder.bind(StandardFunctionResolution.class).toInstance(context.getStandardFunctionResolution()); }); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(config) .initialize(); return injector.getInstance(DruidConnector.class); } catch (Exception e) { throwIfUnchecked(e); throw new RuntimeException(e); } }
Source:
public static String formatTime(long time, TimeFormat format, Resolution resolution) { if (format == TimeFormat.CALENDAR) { return formatTimeAbs(time, resolution); } else if (format == TimeFormat.NUMBER) { return NumberFormat.getInstance().format(time); } else if (format == TimeFormat.CYCLES) { return NumberFormat.getInstance().format(time) + Messages.Utils_ClockCyclesUnit; } StringBuffer str = new StringBuffer(); long t = time; boolean neg = t < 0; if (neg) { t = -t; str.append('-'); } long sec = t / SEC_IN_NS; str.append(sec); String ns = formatNs(t, resolution); if (!ns.equals("")) { str.append('.'); str.append(ns); } return str.toString(); }

Target:
public static String formatTime(long time, TimeFormat format, Resolution resolution) { switch (format) { case CALENDAR: return formatTimeAbs(time, resolution); case NUMBER: return NumberFormat.getInstance().format(time); case CYCLES: return NumberFormat.getInstance().format(time) + Messages.Utils_ClockCyclesUnit; case RELATIVE: default: } StringBuffer str = new StringBuffer(); long t = time; boolean neg = t < 0; if (neg) { t = -t; str.append('-'); } long sec = t / SEC_IN_NS; str.append(sec); String ns = formatNs(t, resolution); if (!ns.equals("")) { str.append('.'); str.append(ns); } return str.toString(); }
Source:
public boolean addEdge(final V v1, final V v2, final I i) { final Map<V, I> adjEdges = getEdges(v1); if (adjEdges == null) { throw new NoSuchElementException("No src vertex " + v1); } if (!adjEdges.containsKey(v2)) { adjEdges.put(v2, i); final int inDegree = inDegrees.get(v2); inDegrees.put(v2, inDegree + 1); if (inDegree == 0) { rootVertices.remove(v2); } return true; } else { LOG.log(Level.WARNING, "The edge from {0} to {1} already exists", new Object[]{v1, v2}); return false; } }

Target:
public boolean addEdge(final V v1, final V v2, final I i) { final Map<V, I> adjEdges = getEdges(v1); if (adjEdges == null) { throw new NoSuchElementException("No src vertex " + v1); } if (!adjEdges.containsKey(v2)) { numEdges += 1; adjEdges.put(v2, i); final int inDegree = inDegrees.get(v2); inDegrees.put(v2, inDegree + 1); return true; } else { LOG.log(Level.WARNING, "The edge from {0} to {1} already exists", new Object[]{v1, v2}); return false; } }
Source:
public void initialize() { httpFeed = HttpFeed.builder() .entity(entity) .period(1000) .baseUri(Providers.transform(Providers.atomic(url), UrlFunctions.URI_FROM_STRING)) .poll(new HttpPollConfig<Double>(REQUEST_LATENCY_IN_SECONDS_MOST_RECENT) .onSuccess(HttpValueFunctions.latency()) .onError(Functions.constant((Double)null))) .suspended() .build(); }

Target:
protected void initialize() { httpFeed = HttpFeed.builder() .entity(entity) .period(periodMillis) .baseUri(Suppliers.compose(Urls.URI_FROM_STRING, AtomicReferences.supplier(url))) .poll(new HttpPollConfig<Double>(REQUEST_LATENCY_IN_SECONDS_MOST_RECENT) .onSuccess(MathFunctions.divide(HttpValueFunctions.latency(), 1000.0d)) .onError(Functions.constant((Double)null))) .suspended() .build(); }
Source:
public void onMessage(byte[] data, int offset, int length) { try { byte[] messageBytes = Arrays.copyOfRange(data, offset, offset + length); TransportDataMessage dataMessage = new TransportDataMessage(messageBytes); if (dataMessage.getMessageType() == 5) { LinkedHashMap<String, Object> dataMap = new LinkedHashMap<String, Object>(); dataMap.put("logicalTimestampMs", dataMessage.getLogicalTimestampMs()); dataMap.put("data", dataMessage.getData()); TransportChannel channel = channels.get(dataMessage.getChannelName()); if ((channel != null) && (!channel.isClosed())) { StreamMessage streamMessage = new StreamMessage("data", null, objectMapper.writeValueAsString(dataMap)); channel.offer(streamMessage); } else { log.debug("ignoring message. channel not found {}", dataMessage.getChannelName()); } } } catch (JsonProcessingException ex) { log.error("failed to process messages", ex); } }

Target:
public void onMessage(byte[] data, int offset, int length) { try { byte[] messageBytes = Arrays.copyOfRange(data, offset, offset + length); TransportDataMessage dataMessage = new TransportDataMessage(messageBytes); if (dataMessage.getKind() == Kind.DATA) { LinkedHashMap<String, Object> dataMap = new LinkedHashMap<String, Object>(); dataMap.put("logicalTimestampMs", dataMessage.getLogicalTimestampMs()); dataMap.put("data", dataMessage.getData()); TransportChannel channel = channels.get(dataMessage.getChannelName()); if ((channel != null) && (!channel.isClosed())) { StreamMessage streamMessage = new StreamMessage("data", null, objectMapper.writeValueAsString(dataMap)); channel.offer(streamMessage); } else { log.debug("ignoring message. channel not found {}", dataMessage.getChannelName()); } } } catch (JsonProcessingException ex) { log.error("failed to process messages", ex); } }
Source:
public ClusterParticipant getClusterParticipant() throws IOException { if (clusterParticipant == null) { clusterParticipant = new ClusterParticipant() { @Override public void participate(List<AmbryHealthReport> ambryHealthReports) { } @Override public void close() { } @Override public boolean setReplicaSealedState(ReplicaId replicaId, boolean isSealed) { return false; } @Override public boolean setReplicaStoppedState(List<ReplicaId> replicaIds, boolean isStopped) { return false; } @Override public List<String> getSealedReplicas() { return new ArrayList<>(); } @Override public List<String> getStoppedReplicas() { return new ArrayList<>(); } }; } return clusterParticipant; }

Target:
public ClusterParticipant getClusterParticipant() throws IOException { if (clusterParticipant == null) { clusterParticipant = new ClusterParticipant() { @Override public void participate(List<AmbryHealthReport> ambryHealthReports) { } @Override public void close() { } @Override public boolean setReplicaSealedState(ReplicaId replicaId, boolean isSealed) { return false; } @Override public boolean setReplicaStoppedState(List<ReplicaId> replicaIds, boolean markStop) { return false; } @Override public List<String> getSealedReplicas() { return Collections.emptyList(); } @Override public List<String> getStoppedReplicas() { return Collections.emptyList(); } }; } return clusterParticipant; }
Source:
private static IndexConfig buildNormalizedConfig(String mapName, IndexType indexType, String indexName, List<String> normalizedAttributeNames) { IndexConfig newConfig = new IndexConfig().setType(indexType); StringBuilder nameBuilder = indexName == null ? new StringBuilder(mapName + (indexType == IndexType.SORTED ? "_sorted" : "_hash")) : null; for (String normalizedAttributeName : normalizedAttributeNames) { newConfig.addAttribute(normalizedAttributeName); if (nameBuilder != null) { nameBuilder.append("_").append(normalizedAttributeName); } } if (nameBuilder != null) { indexName = nameBuilder.toString(); } newConfig.setName(indexName); return newConfig; }

Target:
private static IndexConfig buildNormalizedConfig(String mapName, IndexType indexType, String indexName, List<String> normalizedAttributeNames) { IndexConfig newConfig = new IndexConfig().setType(indexType); StringBuilder nameBuilder = indexName == null ? new StringBuilder(mapName + "_" + getIndexTypeName(indexType)) : null; for (String normalizedAttributeName : normalizedAttributeNames) { newConfig.addAttribute(normalizedAttributeName); if (nameBuilder != null) { nameBuilder.append("_").append(normalizedAttributeName); } } if (nameBuilder != null) { indexName = nameBuilder.toString(); } newConfig.setName(indexName); return newConfig; }
Source:
private String macroSubs(String s, Map<String, String> macroMapping) { if (s == null) { return null; } StringBuilder ret = new StringBuilder(); StringBuilder macroName = null; int state = STATE_NORMAL; for (final char ch : s.toCharArray()) { switch (state) { case STATE_NORMAL: if (ch == '@') { state = STATE_EXPECT_BRACKET; } else { ret.append(ch); } break; case STATE_EXPECT_BRACKET: if (ch == '{') { state = STATE_EXPECT_NAME; macroName = new StringBuilder(); } else if (ch == '@') { state = STATE_NORMAL; ret.append('@'); } else { state = STATE_NORMAL; ret.append('@'); ret.append(ch); } break; case STATE_EXPECT_NAME: if (ch == '}') { state = STATE_NORMAL; String name = macroName.toString().toLowerCase(Locale.ENGLISH); String value = macroMapping.get(name); if (value == null) { ret.append("@{"); ret.append(name); ret.append("}"); } else { ret.append(value); } macroName = null; } else { macroName.append(ch); } break; default: break; } } switch (state) { case STATE_EXPECT_BRACKET: ret.append('@'); break; case STATE_EXPECT_NAME: ret.append("@{"); ret.append(macroName.toString()); break; default: break; } return ret.toString(); }

Target:
private String macroSubs(String s, Map<String, String> macroMapping) { if (s == null) { return null; } StringBuilder ret = new StringBuilder(); StringBuilder macroName = null; int state = STATE_NORMAL; for (final char ch : s.toCharArray()) { switch (state) { case STATE_NORMAL: if (ch == '@') { state = STATE_EXPECT_BRACKET; } else { ret.append(ch); } break; case STATE_EXPECT_BRACKET: if (ch == '{') { state = STATE_EXPECT_NAME; macroName = new StringBuilder(); } else if (ch == '@') { state = STATE_NORMAL; ret.append('@'); } else { state = STATE_NORMAL; ret.append('@'); ret.append(ch); } break; case STATE_EXPECT_NAME: if (ch == '}') { state = STATE_NORMAL; String name = macroName.toString().toLowerCase(Locale.ENGLISH); String value = macroMapping.get(name); if (value == null) { ret.append("@{"); ret.append(name); ret.append("}"); } else { ret.append(value); } macroName = null; } else { macroName.append(ch); } break; default: break; } } switch (state) { case STATE_NORMAL: break; case STATE_EXPECT_BRACKET: ret.append('@'); break; case STATE_EXPECT_NAME: ret.append("@{"); ret.append(macroName.toString()); break; default: break; } return ret.toString(); }
Source:
protected ObjectNode prepareExtensionFragment(String entityString) { try { return mapper.readValue(entityString, ObjectNode.class); } catch (IOException e) { LOGGER.warn(e.getMessage()); return null; } }

Target:
protected ObjectNode prepareExtensionFragment(String entityString) { try { return mapper.readValue(entityString, ObjectNode.class); } catch (IOException e) { LOGGER.warn("IOException", e); return null; } }
Source:
protected Serializable getFieldValue(Field field, String stringValue, ZipFile zip) { Serializable fieldValue = null; Type type = field.getType(); if (type.isSimpleType()) { if (type instanceof SimpleTypeImpl) { type = type.getSuperType(); } if (type instanceof StringType) { fieldValue = stringValue; } else if (type instanceof IntegerType) { fieldValue = Integer.parseInt(stringValue); } else if (type instanceof LongType) { fieldValue = Long.parseLong(stringValue); } else if (type instanceof DateType) { try { Date date; if (stringValue.length() == 10) { date = new SimpleDateFormat("dd/MM/yyyy").parse(stringValue); } else if (stringValue.length() == 8) { date = new SimpleDateFormat("dd/MM/yy").parse(stringValue); } else { log.warn("Unknown date format :" + stringValue); return null; } fieldValue = date; } catch (ParseException e) { log.error("Error during date parsing", e); } } else { log.warn(String.format("Unsupported field type '%s'", type)); return null; } } else if (type.isComplexType()) { if (TypeConstants.CONTENT.equals(field.getName().getLocalName())) { ZipEntry blobIndex = zip.getEntry(stringValue); if (blobIndex != null) { Blob blob; try { blob = Blobs.createBlob(zip.getInputStream(blobIndex)); } catch (IOException e) { throw new NuxeoException(e); } blob.setFilename(stringValue); fieldValue = (Serializable) blob; } } } else if (type.isListType()) { Type listFieldType = ((ListType) type).getFieldType(); if (listFieldType.isSimpleType()) { fieldValue = stringValue.split("\\|"); } } return fieldValue; }

Target:
protected Serializable getFieldValue(Field field, String stringValue, ZipFile zip) { Serializable fieldValue = null; Type type = field.getType(); if (type.isSimpleType()) { if (type instanceof SimpleTypeImpl) { type = type.getSuperType(); } if (type instanceof StringType) { fieldValue = stringValue; } else if (type instanceof IntegerType) { fieldValue = Integer.parseInt(stringValue); } else if (type instanceof LongType) { fieldValue = Long.parseLong(stringValue); } else if (type instanceof DateType) { try { Date date; if (stringValue.length() == 10) { date = new SimpleDateFormat("dd/MM/yyyy").parse(stringValue); } else if (stringValue.length() == 8) { date = new SimpleDateFormat("dd/MM/yy").parse(stringValue); } else { log.warn("Unknown date format :" + stringValue); return null; } fieldValue = date; } catch (ParseException e) { log.error("Error during date parsing", e); } } else { log.warn(String.format("Unsupported field type '%s'", type)); return null; } } else if (type.isComplexType()) { boolean returnEarly = true; if (TypeConstants.CONTENT.equals(field.getName().getLocalName())) { returnEarly = false; } ZipEntry blobIndex = zip.getEntry(stringValue); if (!returnEarly) { returnEarly = blobIndex == null; } if (!returnEarly) { Blob blob; try { blob = Blobs.createBlob(zip.getInputStream(blobIndex)); } catch (IOException e) { throw new NuxeoException(e); } blob.setFilename(stringValue); fieldValue = (Serializable) blob; } } else if (type.isListType()) { Type listFieldType = ((ListType) type).getFieldType(); if (listFieldType.isSimpleType()) { fieldValue = stringValue.split("\\|"); } } return fieldValue; }
Source:
public static Argument argument(String name, Object value, boolean quoted) { if (value instanceof String) { value = quoted ? String.format("\"%s\"", value) : value; return new Argument(name, value); } else { try { return new Argument(name, JSON_MAPPER.writeValueAsString(value)); } catch (JsonProcessingException exception) { throw new IllegalStateException(String.format("Cannot serialize %s", value), exception); } } }

Target:
public static Argument argument(String name, Object value, boolean quoted) { if (value instanceof String) { value = quoted ? String.format("\"%s\"", value) : value; return new Argument(name, value); } else { try { return new Argument( name, BASE_MAPPER .configure( JsonGenerator.Feature.QUOTE_FIELD_NAMES, false ) .writeValueAsString(value) ); } catch (JsonProcessingException exception) { throw new IllegalStateException(String.format("Cannot serialize %s", value), exception); } } }
Source:
private void removeRetroactiveResources(SimpleString address) throws Exception { String prefix = server.getConfiguration().getInternalNamingPrefix(); SimpleString internalDivertName = ResourceNames.getRetroactiveResourceName(prefix, address, ResourceNames.DIVERT); if (getBinding(internalDivertName) != null) { server.destroyDivert(internalDivertName); } SimpleString internalQueueName = ResourceNames.getRetroactiveResourceName(prefix, address, ResourceNames.QUEUE); if (server.locateQueue(internalQueueName) != null) { server.destroyQueue(internalQueueName); } SimpleString internalAddressName = ResourceNames.getRetroactiveResourceName(prefix, address, ResourceNames.ADDRESS); if (server.getAddressInfo(internalAddressName) != null) { server.removeAddressInfo(internalAddressName, null); } }

Target:
private void removeRetroactiveResources(SimpleString address) throws Exception { String prefix = server.getInternalNamingPrefix(); String delimiter = server.getConfiguration().getWildcardConfiguration().getDelimiterString(); SimpleString internalDivertName = ResourceNames.getRetroactiveResourceDivertName(prefix, delimiter, address); if (getBinding(internalDivertName) != null) { server.destroyDivert(internalDivertName); } SimpleString internalAnycastQueueName = ResourceNames.getRetroactiveResourceQueueName(prefix, delimiter, address, RoutingType.ANYCAST); if (server.locateQueue(internalAnycastQueueName) != null) { server.destroyQueue(internalAnycastQueueName); } SimpleString internalMulticastQueueName = ResourceNames.getRetroactiveResourceQueueName(prefix, delimiter, address, RoutingType.MULTICAST); if (server.locateQueue(internalMulticastQueueName) != null) { server.destroyQueue(internalMulticastQueueName); } SimpleString internalAddressName = ResourceNames.getRetroactiveResourceAddressName(prefix, delimiter, address); if (server.getAddressInfo(internalAddressName) != null) { server.removeAddressInfo(internalAddressName, null); } }
Source:
protected void doStop() throws Exception { scheduledExecutorService.shutdown(); super.doStop(); }

Target:
protected void doStop() throws Exception { executorServiceManager.shutdownGraceful(scheduledExecutorService); super.doStop(); }
Source:
protected void executeCommand() { VDSReturnValue vdsReturnaValue = runVdsCommand(VDSCommandType.StopRebalanceGlusterVolume, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName())); if (!vdsReturnaValue.getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED, vdsReturnaValue.getVdsError() .getMessage()); return; } endStepJob(); releaseVolumeLock(); setSucceeded(vdsReturnaValue.getSucceeded()); }

Target:
protected void executeCommand() { VDSReturnValue vdsReturnaValue = runVdsCommand(VDSCommandType.StopRebalanceGlusterVolume, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName())); if (!vdsReturnaValue.getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED, vdsReturnaValue.getVdsError() .getMessage()); setSucceeded(false); return; } endStepJob(); releaseVolumeLock(); setSucceeded(vdsReturnaValue.getSucceeded()); }
Source:
public void traverseMenu(String... names) { assert names.length > 0 : "traverseMenu called with no arguments"; Platform.runLater(() -> { MenuControl root = TestController.getUI().getMenuControl(); MenuItem current = root.getMenus().stream() .filter(m -> m.getText().equals(names[0])) .findFirst() .orElseThrow(() -> new IllegalArgumentException( String.format("%s is not a valid menu item", names[0]))); for (int i = 1; i < names.length; i++) { final int j = i; if (current instanceof Menu) { current = ((Menu) current).getItems().stream() .filter(m -> m.getText().equals(names[j])) .findFirst() .orElseThrow(() -> new IllegalArgumentException( String.format("%s is not a valid menu item", names[j]))); } else { throw new IllegalArgumentException( String.format("Menu %s is not as nested as arguments require", names[0])); } } current.getOnAction().handle(new ActionEvent()); }); }

Target:
public void traverseMenu(String... names) { assert names.length > 0 : "traverseMenu called with no arguments"; Platform.runLater(() -> { MenuControl root = TestController.getUI().getMenuControl(); MenuItem current = root.getMenus().stream() .filter(m -> m.getText().equals(names[0])) .findFirst() .orElseThrow(() -> new IllegalArgumentException( String.format("%s is not a valid menu item", names[0]))); for (int i = 1; i < names.length; i++) { final int j = i; if (!(current instanceof Menu)) { throw new IllegalArgumentException( String.format("Menu %s is not as nested as arguments require", names[0])); } current = ((Menu) current).getItems().stream() .filter(m -> m.getText().equals(names[j])) .findFirst() .orElseThrow(() -> new IllegalArgumentException( String.format("%s is not a valid menu item", names[j]))); } current.getOnAction().handle(new ActionEvent()); }); }
Source:
private void seekOffset() throws IOException, DataParserException { int count = 0; while (count < offset) { if (count < recordCount) { Object rows[] = sasFileReader.readNext(); count++; } else { break; } } }

Target:
private void seekOffset() throws IOException, DataParserException { int count = 0; while (count < offset && count < recordCount) { Object rows[] = sasFileReader.readNext(); count++; } }
Source:
public TopicRepositoryHolder(@Qualifier("kafka") final TopicRepositoryCreator kafkaRepository) { this.readWriteLock = new ReentrantReadWriteLock(); this.storageTopicRepository = new HashMap<>(); this.repositoryCreators = new HashMap<>(); this.repositoryCreators.put(Storage.Type.KAFKA, kafkaRepository); }

Target:
public TopicRepositoryHolder(@Qualifier("kafka") final TopicRepositoryCreator kafkaRepository) { this.readWriteLock = new ReentrantReadWriteLock(); this.storageTopicRepository = new HashMap<>(); this.repositoryCreators = new HashMap<>(); this.repositoryCreators.put(kafkaRepository.getSupportedStorageType(), kafkaRepository); }
Source:
NElementSet(T... data) { T[] table = data.clone(); Arrays.fill(table, null); for (T element : data) { Objects.requireNonNull(element); int suggestedIndex = Math.abs(element.hashCode()) % data.length; int index = suggestedIndex; while (index < suggestedIndex + data.length) { T existingElement = table[index % data.length]; if (existingElement == null) { break; } if (existingElement.equals(element)) { throw new IllegalArgumentException("Duplicate element " + element); } index++; } table[index % data.length] = element; } this.data = table; }

Target:
NElementSet(T... data) { T[] table = data.clone(); Arrays.fill(table, null); for (T element : data) { Objects.requireNonNull(element); int suggestedIndex = Math.abs(element.hashCode()) % data.length; int index = suggestedIndex; boolean found = false; while (index < data.length) { T existingElement = table[index]; if (existingElement == null) { found = true; break; } else if (existingElement.equals(element)) { throw new IllegalArgumentException(); } ++index; } if (!found) { index = 0; while (index < suggestedIndex) { T existingElement = table[index]; if (existingElement == null) { break; } else if (existingElement.equals(element)) { throw new IllegalArgumentException(); } ++index; } } table[index] = element; } this.data = table; }
Source:
private boolean isMessageMatch(AuditEvent event) { final boolean match; if (eventMessageRegexp == null) { match = true; } else { final Matcher messageMatcher = eventMessageRegexp.matcher(event.getMessage()); match = messageMatcher.find(); } return match; }

Target:
private boolean isMessageMatch(AuditEvent event) { boolean match = true; if (eventMessageRegexp != null) { final Matcher messageMatcher = eventMessageRegexp.matcher(event.getMessage()); match = messageMatcher.find(); } return match; }
Source:
public synchronized List<ITmfStateInterval> queryFullState(long t) throws TimeRangeException, StateSystemDisposedException { if (isDisposed) { throw new StateSystemDisposedException(); } final int nbAttr = getNbAttributes(); List<ITmfStateInterval> stateInfo = new ArrayList<>(nbAttr); for (int i = 0; i < getNbAttributes(); i++) { stateInfo.add(null); } if (transState.isActive()) { transState.doQuery(stateInfo, t); } backend.doQuery(stateInfo, t); for (ITmfStateInterval interval : stateInfo) { if (interval == null) { throw new IllegalStateException("Incoherent interval storage"); } } return stateInfo; }

Target:
public synchronized List<ITmfStateInterval> queryFullState(long t) throws TimeRangeException, StateSystemDisposedException { if (isDisposed) { throw new StateSystemDisposedException(); } final int nbAttr = getNbAttributes(); List<ITmfStateInterval> stateInfo = new ArrayList<>(nbAttr); for (int i = 0; i < nbAttr; i++) { stateInfo.add(null); } if (transState.isActive()) { transState.doQuery(stateInfo, t); } backend.doQuery(stateInfo, t); for (ITmfStateInterval interval : stateInfo) { if (interval == null) { throw new IllegalStateException("Incoherent interval storage"); } } return stateInfo; }
Source:
public String toString() { return "Group{" + "Description='" + Description + '\'' + ", Name='" + Name + '\'' + ", Users=" + Arrays.toString(Users) + '}'; }

Target:
public String toString() { return "Group{" + "Description='" + Description + '\'' + ", Name='" + Name + '\'' + ", Users=" + Arrays.toString(Users) + ", Tags=" + Arrays.toString(Tags) + "} " + super.toString(); }
Source:
private void setModelRunMinNewOccurrences(DiseaseGroup diseaseGroup, Boolean newOccurrenceCountOverThreshold) { Integer n; if (newOccurrenceCountOverThreshold == null) { n = null; } else { int thresholdAdjustment = newOccurrenceCountOverThreshold ? -1 : +1; n = (int) diseaseService.getNewOccurrencesCountByDiseaseGroup(diseaseGroup.getId()) + thresholdAdjustment; } diseaseGroup.setModelRunMinNewOccurrences(n); }

Target:
private void setModelRunMinNewOccurrences(DiseaseGroup diseaseGroup, Boolean newOccurrenceCountOverThreshold) { Integer n = null; if (newOccurrenceCountOverThreshold != null) { int thresholdAdjustment = newOccurrenceCountOverThreshold ? -1 : +1; n = (int) diseaseService.getNewOccurrencesCountByDiseaseGroup(diseaseGroup.getId()) + thresholdAdjustment; } diseaseGroup.setModelRunMinNewOccurrences(n); }
Source:
private void waitAndConnectToScheduler() throws Exception { SchedulerAuthenticationInterface authentication; boolean firstException = true; int trialsNumber = 0; while (scheduler == null && trialsNumber <= nodeSourceRecoveryTrialsNumber) { trialsNumber++; try { authentication = SchedulerConnection.join(schedulerUrl); Credentials creds = Credentials.getCredentialsBase64(credentials); scheduler = authentication.login(creds); Thread.sleep(nodeSourceRecoveryTimeout); } catch (Throwable t) { if (firstException) { logger.warn("Could not contact scheduler at url " + schedulerUrl + " this is normal if the scheduler has just been restarted", t); firstException = false; } else { logger.debug("Could not contact scheduler", t); } } if (trialsNumber > nodeSourceRecoveryTrialsNumber) throw new ConnectionException("Number of trials exceeded and could not contact scheduler"); } }

Target:
private void waitAndConnectToScheduler() throws Exception { SchedulerAuthenticationInterface authentication; boolean firstException = true; int trialsNumber = 0; while (scheduler == null && trialsNumber <= schedulerAwarePolicyNodeSourceRecoveryTrialsNumber) { trialsNumber++; try { authentication = SchedulerConnection.join(schedulerUrl); Credentials creds = Credentials.getCredentialsBase64(credentials); scheduler = authentication.login(creds); Thread.sleep(schedulerAwarePolicyNodeSourceRecoveryDelay); } catch (Throwable t) { if (firstException) { logger.warn("Could not contact scheduler at url " + schedulerUrl + " this is normal if the scheduler has just been restarted", t); firstException = false; } else { logger.debug("Could not contact scheduler", t); } } if (trialsNumber > schedulerAwarePolicyNodeSourceRecoveryTrialsNumber) throw new ConnectionException("Number of trials exceeded and could not contact scheduler"); } }
Source:
private List<String> getPermissionsInSession(DocumentModel doc, CoreSession session) { Principal principal = session.getPrincipal(); PermissionProvider permissionProvider = Framework.getService(PermissionProvider.class); Set<String> permissions = permissionProvider.getUserVisiblePermissionDescriptors(doc.getType()).stream().map( UserVisiblePermission::getId).collect(Collectors.toSet()); permissions.addAll(availablePermissions); return session.filterGrantedPermissions(principal, doc.getRef(), new ArrayList<>(permissions)); }

Target:
private Collection<String> getPermissionsInSession(DocumentModel doc, CoreSession session) { Principal principal = session.getPrincipal(); PermissionProvider permissionProvider = Framework.getService(PermissionProvider.class); Set<String> permissions = permissionProvider.getUserVisiblePermissionDescriptors(doc.getType()).stream().map( UserVisiblePermission::getId).collect(Collectors.toSet()); permissions.addAll(availablePermissions); return session.filterGrantedPermissions(principal, doc.getRef(), permissions); }
Source:
public void finish() { if (new FinishButton().isEnabled()) { new FinishButton().click(); new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG); } else { fail("Image cannot be run! (Duplicate name?)"); } }

Target:
public void finish() { if (new FinishButton().isEnabled()) { new FinishButton().click(); new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG); } else { throw new RuntimeException("Image cannot be run! (Duplicate name?)"); } }
Source:
public void receiveReduceData(final int iteration, final List<IndexedVector> data) { Collections.sort(data, new Comparator<IndexedVector>() { @Override public int compare(final IndexedVector o1, final IndexedVector o2) { if (o1.getIndex() > o2.getIndex()) { return 1; } else if (o1.getIndex() < o2.getIndex()) { return -1; } return 0; } }); try (final DataOutputStream daos = outputStreamProvider.create("result")) { if (data.size() == 0) { daos.writeBytes(String.format("No data")); return; } final int numColumns = data.size(); final int numRows = data.get(0).getVector().size(); for (int i = 0; i < numRows; i++) { daos.writeBytes(String.format("%d", i)); for (int j = 0; j < numColumns; j++) { daos.writeBytes(String.format(" ")); daos.writeBytes(String.format("%f", data.get(j).getVector().get(i))); } daos.writeBytes(String.format("%n")); } } catch (final IOException e) { throw new RuntimeException(e); } }

Target:
public void receiveReduceData(final int iteration, final List<IndexedVector> data) { Collections.sort(data, new Comparator<IndexedVector>() { @Override public int compare(final IndexedVector o1, final IndexedVector o2) { return o1.getIndex() - o2.getIndex(); } }); try (final DataOutputStream daos = outputStreamProvider.create("result")) { if (data.size() == 0) { daos.writeBytes(String.format("No data")); return; } final int numColumns = data.size(); final int numRows = data.get(0).getVector().size(); for (int i = 0; i < numRows; i++) { daos.writeBytes(String.format("%d", i)); for (int j = 0; j < numColumns; j++) { daos.writeBytes(String.format(" ")); daos.writeBytes(String.format("%f", data.get(j).getVector().get(i))); } daos.writeBytes(String.format("%n")); } } catch (final IOException e) { throw new RuntimeException(e); } }
Source:
private static String determineClassifier() { if (SystemUtils.IS_OS_LINUX) { return "linux"; } if (SystemUtils.IS_OS_WINDOWS) { return "windows"; } if (SystemUtils.IS_OS_MAC_OSX) { return "macosx"; } return null; }

Target:
private static String determineClassifier() { if (SystemUtils.IS_OS_LINUX) { return "linux"; } if (SystemUtils.IS_OS_WINDOWS) { return "windows"; } if (SystemUtils.IS_OS_MAC_OSX) { return "macosx"; } throw new IllegalStateException("Unsupported OS: only Linux, Windows and Mac OS X are supported"); }
Source:
private ColumnType[] getColumnTypes(final Sheet sheet, final Row row) { final Iterator<Row> data = ExcelUtils.getRowIterator(sheet, _configuration, false); final int rowLength = row.getLastCellNum(); int eagerness = 1000; final ColumnType[] columnTypes = new ColumnType[rowLength]; while (data.hasNext() && eagerness-- > 0) { Row currentRow = data.next(); for (int index = 0; index < rowLength; index++) { if (currentRow.getLastCellNum() == 0) { continue; } if (currentRow.getCell(index) == null) { checkColumnType(ColumnType.STRING, columnTypes, index); } else { CellType cellType = currentRow.getCell(index).getCellType(); switch (cellType) { case NUMERIC: if (DateUtil.isCellDateFormatted(currentRow.getCell(index))) { checkColumnType(ColumnType.DATE, columnTypes, index); } else { checkColumnType((currentRow.getCell(index).getNumericCellValue() % 1 == 0) ? ColumnType.INTEGER : ColumnType.DOUBLE, columnTypes, index); } break; case BOOLEAN: checkColumnType(ColumnType.BOOLEAN, columnTypes, index); break; case ERROR: break; case _NONE: case STRING: case FORMULA: case BLANK: checkColumnType(ColumnType.STRING, columnTypes, index); break; } } } } return columnTypes; }

Target:
protected ColumnType[] getColumnTypes(final Sheet sheet, final Row row) { final Iterator<Row> data = ExcelUtils.getRowIterator(sheet, _configuration, false); final int rowLength = row.getLastCellNum(); final ColumnType[] columnTypes = new ColumnType[rowLength]; if (_configuration.isDetectColumnTypes()) { int numberOfLinesToScan = _configuration.getNumberOfLinesToScan(); while (data.hasNext() && numberOfLinesToScan-- > 0) { final Row currentRow = data.next(); if (currentRow.getRowNum() < _configuration.getColumnNameLineNumber()) { continue; } for (int index = 0; index < rowLength; index++) { if (currentRow.getLastCellNum() == 0) { continue; } final ColumnType columnType = columnTypes[index]; final ColumnType expectedColumnType = getColumnTypeFromRow(currentRow, index); if (columnType != null) { if (!columnType.equals(ColumnType.STRING) && !columnType.equals(expectedColumnType)) { columnTypes[index] = ColumnType.VARCHAR; } } else { columnTypes[index] = expectedColumnType; } } } } else { Arrays.fill(columnTypes, ColumnType.STRING); } return columnTypes; }
Source:
private void checkCommentsInsideToken(DetailAST token) { final List<DetailAST> childNodes = new LinkedList<>(); DetailAST childNode = token.getLastChild(); while (childNode != null) { if (childNode.getType() == TokenTypes.MODIFIERS) { for (DetailAST node = token.getFirstChild().getLastChild(); node != null; node = node.getPreviousSibling()) { if (isCommentInBeginningOfLine(node)) { childNodes.add(node); } } } else if (isCommentInBeginningOfLine(childNode)) { childNodes.add(childNode); } childNode = childNode.getPreviousSibling(); } for (DetailAST node : childNodes) { if (hasEmptyLineBefore(node) && isPrePreviousLineEmpty(node)) { log(node.getLineNo(), MSG_MULTIPLE_LINES, node.getText()); } } }

Target:
private void checkCommentsInsideToken(DetailAST token) { final List<DetailAST> childNodes = new LinkedList<>(); DetailAST childNode = token.getLastChild(); while (childNode != null) { if (childNode.getType() == TokenTypes.MODIFIERS) { for (DetailAST node = token.getFirstChild().getLastChild(); node != null; node = node.getPreviousSibling()) { if (isCommentInBeginningOfLine(node)) { childNodes.add(node); } } } else if (isCommentInBeginningOfLine(childNode)) { childNodes.add(childNode); } childNode = childNode.getPreviousSibling(); } for (DetailAST node : childNodes) { if (hasEmptyLineBefore(node) && isPrePreviousLineEmpty(node)) { log(node, MSG_MULTIPLE_LINES, node.getText()); } } }
Source:
public static long writeHeader(final Version cramVersion, final OutputStream outStream, final SAMFileHeader samFileHeader, String cramID) { final CramHeader cramHeader = new CramHeader(cramVersion, cramID, samFileHeader); try { return CramIO.writeCramHeader(cramHeader, outStream); } catch (final IOException e) { throw new RuntimeException(e); } }

Target:
public static long writeHeader(final Version cramVersion, final OutputStream outStream, final SAMFileHeader samFileHeader, String cramID) { final CramHeader cramHeader = new CramHeader(cramVersion, cramID, samFileHeader); try { return CramIO.writeCramHeader(cramHeader, outStream); } catch (final IOException e) { throw new RuntimeIOException(e); } }
Source:
private boolean inUsingDeclaration(CContentAssistInvocationContext context) { IDocument doc = context.getDocument(); int offset = context.getInvocationOffset(); try { IRegion completionLineRegion = doc.getLineInformationOfOffset(offset); String completionLine = doc.get(completionLineRegion.getOffset(), completionLineRegion.getLength()); int completionLineNumber = doc.getLineOfOffset(offset); int completionLineOffset = doc.getLineOffset(completionLineNumber); String completionLinePrefix = completionLine.substring(0, offset - completionLineOffset); int lastSemicolon = completionLinePrefix.lastIndexOf(';'); String completionStatement = lastSemicolon == -1 ? completionLinePrefix : completionLinePrefix.substring(lastSemicolon + 1); if (completionStatement.matches("\\s*using\\s*(\\w*::)+\\w*")) return true; } catch (BadLocationException exc) { } return false; }

Target:
private boolean inUsingDeclaration(CContentAssistInvocationContext context) { IDocument doc = context.getDocument(); int offset = context.getInvocationOffset(); CHeuristicScanner.TokenStream tokenStream = new CHeuristicScanner.TokenStream(doc, offset); int token = tokenStream.previousToken(); if (token == Symbols.TokenIDENT) token = tokenStream.previousToken(); while (token == Symbols.TokenDOUBLECOLON) { token = tokenStream.previousToken(); if (token == Symbols.TokenUSING) { return true; } else if (token != Symbols.TokenIDENT) { return false; } else { token = tokenStream.previousToken(); } } return token == Symbols.TokenUSING; }
Source:
public CourseCardViewHolder(View convertView) { this.courseTitle = (TextView) convertView .findViewById(R.id.course_name); this.courseDetails = (TextView) convertView .findViewById(R.id.course_details); this.courseImage = (ImageView) convertView .findViewById(R.id.course_image); this.newCourseContent = convertView .findViewById(R.id.new_course_content_layout); if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { convertView.findViewById(R.id.view_foreground_overlay).setVisibility(View.VISIBLE); } this.propContainer = (LinearLayout) convertView .findViewById(R.id.graded_content_layout); this.coursePropMsg = (TextView) convertView .findViewById(R.id.prop_msg); this.learnMore = (AppCompatButton) convertView .findViewById(R.id.btn_learn_more); }

Target:
public CourseCardViewHolder(View convertView) { this.courseTitle = (TextView) convertView .findViewById(R.id.course_name); this.courseDetails = (TextView) convertView .findViewById(R.id.course_details); this.courseImage = (ImageView) convertView .findViewById(R.id.course_image); this.newCourseContent = convertView .findViewById(R.id.new_course_content_layout); if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { convertView.findViewById(R.id.view_foreground_overlay).setVisibility(View.VISIBLE); } this.propContainer = (LinearLayout) convertView .findViewById(R.id.ll_graded_content_layout); this.learnMore = (AppCompatButton) convertView .findViewById(R.id.btn_learn_more); }
Source:
protected List<AttributeStatement> createResourceIdAttributeStatements(final CallbackProperties properties) { final List<AttributeStatement> statements = new ArrayList<>(); final String patientId = properties.getPatientID(); if (patientId != null) { Attribute attribute = componentBuilder.createPatientIDAttribute(patientId); statements.addAll(componentBuilder.createAttributeStatement(Arrays.asList(attribute))); } else { LOG.warn("Resource Id is missing"); } return statements; }

Target:
protected List<AttributeStatement> createResourceIdAttributeStatements(final CallbackProperties properties) { final List<AttributeStatement> statements = new ArrayList<>(); final String patientId = properties.getPatientID(); if (patientId != null) { Attribute attribute = componentBuilder.createResourceIDAttribute(patientId); statements.addAll(componentBuilder.createAttributeStatement(Arrays.asList(attribute))); } else { LOG.warn("Resource Id is missing"); } return statements; }
Source:
public synchronized void loadSpiderIpAddresses() { if (table == null) { table = new IPTable(); String filePath = configurationService.getProperty("dspace.dir"); try { File spidersDir = new File(filePath, "config/spiders"); if (spidersDir.exists() && spidersDir.isDirectory()) { for (File file : spidersDir.listFiles()) { if (file.isFile() && !file.getName().matches(".+old$")) { for (String ip : readPatterns(file)) { log.debug("Loading {}", ip); if (!Character.isDigit(ip.charAt(0))) { try { ip = DnsLookup.forward(ip); log.debug("Resolved to {}", ip); } catch (IOException e) { log.warn("Not loading {}: {}", ip, e.getMessage()); continue; } } table.add(ip); } log.info("Loaded Spider IP file: " + file); } } } else { log.info("No spider file loaded"); } } catch (IOException | IPTable.IPFormatException e) { log.error("Error Loading Spiders:" + e.getMessage(), e); } } }

Target:
public synchronized void loadSpiderIpAddresses() { if (table == null) { table = new IPTable(); String filePath = configurationService.getProperty("dspace.dir"); try { File spidersDir = new File(filePath, "config/spiders"); if (spidersDir.exists() && spidersDir.isDirectory()) { for (File file : spidersDir.listFiles(new NoDotOldFilter())) { if (file.isFile()) { for (String ip : readPatterns(file)) { log.debug("Loading {}", ip); if (!Character.isDigit(ip.charAt(0))) { try { ip = DnsLookup.forward(ip); log.debug("Resolved to {}", ip); } catch (IOException e) { log.warn("Not loading {}: {}", ip, e.getMessage()); continue; } } table.add(ip); } log.info("Loaded Spider IP file: " + file); } } } else { log.info("No spider file loaded"); } } catch (IOException | IPTable.IPFormatException e) { log.error("Error Loading Spiders:" + e.getMessage(), e); } } }