auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Flux<CommandResponse<ZRangeCommand, Flux<Tuple>>> zRange(Publisher<ZRangeCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Flux<Tuple> result; if (ObjectUtils.nullSafeEquals(command.getDirection(), Direction.ASC)) { if (command.isWithScores()) { result = cmd .zrangeWithScores(command.getKey(), command.getRange().getLowerBound().getValue().orElse(Long.MIN_VALUE), command.getRange().getUpperBound().getValue().orElse(Long.MAX_VALUE)) .map(sc -> (Tuple) new DefaultTuple(getBytes(sc), sc.getScore())); } else { result = cmd .zrange(command.getKey(), command.getRange().getLowerBound().getValue().orElse(Long.MIN_VALUE), command.getRange().getUpperBound().getValue().orElse(Long.MAX_VALUE)) .map(value -> (Tuple) new DefaultTuple(ByteUtils.getBytes(value), Double.NaN)); } } else { if (command.isWithScores()) { result = cmd .zrevrangeWithScores(command.getKey(), command.getRange().getLowerBound().getValue().orElse(Long.MIN_VALUE), command.getRange().getUpperBound().getValue().orElse(Long.MAX_VALUE)) .map(sc -> (Tuple) new DefaultTuple(getBytes(sc), sc.getScore())); } else { result = cmd .zrevrange(command.getKey(), command.getRange().getLowerBound().getValue().orElse(Long.MIN_VALUE), command.getRange().getUpperBound().getValue().orElse(Long.MAX_VALUE)) .map(value -> (Tuple) new DefaultTuple(ByteUtils.getBytes(value), Double.NaN)); } } return Mono.just(new CommandResponse<>(command, result)); })); }

Target:
public Flux<CommandResponse<ZRangeCommand, Flux<Tuple>>> zRange(Publisher<ZRangeCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); Flux<Tuple> result; if (ObjectUtils.nullSafeEquals(command.getDirection(), Direction.ASC)) { if (command.isWithScores()) { result = cmd .zrangeWithScores(command.getKey(), command.getRange().getLowerBound().getValue().orElse(0L), command.getRange().getUpperBound().getValue().orElse(Long.MAX_VALUE)) .map(sc -> (Tuple) new DefaultTuple(getBytes(sc), sc.getScore())); } else { result = cmd .zrange(command.getKey(), command.getRange().getLowerBound().getValue().orElse(0L), command.getRange().getUpperBound().getValue().orElse(Long.MAX_VALUE)) .map(value -> (Tuple) new DefaultTuple(ByteUtils.getBytes(value), Double.NaN)); } } else { if (command.isWithScores()) { result = cmd .zrevrangeWithScores(command.getKey(), command.getRange().getLowerBound().getValue().orElse(0L), command.getRange().getUpperBound().getValue().orElse(Long.MAX_VALUE)) .map(sc -> (Tuple) new DefaultTuple(getBytes(sc), sc.getScore())); } else { result = cmd .zrevrange(command.getKey(), command.getRange().getLowerBound().getValue().orElse(0L), command.getRange().getUpperBound().getValue().orElse(Long.MAX_VALUE)) .map(value -> (Tuple) new DefaultTuple(ByteUtils.getBytes(value), Double.NaN)); } } return Mono.just(new CommandResponse<>(command, result)); })); }
Source:
private ExpressionPostAggregator( final String name, final String expression, @Nullable final String ordering, final ExprMacroTable macroTable, final Map<String, Function<Object, Object>> finalizers ) { Preconditions.checkArgument(expression != null, "expression cannot be null"); this.name = name; this.expression = expression; this.ordering = ordering; this.comparator = ordering == null ? DEFAULT_COMPARATOR : Ordering.valueOf(ordering); this.macroTable = macroTable; this.finalizers = ImmutableMap.copyOf(finalizers); this.parsed = Parser.parse(expression, macroTable); this.dependentFields = ImmutableSet.copyOf(Parser.findRequiredBindings(parsed)); }

Target:
private ExpressionPostAggregator( final String name, final String expression, @Nullable final String ordering, final ExprMacroTable macroTable, final Map<String, Function<Object, Object>> finalizers ) { Preconditions.checkArgument(expression != null, "expression cannot be null"); this.name = name; this.expression = expression; this.ordering = ordering; this.comparator = ordering == null ? DEFAULT_COMPARATOR : Ordering.valueOf(ordering); this.macroTable = macroTable; this.finalizers = finalizers; this.parsed = Parser.parse(expression, macroTable); this.dependentFields = ImmutableSet.copyOf(Parser.findRequiredBindings(parsed)); }
Source:
public boolean valueEquals(K key, V value) { V oldValue = stateMap.get(key); if ((value == null && oldValue == null) || (value != null && value.equals(oldValue))) { return true; } return false; }

Target:
public boolean valueEquals(K key, V value) { V oldValue = stateMap.get(key); return Objects.equals(value, oldValue); }
Source:
private static List<String> getListOfPollingFilters(String filterForPollSCM, String subPath) { final String DELIMITER = ","; List<String> result = new ArrayList<>(); if (filterForPollSCM != null && !(filterForPollSCM.isEmpty())) { for (String filter : filterForPollSCM.split(DELIMITER)) { result.add(filter.trim()); } } else { if (subPath != null && !(subPath.isEmpty())) { for (String filter : subPath.split(DELIMITER)) { result.add(filter.trim()); } } } return result; }

Target:
private static Set<String> getListOfPollingFilters(String filterForPollSCM, String subPath) { if (StringUtils.isNotBlank(filterForPollSCM)) { return splitAndSanitizeFilters(filterForPollSCM); } return splitAndSanitizeFilters(subPath); }
Source:
private void maybeScheduleCheckpoint() { switch (state()) { case RESTORING: this.checkpoint = checkpointableOffsets(); break; case RUNNING: if (!eosEnabled) { this.checkpoint = checkpointableOffsets(); } break; case SUSPENDED: this.checkpoint = Collections.emptyMap(); break; case CREATED: case CLOSED: throw new IllegalStateException("Illegal state " + state() + " while closing active task " + id); default: throw new IllegalStateException("Unknown state " + state() + " while closing active task " + id); } }

Target:
private void maybeScheduleCheckpoint() { switch (state()) { case RESTORING: case SUSPENDED: this.checkpoint = checkpointableOffsets(); break; case RUNNING: if (!eosEnabled) { this.checkpoint = checkpointableOffsets(); } break; case CREATED: case CLOSED: throw new IllegalStateException("Illegal state " + state() + " while scheduling checkpoint for active task " + id); default: throw new IllegalStateException("Unknown state " + state() + " while scheduling checkpoint for active task " + id); } }
Source:
public Result(final Issue issue, String altSummaryFields) { this.key = issue.getKey(); if(altSummaryFields == null || altSummaryFields.isEmpty() ) { this.summary = issue.getSummary(); } else { String[] fields = altSummaryFields.split(","); StringBuilder sb = new StringBuilder(); for(String f : fields) { sb.append(issue.getFieldByName(f).getValue()); sb.append(' '); } this.summary = sb.toString(); } }

Target:
public Result(final Issue issue, String altSummaryFields) { this.key = issue.getKey(); if(StringUtils.isEmpty(altSummaryFields)) { this.summary = issue.getSummary(); } else { String[] fields = altSummaryFields.split(","); StringBuilder sb = new StringBuilder(); for(String f : fields) { String fn = f.trim(); if(StringUtils.isNotEmpty(fn)) { IssueField field = issue.getFieldByName(fn); if(field != null && field.getValue() != null) { String fv = field.getValue().toString(); if(StringUtils.isNotEmpty(fv)) { sb.append(fv); sb.append(' '); } } } } this.summary = sb.toString().trim(); } }
Source:
public void doLocalClearThrowsForceReattemptExceptionWhenAnExceptionIsThrownDuringClearOperation() throws ForceReattemptException { DistributedLockService mockLockService = mock(DistributedLockService.class); doReturn(mockLockService).when(message).getPartitionRegionLockService(); NullPointerException exception = new NullPointerException("Error encountered"); doThrow(exception).when(bucketRegion).cmnClearRegion(any(), anyBoolean(), anyBoolean()); when(bucketRegion.isPrimary()).thenReturn(true); when(mockLockService.lock(any(), anyLong(), anyLong())).thenReturn(true); assertThatThrownBy(() -> message.doLocalClear(region)) .isInstanceOf(ForceReattemptException.class) .hasMessageContaining(ClearPRMessage.EXCEPTION_THROWN_DURING_CLEAR_OPERATION); verify(bucketRegion, times(1)).cmnClearRegion(any(), anyBoolean(), anyBoolean()); verify(mockLockService, times(1)).lock(any(), anyLong(), anyLong()); verify(mockLockService, times(1)).unlock(any()); }

Target:
public void doLocalClearThrowsForceReattemptExceptionWhenAnExceptionIsThrownDuringClearOperation() { DistributedLockService mockLockService = mock(DistributedLockService.class); doReturn(mockLockService).when(message).getPartitionRegionLockService(); NullPointerException exception = new NullPointerException("Error encountered"); doThrow(exception).when(bucketRegion).cmnClearRegion(any(), anyBoolean(), anyBoolean()); when(bucketRegion.isPrimary()).thenReturn(true); when(mockLockService.lock(any(), anyLong(), anyLong())).thenReturn(true); assertThatThrownBy(() -> message.doLocalClear(region)) .isInstanceOf(ForceReattemptException.class) .hasMessageContaining(ClearPRMessage.EXCEPTION_THROWN_DURING_CLEAR_OPERATION); verify(bucketRegion, times(1)).cmnClearRegion(any(), anyBoolean(), anyBoolean()); }
Source:
protected List<Issue> getIssues(String jql, int start, int maxPerQuery, int maxResults) { LOG.info("Start indexing current JIRA issues..."); List<Issue> issues = new ArrayList<>(); while (true) { SearchRestClient searchRestClient = endpoint.getClient().getSearchClient(); SearchResult searchResult = searchRestClient.searchJql(jql, maxResults, start, null).claim(); for (Issue issue : searchResult.getIssues()) { issues.add(issue); } if (start >= searchResult.getTotal() || (maxResults > 0 && issues.size() >= maxResults)) { break; } start += maxPerQuery; } LOG.info("End indexing current JIRA issues. issues indexed.", issues.size()); return issues; }

Target:
protected List<Issue> getIssues(String jql, int start, int maxPerQuery, int maxResults) { LOG.debug("Start indexing current JIRA issues..."); List<Issue> issues = new ArrayList<>(); while (true) { SearchRestClient searchRestClient = endpoint.getClient().getSearchClient(); SearchResult searchResult = searchRestClient.searchJql(jql, maxResults, start, null).claim(); for (Issue issue : searchResult.getIssues()) { issues.add(issue); } if (start >= searchResult.getTotal() || (maxResults > 0 && issues.size() >= maxResults)) { break; } start += maxPerQuery; } LOG.debug("End indexing current JIRA issues. issues indexed.", issues.size()); return issues; }
Source:
public void before() throws Exception { configDirectory = Files.createTempDirectory(null); config = new NioFileConfigDirectory(configDirectory); c5Server = context.mock(C5Server.class, "mockC5Server"); discoveryModule = context.mock(DiscoveryModule.class); replicationModule = context.mock(ReplicationModule.class); replicator = context.mock(ReplicationModule.Replicator.class); C5FiberFactory fiberFactory = () -> new ThreadFiber(); context.checking(new Expectations() {{ oneOf(c5Server).getFiberFactory(with(any(Consumer.class))); will(returnValue(fiberFactory)); oneOf(c5Server).getModule(with(ModuleType.Discovery)); will(returnValue(discoveryServiceFuture)); discoveryServiceFuture.set(discoveryModule); oneOf(c5Server).getModule(with(ModuleType.Replication)); will(returnValue(replicationServiceFuture)); replicationServiceFuture.set(replicationModule); oneOf(c5Server).isSingleNodeMode(); will(returnValue(true)); oneOf(discoveryModule).getNewNodeNotifications(); will(returnValue(newNodeNotificationChannel)); oneOf(discoveryModule).getState(); will(returnValue(stateFuture)); }}); tabletService = new TabletService(c5Server); }

Target:
public void before() throws Exception { config = context.mock(ConfigDirectory.class); configDirectory = Files.createTempDirectory(null); c5Server = context.mock(C5Server.class, "mockC5Server"); discoveryModule = context.mock(DiscoveryModule.class); replicationModule = context.mock(ReplicationModule.class); replicator = context.mock(ReplicationModule.Replicator.class); context.checking(new Expectations() {{ allowing(config).getBaseConfigPath(); will(returnValue(configDirectory)); allowing(config).writeBinaryData(with(any(String.class)), with(any(String.class)), with(any(byte[].class))); allowing(config).writePeersToFile(with(any(String.class)), with(any(List.class))); allowing(config).configuredQuorums(); will(returnValue(Arrays.asList("testTable,\\x00,1.064e3eb1da827b1dc753e03a797dba37."))); oneOf(c5Server).getFiberFactory(with(any(Consumer.class))); will(returnValue(fiberFactory)); oneOf(c5Server).getModule(with(ModuleType.Discovery)); will(returnValue(discoveryServiceFuture)); discoveryServiceFuture.set(discoveryModule); oneOf(c5Server).getModule(with(ModuleType.Replication)); will(returnValue(replicationServiceFuture)); replicationServiceFuture.set(replicationModule); oneOf(c5Server).isSingleNodeMode(); will(returnValue(true)); oneOf(discoveryModule).getNewNodeNotifications(); will(returnValue(newNodeNotificationChannel)); oneOf(discoveryModule).getState(); will(returnValue(stateFuture)); }}); tabletService = new TabletService(c5Server); }
Source:
public UserDevfileImpl createDevfile(Devfile devfile) throws ServerException, NotFoundException, ConflictException { requireNonNull(devfile, "Required non-null devfile"); UserDevfileImpl result = userDevfileDao.create( new UserDevfileImpl(NameGenerator.generate("usrdevfile", 16), devfile)); LOG.info( "UserDevfile '{}' with id '{}' created by user '{}'", result.getName(), result.getId(), EnvironmentContext.getCurrent().getSubject().getUserName()); eventService.publish(new DevfileCreatedEvent(result)); return result; }

Target:
public UserDevfile createDevfile(Devfile devfile) throws ServerException, NotFoundException, ConflictException { requireNonNull(devfile, "Required non-null devfile"); UserDevfile result = userDevfileDao.create(new UserDevfileImpl(NameGenerator.generate("devfile", 16), devfile)); LOG.debug( "UserDevfile '{}' with id '{}' created by user '{}'", result.getName(), result.getId(), EnvironmentContext.getCurrent().getSubject().getUserName()); eventService.publish(new DevfileCreatedEvent(result)); return result; }
Source:
public Object compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); return sketch.getEstimate(); }

Target:
public Double compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); return sketch.getEstimate(); }
Source:
public static PreparedStatement prepareIdSelectStatement(Connection c, String storageKey, int id) { try { PreparedStatement preparedStatement = c.prepareStatement("SELECT * FROM " + storageKey + " WHERE " + DatabaseHelper.ID_COL + " = ?;"); preparedStatement.setInt(1, id); return preparedStatement; } catch (SQLException e) { e.printStackTrace(); return null; } }

Target:
public static PreparedStatement prepareIdSelectStatement(Connection c, String storageKey, int id) { try { PreparedStatement preparedStatement = c.prepareStatement("SELECT * FROM " + storageKey + " WHERE " + DatabaseHelper.ID_COL + " = ?;"); preparedStatement.setInt(1, id); return preparedStatement; } catch (SQLException e) { throw new RuntimeException(e); } }
Source:
public static Response decrypt(Response response) throws OSException { discardEOptions(response); OSCoreCtxDB db = HashMapCtxDB.getInstance(); byte[] protectedData = collectData(response); Encrypt0Message enc = null; Token token = response.getToken(); OSCoreCtx ctx = null; if (token != null) { ctx = db.getContextByToken(token); if (ctx == null) { LOGGER.severe(OSExceptionHandler.TOKEN_INVALID); throw new OSException(OSExceptionHandler.TOKEN_INVALID); } enc = decompression(protectedData, response); } else { LOGGER.severe(OSExceptionHandler.TOKEN_NULL); throw new OSException(OSExceptionHandler.TOKEN_NULL); } byte[] content = decryptAndDecode(enc, response, ctx, db.getSeqByToken(token)); response = OptionJuggle.setRealCodeResponse(response, CoAP.ResponseCode.valueOf(content[0])); content = Arrays.copyOfRange(content, 1, content.length); byte[] payload = OSSerializer.readPayload(content); response.setPayload(payload); db.removeToken(token); return response; }

Target:
public static Response decrypt(Response response) throws OSException { discardEOptions(response); OSCoreCtxDB db = HashMapCtxDB.getInstance(); byte[] protectedData = response.getPayload(); Encrypt0Message enc = null; Token token = response.getToken(); OSCoreCtx ctx = null; OptionSet uOptions = response.getOptions(); if (token != null) { ctx = db.getContextByToken(token); if (ctx == null) { LOGGER.error(Error.TOKEN_INVALID); throw new OSException(Error.TOKEN_INVALID); } enc = decompression(protectedData, response); } else { LOGGER.error(Error.TOKEN_NULL); throw new OSException(Error.TOKEN_NULL); } byte[] plaintext = decryptAndDecode(enc, response, ctx, db.getSeqByToken(token)); DatagramReader reader = new DatagramReader(new ByteArrayInputStream(plaintext)); response = OptionJuggle.setRealCodeResponse(response, CoAP.ResponseCode.valueOf(reader.read(CoAP.MessageFormat.CODE_BITS))); response.setOptions(EMPTY); DataParser.parseOptionsAndPayload(reader, response); OptionSet eOptions = response.getOptions(); eOptions = OptionJuggle.merge(eOptions, uOptions); response.setOptions(eOptions); db.removeToken(token); return response; }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { if (permsList == null && getDisk() != null) { permsList = new ArrayList<PermissionSubject>(); permsList.add(new PermissionSubject(getDisk().getId(), VdcObjectType.Disk, ActionGroup.ATTACH_DISK)); } return permsList; }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { if (permsList == null && getDisk() != null) { permsList = new ArrayList<PermissionSubject>(); permsList.add(new PermissionSubject(getDisk().getId(), VdcObjectType.Disk, ActionGroup.ATTACH_DISK)); permsList.add(new PermissionSubject(getDisk().getId(), VdcObjectType.Disk, ActionGroup.EDIT_DISK_PROPERTIES)); } return permsList; }
Source:
private void log(IStatus status, String prefix) { if (status.getSeverity() >= minSeverity) { log(prefix + status.getMessage()); String exceptionMessage = status.getException() != null ? status.getException().getMessage() : null; if (exceptionMessage != null) log(prefix + exceptionMessage); IStatus[] nestedStatus = status.getChildren(); if (nestedStatus != null) for (IStatus nestedStatu : nestedStatus) { log(nestedStatu, prefix + INDENT); } } }

Target:
private void log(IStatus status, String prefix) { if (status.getSeverity() >= minSeverity) { log(prefix + status.getMessage()); String exceptionMessage = status.getException() != null ? status.getException().getMessage() : null; if (exceptionMessage != null) log(prefix + exceptionMessage); IStatus[] nestedStatus = status.getChildren(); if (nestedStatus != null) for (IStatus s : nestedStatus) { log(s, prefix + INDENT); } } }
Source:
protected void updateOSValue(final Integer selectedOsId) { List<Integer> vmOsValues; Cluster cluster = getModel().getSelectedCluster(); if (cluster != null) { vmOsValues = AsyncDataProvider.getInstance().getOsIds(cluster.getArchitecture()); if (selectedOsId != null && vmOsValues.contains(selectedOsId)) { getModel().getOSType().setSelectedItem(selectedOsId); } else { updateOSValues(); } } else { updateOSValues(); } }

Target:
protected void updateOSValue(final Integer selectedOsId) { Cluster cluster = getModel().getSelectedCluster(); if (cluster != null) { List<Integer> vmOsValues = AsyncDataProvider.getInstance().getOsIds(cluster.getArchitecture()); if (selectedOsId == null || !vmOsValues.contains(selectedOsId)) { updateOSValues(); return; } getModel().getOSType().setSelectedItem(selectedOsId); } }
Source:
public ImmutableValue<String> lockToken() { return new ImmutableSpongeValue<String>(this.usedKey, this.value); }

Target:
public ImmutableValue<String> lockToken() { return this.lockToken; }
Source:
public static void main(String[] args) { System.setProperty("smart-socket.server.pageSize", (32 * 1024 * 1024) + ""); System.setProperty("smart-socket.session.writeChunkSize", (1024 * 8) + ""); HttpMessageProcessor processor = new HttpMessageProcessor(System.getProperty("webapps.dir", "./")); processor.route("/plaintext", new HttpHandle() { @Override public void doHandle(HttpRequest request, HttpResponse response) throws IOException { response.setContentLength(body.length); response.setContentType("text/plain; charset=UTF-8"); response.getOutputStream().write(body); } }); processor.route("/json", new HttpHandle() { byte[] b = JSON.toJson(new Message("Hello, World!")); @Override public void doHandle(HttpRequest request, HttpResponse response) throws IOException { response.setContentLength(b.length); response.setContentType("application/json"); response.getOutputStream().write(b); } }); http(processor); }

Target:
public static void main(String[] args) { System.setProperty("smart-socket.server.pageSize", (32 * 1024 * 1024) + ""); System.setProperty("smart-socket.session.writeChunkSize", (1024 * 8) + ""); HttpMessageProcessor processor = new HttpMessageProcessor(System.getProperty("webapps.dir", "./")); processor.route("/plaintext", new HttpHandle() { @Override public void doHandle(HttpRequest request, HttpResponse response) throws IOException { response.setContentLength(body.length); response.setContentType("text/plain; charset=UTF-8"); response.getOutputStream().write(body); } }); processor.route("/json", new HttpHandle() { @Override public void doHandle(HttpRequest request, HttpResponse response) throws IOException { byte[] b = JSON.toJson(new Message("Hello, World!")); response.setContentLength(b.length); response.setContentType("application/json"); response.getOutputStream().write(b); } }); http(processor); }
Source:
R apply(T input) throws IOException; } private <T,R> R wrapWithSnappyOrThrow(T stream, IOFunction<T, R> wrapper){ if (isSnappyAvailable()) { try { return wrapper.apply(stream); } catch (Exception e) { throw new SAMException("Error instantiating SnappyInputStream", e); } } else { final String errorMessage = Defaults.DISABLE_SNAPPY_COMPRESSOR ? "Cannot wrap stream with snappy compressor because snappy was disabled via the " + Defaults.DISABLE_SNAPPY_PROPERTY_NAME + " system property." : "Cannot wrap stream with snappy compressor because we could not load the snappy library."; throw new SAMException(errorMessage); } }

Target:
R apply(T input) throws IOException; } private <T,R> R wrapWithSnappyOrThrow(T stream, IOFunction<T, R> wrapper){ if (isSnappyAvailable()) { try { return wrapper.apply(stream); } catch (Exception e) { throw new SAMException("Error wrapping stream with snappy", e); } } else { final String errorMessage = Defaults.DISABLE_SNAPPY_COMPRESSOR ? "Cannot wrap stream with snappy compressor because snappy was disabled via the " + Defaults.DISABLE_SNAPPY_PROPERTY_NAME + " system property." : "Cannot wrap stream with snappy compressor because we could not load the snappy library."; throw new SAMException(errorMessage); } }
Source:
private static RowType createJsonRowType(DataType databaseSchema) { return (RowType) DataTypes.ROW( DataTypes.FIELD("after", databaseSchema), DataTypes.FIELD("op", DataTypes.STRING())).getLogicalType(); }

Target:
private static RowType createJsonRowType(DataType databaseSchema) { return (RowType) DataTypes.ROW( DataTypes.FIELD("before", databaseSchema), DataTypes.FIELD("after", databaseSchema), DataTypes.FIELD("op", DataTypes.STRING())).getLogicalType(); }
Source:
public static void main(String[] args) throws Exception { System.setProperty("hazelcast.jmx", "true"); Hazelcast.newHazelcastInstance(); Hazelcast.newHazelcastInstance(); Hazelcast.newHazelcastInstance(); HazelcastInstance hz = Hazelcast.newHazelcastInstance(); System.out.println("Hazelcast cluster was started. Number of members: " + hz.getCluster().getMembers().size()); IMap<String, String> map = hz.getMap("cities"); map.put("where to live", "Brno"); map.put("where to have a joy", "Paris"); map.put("where to go next", "London"); System.out.println("Entries were added to 'cities' IMap, current size is: " + map.size()); for (int i = 0; i < 15; i++) { Thread.sleep(2000L); printMapStatistics(); } Hazelcast.shutdownAll(); }

Target:
public static void main(String[] args) { System.setProperty("hazelcast.jmx", "true"); Hazelcast.newHazelcastInstance(); Hazelcast.newHazelcastInstance(); Hazelcast.newHazelcastInstance(); HazelcastInstance hz = Hazelcast.newHazelcastInstance(); System.out.println("Hazelcast cluster was started. Number of members: " + hz.getCluster().getMembers().size()); IMap<String, String> map = hz.getMap("cities"); map.put("where to live", "Brno"); map.put("where to have a joy", "Paris"); map.put("where to go next", "London"); System.out.println("Entries were added to 'cities' IMap, current size is: " + map.size()); for (int i = 0; i < 15; i++) { sleepSeconds(2); printMapStatistics(); } Hazelcast.shutdownAll(); }
Source:
public VfsEventService() { this.executor = newSingleThreadExecutor(); this.running = new AtomicBoolean(false); }

Target:
VfsEventService() { final String threadName = getClass().getSimpleName().concat("Thread-%d"); final ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat(threadName) .setDaemon(TRUE) .build(); this.executor = newSingleThreadExecutor(threadFactory); this.running = new AtomicBoolean(FALSE); }
Source:
public Builder fetch( Rule rule, Path outputDirectory, BlazeDirectories directories, Environment env, Map<String, String> markerData) throws RepositoryFunctionException { CPU hostCpu = CPU.getCurrent(); OS hostOs = OS.getCurrent(); List<String> constraints = generateConstraints(hostCpu, hostOs); try { outputDirectory.createDirectoryAndParents(); RepositoryFunction.writeFile( outputDirectory, "WORKSPACE", workspaceFileContent(rule.getName())); RepositoryFunction.writeFile( outputDirectory, "BUILD.bazel", buildFileContent(rule.getName())); RepositoryFunction.writeFile( outputDirectory, "constraints.bzl", constraintFileContent(constraints)); } catch (IOException e) { throw new RepositoryFunctionException( new IOException("Could not create content for " + rule.getName() + ": " + e.getMessage()), Transience.TRANSIENT); } return RepositoryDirectoryValue.builder().setPath(outputDirectory); }

Target:
public Builder fetch( Rule rule, Path outputDirectory, BlazeDirectories directories, Environment env, Map<String, String> markerData) throws RepositoryFunctionException { CPU hostCpu = CPU.getCurrent(); OS hostOs = OS.getCurrent(); try { outputDirectory.createDirectoryAndParents(); RepositoryFunction.writeFile( outputDirectory, "WORKSPACE", workspaceFileContent(rule.getName())); RepositoryFunction.writeFile( outputDirectory, "BUILD.bazel", buildFileContent(rule.getName())); RepositoryFunction.writeFile( outputDirectory, "constraints.bzl", constraintFileContent(hostCpu, hostOs)); } catch (IOException e) { throw new RepositoryFunctionException( new IOException("Could not create content for " + rule.getName() + ": " + e.getMessage()), Transience.TRANSIENT); } return RepositoryDirectoryValue.builder().setPath(outputDirectory); }
Source:
public void missingFields_hiddenSilently() { SyncConfiguration config = configFactory.createSyncConfigurationBuilder(SyncTestUtils.createTestUser(), "<LINK_0>") .schema(StringOnly.class) .build(); String className = StringOnly.class.getSimpleName(); DynamicRealm dynamicRealm = DynamicRealm.getInstance(config); RealmSchema schema = dynamicRealm.getSchema(); dynamicRealm.beginTransaction(); schema.create(className) .addField(StringOnly.FIELD_CHARS, String.class) .addField("newField", String.class); OsObjectStore.setSchemaVersion(dynamicRealm.getSharedRealm(), 0); dynamicRealm.commitTransaction(); dynamicRealm.close(); Realm realm = Realm.getInstance(config); RealmObjectSchema stringOnlySchema = realm.getSchema().get(className); try { assertTrue(stringOnlySchema.hasField(StringOnly.FIELD_CHARS)); assertTrue(stringOnlySchema.hasField("newField")); assertEquals(2, stringOnlySchema.getFieldNames().size()); } finally { realm.close(); } }

Target:
public void missingFields_hiddenSilently() { SyncConfiguration config = configFactory.createSyncConfigurationBuilder(SyncTestUtils.createTestUser(), "<LINK_0>") .schema(StringOnly.class) .build(); String className = StringOnly.class.getSimpleName(); DynamicRealm dynamicRealm = DynamicRealm.getInstance(config); RealmSchema schema = dynamicRealm.getSchema(); dynamicRealm.beginTransaction(); schema.create(className) .addField(StringOnly.FIELD_CHARS, String.class) .addField("newField", String.class); dynamicRealm.setVersion(0); dynamicRealm.commitTransaction(); dynamicRealm.close(); Realm realm = Realm.getInstance(config); RealmObjectSchema stringOnlySchema = realm.getSchema().get(className); try { assertTrue(stringOnlySchema.hasField(StringOnly.FIELD_CHARS)); assertTrue(stringOnlySchema.hasField("newField")); assertEquals(2, stringOnlySchema.getFieldNames().size()); } finally { realm.close(); } }
Source:
private void validateJson() throws ValidationException { PolicyMuleArtifactJsonVerifier.validate(projectInformation, getMuleArtifactFile()); }

Target:
private void validateJson() throws ValidationException { new PolicyMuleArtifactJsonVerifier(projectInformation, getMuleArtifactFile()).validate(); }
Source:
public Mono<Void> deleteAllById(Iterable<? extends ID> ids) { Assert.notNull(ids, "The given Iterable of ids must not be null!"); return Flux.fromIterable(ids).flatMap(this::deleteById).then(); }

Target:
public Mono<Void> deleteAllById(Iterable<? extends ID> ids) { Assert.notNull(ids, "The given Iterable of ids must not be null!"); Collection<?> idCollection = StreamUtils.createStreamFromIterator(ids.iterator()).collect(Collectors.toList()); Criteria idsInCriteria = where(entityInformation.getIdAttribute()).in(idCollection); return mongoOperations .remove(new Query(idsInCriteria), entityInformation.getJavaType(), entityInformation.getCollectionName()) .then(); }
Source:
public void testButtonVisibilityForMusicFile() throws Throwable { Uri uri = Uri.parse("android.resource://" + mContext.getPackageName() + "/" + R.raw.test_music); final MediaItem uriMediaItem = createTestMediaItem2(uri); final CountDownLatch latch = new CountDownLatch(1); final MediaController controller = createController(new MediaController.ControllerCallback() { @NonNull @Override public SessionResult onCustomCommand(@NonNull MediaController controller, @NonNull SessionCommand command, @Nullable Bundle args) { if (command.getCustomAction() == MediaControlView.EVENT_UPDATE_TRACK_STATUS) { latch.countDown(); } return new SessionResult(SessionResult.RESULT_SUCCESS, null); } }); mActivityRule.runOnUiThread(new Runnable() { @Override public void run() { mVideoView.setMediaItem(uriMediaItem); } }); assertTrue(latch.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS)); onView(withId(R.id.subtitle)).check(matches(not(isCompletelyDisplayed()))); }

Target:
public void testButtonVisibilityForMusicFile() throws Throwable { Uri uri = Uri.parse("android.resource://" + mContext.getPackageName() + "/" + R.raw.test_music); final MediaItem uriMediaItem = createTestMediaItem2(uri); final CountDownLatch latch = new CountDownLatch(1); final MediaController controller = createController(new MediaController.ControllerCallback() { @NonNull @Override public SessionResult onCustomCommand(@NonNull MediaController controller, @NonNull SessionCommand command, @Nullable Bundle args) { if (command.getCustomAction() == MediaControlView.EVENT_UPDATE_TRACK_STATUS) { latch.countDown(); } return new SessionResult(SessionResult.RESULT_SUCCESS, null); } }); mActivityRule.runOnUiThread(new Runnable() { @Override public void run() { mVideoView.setMediaItem(uriMediaItem); } }); assertTrue(latch.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS)); onView(withId(R.id.subtitle)).check(matches(not(isDisplayed()))); }
Source:
public ITmfTrace openTrace(String projectName, String traceName, boolean isExperiment) { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject rootProject = root.getProject(projectName); TmfProjectElement rootElement = TmfProjectRegistry.getProject(rootProject); String childrenName = isExperiment ? "Experiments" : "Traces"; ITmfProjectModelElement traceFolder = rootElement.getChild(childrenName); ITmfProjectModelElement traceChild = traceFolder.getChild(traceName); if (!(traceChild instanceof TmfCommonProjectElement)) { return null; } Display.getDefault().syncExec(new Runnable() { @Override public void run() { if ((traceChild instanceof TmfTraceElement) && !isExperiment) { TmfTraceElement traceElement = (TmfTraceElement) traceChild; TmfOpenTraceHelper.openTraceFromElement(traceElement.getElementUnderTraceFolder()); } else if ((traceChild instanceof TmfExperimentElement) && isExperiment) { TmfExperimentElement experimentElement = (TmfExperimentElement) traceChild; TmfOpenTraceHelper.openTraceFromElement(experimentElement); } } }); TmfCommonProjectElement projectElement = (TmfCommonProjectElement) traceChild; ITmfTrace trace = projectElement.getTrace(); Integer tryCounter = 0; final Integer numberOfTry = 10; while (trace == null && tryCounter < numberOfTry) { try { Thread.sleep(100); } catch (InterruptedException e) { break; } trace = projectElement.getTrace(); tryCounter++; } return trace; }

Target:
public ITmfTrace openTrace(String projectName, String traceName, boolean isExperiment) throws FileNotFoundException { ITmfProjectModelElement traceChild = getFile(projectName, traceName, isExperiment); if (!(traceChild instanceof TmfCommonProjectElement)) { throw new FileNotFoundException(); } Display.getDefault().syncExec(new Runnable() { @Override public void run() { if ((traceChild instanceof TmfTraceElement) && !isExperiment) { TmfTraceElement traceElement = (TmfTraceElement) traceChild; TmfOpenTraceHelper.openTraceFromElement(traceElement.getElementUnderTraceFolder()); } else if ((traceChild instanceof TmfExperimentElement) && isExperiment) { TmfExperimentElement experimentElement = (TmfExperimentElement) traceChild; TmfOpenTraceHelper.openTraceFromElement(experimentElement); } } }); TmfCommonProjectElement projectElement = (TmfCommonProjectElement) traceChild; ITmfTrace trace = projectElement.getTrace(); Integer tryCounter = 0; final Integer numberOfTry = 10; while (trace == null && tryCounter < numberOfTry) { try { Thread.sleep(100); } catch (InterruptedException e) { break; } trace = projectElement.getTrace(); tryCounter++; } if (trace != null) { return trace; } throw new FileNotFoundException(); }
Source:
public void testBuildXMLGenerateLanguageBundle() throws CarbonToolsIntegrationTestException, IOException { boolean isJarCreated = false; Process process = null; try { File sourceFile = new File(TestConfigurationProvider.getResourceLocation() + File.separator + "artifacts" + File.separator + "CARBON" + File.separator + "carbontools" + File.separator + "resources"); File targetFile = new File(carbonHome + File.separator + "resources"); super.copyFolder(sourceFile, targetFile); String cmdArray[]; if (CarbonCommandToolsUtil.isCurrentOSWindows()) { cmdArray = new String[]{"cmd.exe", "/c", "start", "ant", "localize"}; } else { cmdArray = new String[]{"ant", "localize"}; } process = CarbonCommandToolsUtil.runScript(carbonHome + File.separator + "bin", cmdArray); File folder = new File(carbonHome + File.separator + "repository" + File.separator + "components" + File.separator + "dropins"); long startTime = System.currentTimeMillis(); long timeout = 20000; while ((System.currentTimeMillis() - startTime) < timeout) { if (folder.exists() && folder.isDirectory()) { File[] listOfFiles = folder.listFiles(); for (File file : listOfFiles) { if (file.getName(). contains("org.wso2.carbon.identity.oauth.ui.languageBundle_4.0.7.jar")) { log.info("LanguageBundle jar created successfully"); isJarCreated = true; break; } } if (isJarCreated) { break; } } } } finally { if (process != null) { process.destroy(); } } assertTrue(isJarCreated, "Jar not created successfully"); }

Target:
public void testBuildXMLGenerateLanguageBundle() throws CarbonToolsIntegrationTestException { boolean isJarCreated = false; Process process = null; try { File sourceFile = new File(TestConfigurationProvider.getResourceLocation() + File.separator + "artifacts" + File.separator + "CARBON" + File.separator + "carbontools" + File.separator + "resources"); File targetFile = new File(carbonHome + File.separator + "resources"); super.copyFolder(sourceFile, targetFile); String cmdArray[]; if ((CarbonCommandToolsUtil.getCurrentOperatingSystem(). contains(OperatingSystems.WINDOWS.name().toLowerCase())) ) { cmdArray = new String[]{"cmd.exe", "/c", "start", "ant", "localize"}; } else { cmdArray = new String[]{"ant", "localize"}; } process = CarbonCommandToolsUtil.runScript(carbonHome + File.separator + "bin", cmdArray); File folder = new File(carbonHome + File.separator + "repository" + File.separator + "components" + File.separator + "dropins"); long startTime = System.currentTimeMillis(); long timeout = 20000; while ((System.currentTimeMillis() - startTime) < timeout) { if (folder.exists() && folder.isDirectory()) { File[] listOfFiles = folder.listFiles(); for (File file : listOfFiles) { if (file.getName(). contains("org.wso2.carbon.identity.oauth.ui.languageBundle_4.0.7.jar")) { log.info("LanguageBundle jar created successfully"); isJarCreated = true; break; } } if (isJarCreated) { break; } } } } finally { if (process != null) { process.destroy(); } } assertTrue(isJarCreated, "Jar not created successfully"); }
Source:
public void setBuilderCache(LRUBuilderCache builderCache) { this.builderCache = builderCache; }

Target:
protected void setBuilderCache( LRUBuilderCache builderCache ) { this.builderCache = builderCache; }
Source:
public String toFullString() { return typeDetails.stream() .map(s -> s.replace(DELIMITER, ESCAPED_DELIMITER)) .collect(Collectors.joining(",'")); }

Target:
public String toFullString() { return typeDetails.stream() .map(s -> s.replace(DELIMITER, ESCAPED_DELIMITER)) .collect(Collectors.joining(DELIMITER)); }
Source:
public String getShortText() { if (cleaner.isResizing) return NodeL10n.getBase().getString("SaltedHashFreenetStore.shortResizeProgress", new String[] { "name", "processed", "total" }, new String[] { name, String.valueOf((cleaner.entriesTotal - cleaner.entriesLeft)) , String.valueOf(cleaner.entriesTotal) }); else return NodeL10n.getBase().getString("SaltedHashFreenetStore.shortRebuildProgress" + (slotFilter.isNew() ? "New" : ""), new String[] { "name", "processed", "total" }, new String[] { name, String.valueOf((cleaner.entriesTotal - cleaner.entriesLeft)) , String.valueOf(cleaner.entriesTotal) }); }

Target:
public String getShortText() { if (cleaner.isResizing) return NodeL10n.getBase().getString("SaltedHashFreenetStore.shortResizeProgress", new String[] { "name", "processed", "total" }, new String[] { name, String.valueOf(cleaner.entriesTotal - cleaner.entriesLeft) , String.valueOf(cleaner.entriesTotal) }); else return NodeL10n.getBase().getString("SaltedHashFreenetStore.shortRebuildProgress" + (slotFilter.isNew() ? "New" : ""), new String[] { "name", "processed", "total" }, new String[] { name, String.valueOf(cleaner.entriesTotal - cleaner.entriesLeft) , String.valueOf(cleaner.entriesTotal) }); }
Source:
public void testRFileEncrypted() throws Exception { AccumuloConfiguration cryptoOnConf = getAccumuloConfig(CRYPTO_ON_CONF); FileSystem fs = FileSystem.getLocal(CachedConfiguration.getInstance()); ArrayList<Key> keys = testData(); SummarizerConfiguration sumConf = SummarizerConfiguration.builder(KeyCounter.class.getName()) .build(); String file = "target/testFile1.rf"; fs.delete(new Path(file), true); try (RFileWriter writer = RFile.newWriter().to(file).withFileSystem(fs) .withTableProperties(cryptoOnConf).withSummarizers(sumConf).build()) { Value empty = new Value(new byte[] {}); writer.startDefaultLocalityGroup(); for (Key key : keys) { writer.append(key, empty); } } Scanner iter = RFile.newScanner().from(file).withFileSystem(fs) .withTableProperties(cryptoOnConf).build(); ArrayList<Key> keysRead = new ArrayList<>(); iter.forEach(e -> keysRead.add(e.getKey())); assertEquals(keys, keysRead); for (Summary summary : RFile.summaries().from(file).withFileSystem(fs) .withTableProperties(cryptoOnConf).read()) { long total = summary.getFileStatistics().getTotal(); assertTrue(total > 0); } }

Target:
public void testRFileEncrypted() throws Exception { AccumuloConfiguration cryptoOnConf = getAccumuloConfig(CRYPTO_ON_CONF); FileSystem fs = FileSystem.getLocal(CachedConfiguration.getInstance()); ArrayList<Key> keys = testData(); SummarizerConfiguration sumConf = SummarizerConfiguration.builder(KeyCounter.class.getName()) .build(); String file = "target/testFile1.rf"; fs.delete(new Path(file), true); try (RFileWriter writer = RFile.newWriter().to(file).withFileSystem(fs) .withTableProperties(cryptoOnConf).withSummarizers(sumConf).build()) { Value empty = new Value(new byte[] {}); writer.startDefaultLocalityGroup(); for (Key key : keys) { writer.append(key, empty); } } Scanner iter = RFile.newScanner().from(file).withFileSystem(fs) .withTableProperties(cryptoOnConf).build(); ArrayList<Key> keysRead = new ArrayList<>(); iter.forEach(e -> keysRead.add(e.getKey())); assertEquals(keys, keysRead); Collection<Summary> summaries = RFile.summaries().from(file).withFileSystem(fs) .withTableProperties(cryptoOnConf).read(); Summary summary = Iterables.getOnlyElement(summaries); assertEquals(keys.size(), (long) summary.getStatistics().get("keys")); assertEquals(1, summary.getStatistics().size()); assertEquals(0, summary.getFileStatistics().getInaccurate()); assertEquals(1, summary.getFileStatistics().getTotal()); }
Source:
public InvocationContext createInvocationContext(boolean isWrite, int keyCount) { if (keyCount == 1) { SingleKeyNonTxInvocationContext result = new SingleKeyNonTxInvocationContext(true, keyEq); return result; } else if (keyCount > 0) { NonTxInvocationContext ctx = new NonTxInvocationContext(keyCount, true, keyEq); return ctx; } return createInvocationContext(null); }

Target:
public InvocationContext createInvocationContext(boolean isWrite, int keyCount) { if (keyCount == 1) { return new SingleKeyNonTxInvocationContext(true, keyEq); } else if (keyCount > 0) { return new NonTxInvocationContext(keyCount, true, keyEq); } return createInvocationContext(null); }
Source:
public void createTopicShouldNotPassAndMustShowTopicErrorIfItIsInvalid() throws NotFoundException { BindingResult result = mock(BindingResult.class); when(result.hasErrors()).thenReturn(true); when(branchService.get(BRANCH_ID)).thenReturn(branch); List<Breadcrumb> breadcrumbs = new BreadcrumbBuilder().getNewTopicBreadcrumb(branch); when(breadcrumbBuilder.getNewTopicBreadcrumb(branch)).thenReturn(breadcrumbs); ModelAndView mav = controller.createTopic(getDto(), result, BRANCH_ID); verify(branchService).get(BRANCH_ID); verify(breadcrumbBuilder).getNewTopicBreadcrumb(branch); List<Breadcrumb> breadcrumbsFromModel = (List) mav.getModel().get("breadcrumbList"); for (int i = 0; i < breadcrumbs.size(); i++) { assertEquals(breadcrumbs.get(i).getValue(), breadcrumbsFromModel.get(i).getValue()); if(i == 1) assertEquals(breadcrumbsFromModel.get(1).getValue(), branch.getSection().getName()); if(i == 2) assertEquals(breadcrumbsFromModel.get(2).getValue(), branch.getName()); } assertViewName(mav, "topic/topicForm"); long branchId = assertAndReturnModelAttributeOfType(mav, "branchId", Long.class); assertEquals(branchId, BRANCH_ID); }

Target:
public void createTopicShouldNotPassAndMustShowTopicErrorIfItIsInvalid() throws NotFoundException { BindingResult result = mock(BindingResult.class); when(result.hasErrors()).thenReturn(true); when(branchService.get(BRANCH_ID)).thenReturn(branch); List<Breadcrumb> breadcrumbs = new BreadcrumbBuilder().getNewTopicBreadcrumb(branch); when(breadcrumbBuilder.getNewTopicBreadcrumb(branch)).thenReturn(breadcrumbs); ModelAndView mav = controller.createTopic(getDto(), result, BRANCH_ID); verify(branchService).get(BRANCH_ID); verify(breadcrumbBuilder).getNewTopicBreadcrumb(branch); List<Breadcrumb> breadcrumbsFromModel = (List) mav.getModel().get("breadcrumbList"); for (int i = 0; i < breadcrumbs.size(); i++) { assertEquals(breadcrumbs.get(i).getValue(), breadcrumbsFromModel.get(i).getValue()); } assertEquals(breadcrumbsFromModel.get(1).getValue(), branch.getSection().getName()); assertEquals(breadcrumbsFromModel.get(2).getValue(), branch.getName()); assertViewName(mav, "topic/topicForm"); long branchId = assertAndReturnModelAttributeOfType(mav, "branchId", Long.class); assertEquals(branchId, BRANCH_ID); }
Source:
private ReplicationSpec getNewEventOnlyReplicationSpec(Long eventId) throws SemanticException { ReplicationSpec rspec = getNewReplicationSpec(eventId.toString(), eventId.toString()); rspec.setIsEventDump(true); return rspec; }

Target:
private ReplicationSpec getNewEventOnlyReplicationSpec(Long eventId) throws SemanticException { ReplicationSpec rspec = getNewReplicationSpec(eventId.toString(), eventId.toString()); rspec.setIsIncrementalDump(true); return rspec; }
Source:
public void testConfiguration(String username, String password, LdapConfiguration configuration) throws IOException { authenticationItemConfigurationManager.testCustomAuthenticationItem(configuration, this, (c) -> { LdapUserDetailsService luds = (LdapUserDetailsService) c.getBean("ldapUserDetailsService"); UserDetails user = luds.loadUserByUsername(username); if (!PasswordEncoderFactories.createDelegatingPasswordEncoder().matches(password, user.getPassword())) { throw new BadCredentialsException("Credentials don't match."); } return false; }); }

Target:
public void testConfiguration(String username, String password, LdapConfiguration configuration) throws IOException { authenticationItemConfigurationManager.testCustomAuthenticationItem(configuration, this, (c) -> { LdapUserDetailsService luds = (LdapUserDetailsService) c.getBean("ldapUserDetailsService"); UserDetails user = luds.loadUserByUsername(username); if (!passwordEncoder.matches(password, user.getPassword())) { throw new BadCredentialsException("Credentials don't match."); } return false; }); }
Source:
protected HttpResponse post(String url) { if (!url.startsWith("http")) { url = getFullUrl(url); } HttpResponse response = null; try { Request request = Request.Post(url); if (session != null && session.isSignedIn()) { request.setHeader(BRIDGE_SESSION_HEADER, session.getSessionToken()); } logger.debug("POST " + url + "\n <EMPTY>"); response = exec.execute(request).returnResponse(); throwExceptionOnErrorStatus(response, url); } catch (ClientProtocolException e) { throw new BridgeServerException(CONNECTION_FAILED, e, url); } catch (IOException e) { throw new BridgeServerException(CONNECTION_FAILED, e, url); } return response; }

Target:
protected HttpResponse post(String url) { url = getFullUrl(url); HttpResponse response = null; try { Request request = Request.Post(url); if (session != null && session.isSignedIn()) { request.setHeader(BRIDGE_SESSION_HEADER, session.getSessionToken()); } logger.debug("POST " + url + "\n <EMPTY>"); response = exec.execute(request).returnResponse(); throwExceptionOnErrorStatus(response, url); } catch (ClientProtocolException e) { throw new BridgeServerException(CONNECTION_FAILED, e, url); } catch (IOException e) { throw new BridgeServerException(CONNECTION_FAILED, e, url); } return response; }
Source:
private void notifyPluginSettingsChange(PluginSettings pluginSettings) { String pluginId = pluginSettings.getPluginId(); for (GoPluginExtension extension : extensions) { if (extension.canHandlePlugin(pluginId)) { try { extension.notifyPluginSettingsChange(pluginId, pluginSettings.getSettingsMap()); break; } catch (Exception e) { LOGGER.warn("Error notifying plugin - with settings change", pluginId, e); } } } }

Target:
private void notifyPluginSettingsChange(PluginSettings pluginSettings) { String pluginId = pluginSettings.getPluginId(); for (GoPluginExtension extension : extensions) { if (extension.canHandlePlugin(pluginId)) { try { extension.notifyPluginSettingsChange(pluginId, pluginSettings.getSettingsAsKeyValuePair()); break; } catch (Exception e) { LOGGER.warn("Error notifying plugin - with settings change", pluginId, e); } } } }