auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void appendStatsField(StringBuilder rewrittenQueryBuilder, HiveConf conf, ColumnStatsField columnStatsField, ColumnStatsType columnStatsType, String columnName, int pos) throws SemanticException { switch (columnStatsField) { case COLUMN_TYPE: appendColumnType(rewrittenQueryBuilder, conf, columnStatsType, pos); break; case COUNT_TRUES: appendCountTrues(rewrittenQueryBuilder, conf, columnName, pos); break; case COUNT_FALSES: appendCountFalses(rewrittenQueryBuilder, conf, columnName, pos); break; case COUNT_NULLS: appendCountNulls(rewrittenQueryBuilder, conf, columnName, pos); break; case MIN: appendMin(rewrittenQueryBuilder, conf, columnStatsType, columnName, pos); break; case MAX: appendMax(rewrittenQueryBuilder, conf, columnStatsType, columnName, pos); break; case NDV: appendNDV(rewrittenQueryBuilder, conf, columnName, pos); break; case BITVECTOR: appendBitVector(rewrittenQueryBuilder, conf, columnName, pos); break; case MAX_LENGTH: appendMaxLength(rewrittenQueryBuilder, conf, columnName, pos); break; case AVG_LENGTH: appendAvgLength(rewrittenQueryBuilder, conf, columnName, pos); break; default: throw new SemanticException("Not supported field " + columnStatsField); } }

Target:
private static void appendStatsField(StringBuilder rewrittenQueryBuilder, HiveConf conf, ColumnStatsField columnStatsField, ColumnStatsType columnStatsType, String columnName, int pos) throws SemanticException { switch (columnStatsField) { case COLUMN_STATS_TYPE: appendColumnType(rewrittenQueryBuilder, conf, columnStatsType, pos); break; case COUNT_TRUES: appendCountTrues(rewrittenQueryBuilder, conf, columnName, pos); break; case COUNT_FALSES: appendCountFalses(rewrittenQueryBuilder, conf, columnName, pos); break; case COUNT_NULLS: appendCountNulls(rewrittenQueryBuilder, conf, columnName, pos); break; case MIN: appendMin(rewrittenQueryBuilder, conf, columnStatsType, columnName, pos); break; case MAX: appendMax(rewrittenQueryBuilder, conf, columnStatsType, columnName, pos); break; case NDV: appendNDV(rewrittenQueryBuilder, conf, columnName, pos); break; case BITVECTOR: appendBitVector(rewrittenQueryBuilder, conf, columnName, pos); break; case MAX_LENGTH: appendMaxLength(rewrittenQueryBuilder, conf, columnName, pos); break; case AVG_LENGTH: appendAvgLength(rewrittenQueryBuilder, conf, columnName, pos); break; default: throw new SemanticException("Not supported field " + columnStatsField); } }
Source:
private void setItemEnabled(Menu menu, int menuId, boolean isEnabled, boolean isVisible) { final MenuItem item = menu.findItem(menuId); if (item == null || item.isEnabled() == isEnabled) return; item.setVisible(isVisible); item.setEnabled(isEnabled); if (item.getIcon() != null) { Drawable icon = item.getIcon().mutate(); icon.setAlpha(isEnabled ? 255 : 128); item.setIcon(icon); } }

Target:
private void setItemEnabled(Menu menu, int menuId, boolean isEnabled, boolean isVisible) { final MenuItem item = menu.findItem(menuId); if (item == null || (item.isEnabled() == isEnabled && item.isVisible() == isVisible)) return; item.setVisible(isVisible); item.setEnabled(isEnabled); if (item.getIcon() != null) { Drawable icon = item.getIcon().mutate(); icon.setAlpha(isEnabled ? 255 : 128); item.setIcon(icon); } }
Source:
public FunctionBlock(String name, Type type, CustomUIPane pane) { super(pane); this.name = new SimpleStringProperty(name); this.loadFXML("FunctionBlock"); ArrayList<String> args = new ArrayList<>(); Type t = type; while (t instanceof FuncT) { FuncT ft = (FuncT) t; args.add(ft.getArgs()[0].toHaskellType()); t = ft.getArgs()[1]; } List<Type> inputSignatures = new ArrayList<>(); Type functionSignature = getFunctionSignature(); for (int i = 0; i < args.size(); i++) { if (functionSignature instanceof FuncT) { Type inputSignature = BackendUtils.dive((FuncT) functionSignature, i + 1); inputSignatures.add(inputSignature); } else { throw new FunctionDefinitionException(); } } argumentSpace = new ArgumentSpace(this, inputSignatures); argumentSpace.setKnotIndex(getAllInputs().size()); ((Pane) this.lookup("#nestSpace")).getChildren().add(argumentSpace); argumentSpace.knotIndexProperty().addListener(e -> invalidateKnotIndex()); output = new OutputAnchor(this); output.layoutXProperty().bind(outputSpace.widthProperty().divide(2)); outputSpace.getChildren().add(output); Pane functionInfo = (Pane) this.lookup("#functionInfo"); this.prefWidthProperty().bind(functionInfo.widthProperty().add(argumentSpace.prefWidthProperty())); this.setMinSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); this.setMaxSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); functionInfo.setMinWidth(Region.USE_PREF_SIZE); functionInfo.setMaxWidth(Region.USE_PREF_SIZE); invalidateConnectionState(); }

Target:
public FunctionBlock(String name, Type type, CustomUIPane pane) { super(pane); this.name = new SimpleStringProperty(name); this.loadFXML("FunctionBlock"); ArrayList<String> args = new ArrayList<>(); Type t = type; while (t instanceof FuncT) { FuncT ft = (FuncT) t; args.add(ft.getArgs()[0].toHaskellType()); t = ft.getArgs()[1]; } List<Type> inputSignatures = new ArrayList<>(); Type functionSignature = getFunctionSignature(); for (int i = 0; i < args.size(); i++) { if (functionSignature instanceof FuncT) { Type inputSignature = BackendUtils.dive((FuncT) functionSignature, i + 1); inputSignatures.add(inputSignature); } else { throw new FunctionDefinitionException(); } } argumentSpace = new ArgumentSpace(this, inputSignatures); argumentSpace.setKnotIndex(getAllInputs().size()); nestSpace.getChildren().add(argumentSpace); argumentSpace.knotIndexProperty().addListener(e -> invalidateKnotIndex()); output = new OutputAnchor(this); outputSpace.setCenter(output); this.prefWidthProperty().bind(functionInfo.widthProperty().add(argumentSpace.prefWidthProperty())); this.setMinSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); this.setMaxSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); functionInfo.setMinWidth(Region.USE_PREF_SIZE); functionInfo.setMaxWidth(Region.USE_PREF_SIZE); invalidateConnectionState(); }
Source:
void setAndGetSessionState(MessagingEntityType entityType) { setSenderAndReceiver(entityType, 0, true); receiver = receiverMono.block(TIMEOUT); final byte[] sessionState = "Finished".getBytes(UTF_8); final String messageId = UUID.randomUUID().toString(); final ServiceBusMessage messageToSend = getMessage(messageId, true); sendMessage(messageToSend).block(Duration.ofSeconds(10)); AtomicReference<ServiceBusReceivedMessage> receivedMessage = new AtomicReference<>(); StepVerifier.create(receiver.receiveMessages() .take(1) .flatMap(message -> { logger.info("SessionId: {}. LockToken: {}. LockedUntil: {}. Message received.", message.getSessionId(), message.getLockToken(), message.getLockedUntil()); receivedMessage.set(message); return receiver.setSessionState(sessionState); })) .expectComplete() .verify(); StepVerifier.create(receiver.getSessionState()) .assertNext(state -> { logger.info("State received: {}", new String(state, UTF_8)); assertArrayEquals(sessionState, state); }) .verifyComplete(); receiver.complete(receivedMessage.get()).block(Duration.ofSeconds(15)); messagesPending.decrementAndGet(); }

Target:
void setAndGetSessionState(MessagingEntityType entityType) { setSenderAndReceiver(entityType, 0, true); final byte[] sessionState = "Finished".getBytes(UTF_8); final String messageId = UUID.randomUUID().toString(); final ServiceBusMessage messageToSend = getMessage(messageId, true); sendMessage(messageToSend).block(Duration.ofSeconds(10)); AtomicReference<ServiceBusReceivedMessage> receivedMessage = new AtomicReference<>(); StepVerifier.create(receiver.receiveMessages() .take(1) .flatMap(message -> { logger.info("SessionId: {}. LockToken: {}. LockedUntil: {}. Message received.", message.getSessionId(), message.getLockToken(), message.getLockedUntil()); receivedMessage.set(message); return receiver.setSessionState(sessionState); })) .expectComplete() .verify(); StepVerifier.create(receiver.getSessionState()) .assertNext(state -> { logger.info("State received: {}", new String(state, UTF_8)); assertArrayEquals(sessionState, state); }) .verifyComplete(); receiver.complete(receivedMessage.get()).block(Duration.ofSeconds(15)); messagesPending.decrementAndGet(); }
Source:
public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", mimeType, this::checkSecurityOr403); before("/*", mimeType, this::checkSecurityOr403); get("", mimeType, this::index); get(Routes.AgentsAPI.UUID, mimeType, this::show); patch(Routes.AgentsAPI.UUID, mimeType, this::update); patch("", mimeType, this::bulkUpdate); delete(Routes.AgentsAPI.UUID, mimeType, this::deleteAgent); delete("", mimeType, this::bulkDeleteAgents); exception(HttpException.class, this::httpException); }); }

Target:
public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", mimeType, this::checkSecurityOr403); before("/*", mimeType, this::checkSecurityOr403); get("", mimeType, this::index); get(Routes.AgentsAPI.UUID, mimeType, this::show); patch(Routes.AgentsAPI.UUID, mimeType, this::update); patch("", mimeType, this::bulkUpdate); delete(Routes.AgentsAPI.UUID, mimeType, this::deleteAgent); delete("", mimeType, this::bulkDeleteAgents); }); }
Source:
public String translate(final With with) { final List<ImmutablePair<Name, Expression>> withs = with.getWiths(); withs.forEach(aWith -> { injector.injectMembers(aWith.getLeft()); injector.injectMembers(aWith.getRight()); }); final String withStatements = withs.stream() .map(aWith -> aWith.getLeft().translate() + " AS (" + aWith.getRight().translate() + ")") .collect(Collectors.joining(", ")); final Expression then = with.getThen(); if (then != null) { inject(then); return String.format("WITH %s %s", withStatements, then.translate()); } else { return String.format("WITH %s", withStatements); } }

Target:
public String translate(final With with) { final List<ImmutablePair<Name, Expression>> clauses = with.getClauses(); clauses.forEach(clause -> { injector.injectMembers(clause.getLeft()); injector.injectMembers(clause.getRight()); }); final String withStatements = clauses.stream() .map(clause -> clause.getLeft().translate() + " AS (" + clause.getRight().translate() + ")") .collect(Collectors.joining(", ")); final Expression then = with.getThen(); if (then != null) { inject(then); return String.format("WITH %s %s", withStatements, then.translate()); } else { return String.format("WITH %s", withStatements); } }
Source:
public void jobsUpdated(Map<Integer, Job> jobs) { List<Integer> selectedJobsIds = this.controller.getModel().getSelectedJobsIds(); this.ds.invalidateCache(); RecordList data = new RecordList(); for (Job j : jobs.values()) { JobRecord jobRecord = new JobRecord(j); this.columnsFactory.buildRecord(j, jobRecord); data.add(jobRecord); if (selectedJobsIds != null && selectedJobsIds.contains(j.getId())) { jobRecord.setAttribute("isSelected", true); } } this.ds.setCacheData(data.toArray()); data.destroy(); applyCurrentLocalFilter(); if (!isJobFromUrlAutoSelected && selectJobIdFromUrl()) { isJobFromUrlAutoSelected = true; LogModel.getInstance().logImportantMessage("isJobFromUrlAutoSelected = false"); } }

Target:
public void jobsUpdated(Map<Integer, Job> jobs) { List<Integer> selectedJobsIds = this.controller.getModel().getSelectedJobsIds(); this.ds.invalidateCache(); RecordList data = new RecordList(); for (Job j : jobs.values()) { JobRecord jobRecord = new JobRecord(j); this.columnsFactory.buildRecord(j, jobRecord); data.add(jobRecord); if (selectedJobsIds != null && selectedJobsIds.contains(j.getId())) { jobRecord.setAttribute("isSelected", true); } } this.ds.setCacheData(data.toArray()); data.destroy(); applyCurrentLocalFilter(); if (!isJobFromUrlAutoSelected && selectJobIdFromUrl()) { isJobFromUrlAutoSelected = true; } }
Source:
public void testEncryptValidPassword( ) throws Exception { res = service.encrypt( "asdfghjkldieukancmvaiodfweewjrkwer" ); assertEquals( res, "YXNkZmdoamtsZGlldWthbmNtdmFpb2Rmd2Vld2pya3dlcg==" ); }

Target:
public void testEncryptValidPassword( ) throws Exception { String password = "asdfghjkldieukancmvaiodfweewjrkwer"; res = service.encrypt( password ); assertEquals( res, "YXNkZmdoamtsZGlldWthbmNtdmFpb2Rmd2Vld2pya3dlcg==" ); assertEquals( password, service.decrypt( res ) ); }
Source:
public void testIdField() throws Exception { AccessibleObject idField = entityBinding.getIdField(); assertEquals(idField.getName(), new ClassType(ParentClass.class).getDeclaredField("parentField").getName()); }

Target:
public void testIdField() throws Exception { AccessibleObject idField = entityBinding.getIdField(); assertEquals(idField, new ClassType(ParentClass.class).getDeclaredField("parentField")); }
Source:
public boolean login() throws LoginException { boolean isLoggedIn; String message = "Username [%s] could not log in successfully using LDAP authentication due to an exception"; try { isLoggedIn = doLogin(); if (!isLoggedIn) { SecurityLogger.audit("Username [" + user + "] failed LDAP authentication."); } return isLoggedIn; } catch (InvalidCharactersException e) { SecurityLogger.audit(e.getMessage()); throw new LoginException(String.format(message, user)); } catch (LoginException e) { throw new LoginException(String.format(message, user)); } }

Target:
public boolean login() throws LoginException { boolean isLoggedIn; try { isLoggedIn = doLogin(); if (!isLoggedIn) { SecurityLogger.audit("Username [" + user + "] failed LDAP authentication."); } return isLoggedIn; } catch (InvalidCharactersException e) { SecurityLogger.audit(e.getMessage()); throw new LoginException(String.format(LOGIN_ERROR_MESSAGE, user) + e.getMessage()); } catch (LoginException e) { throw new LoginException(String.format(LOGIN_ERROR_MESSAGE, user) + e.getMessage()); } }
Source:
public static void main(String[] args) { Options options = handleOptions(Options.class, args); String rcnamespace = options.itemNamespace() + "|" + options.propertyNamspace(); WikibaseRepository wikibaseRepository = new WikibaseRepository(options.wikibaseScheme(), options.wikibaseHost(), 0, rcnamespace); URI sparqlUri; try { sparqlUri = new URI(options.sparqlUrl()); } catch (URISyntaxException e) { log.error("Invalid url: " + options.sparqlUrl() + " caused by " + e.getMessage()); return; } WikibaseUris uris = new WikibaseUris(options.wikibaseHost()); RdfRepository rdfRepository = new RdfRepository(sparqlUri, uris); Change.Source<? extends Change.Batch> changeSource = buildChangeSource(options, rdfRepository, wikibaseRepository); if (changeSource == null) { return; } int threads = options.threadCount(); ThreadFactoryBuilder threadFactory = new ThreadFactoryBuilder().setDaemon(true).setNameFormat("update %s"); ExecutorService executor = new ThreadPoolExecutor(threads, threads, 0, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory.build()); Munger munger = mungerFromOptions(options); new Update<>(changeSource, wikibaseRepository, rdfRepository, munger, executor, options.pollDelay(), uris, options.verify()).run(); }

Target:
public static void main(String[] args) { Options options = handleOptions(Options.class, args); WikibaseRepository wikibaseRepository; if (options.entityNamespaces() == null) { wikibaseRepository = new WikibaseRepository(options.wikibaseScheme(), options.wikibaseHost()); } else { String[] entityNamespaces = options.entityNamespaces().split(","); wikibaseRepository = new WikibaseRepository(options.wikibaseScheme(), options.wikibaseHost(), 0, entityNamespaces); } URI sparqlUri; try { sparqlUri = new URI(options.sparqlUrl()); } catch (URISyntaxException e) { log.error("Invalid url: " + options.sparqlUrl() + " caused by " + e.getMessage()); return; } WikibaseUris uris = new WikibaseUris(options.wikibaseHost()); RdfRepository rdfRepository = new RdfRepository(sparqlUri, uris); Change.Source<? extends Change.Batch> changeSource = buildChangeSource(options, rdfRepository, wikibaseRepository); if (changeSource == null) { return; } int threads = options.threadCount(); ThreadFactoryBuilder threadFactory = new ThreadFactoryBuilder().setDaemon(true).setNameFormat("update %s"); ExecutorService executor = new ThreadPoolExecutor(threads, threads, 0, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory.build()); Munger munger = mungerFromOptions(options); new Update<>(changeSource, wikibaseRepository, rdfRepository, munger, executor, options.pollDelay(), uris, options.verify()).run(); }
Source:
private static String getRelativeImportPathFromLine(String line, String workingDirectoryForFile) { String importPath = StringUtils.substringBetween(line, "'", "'"); importPath = importPath.replaceFirst(workingDirectoryForFile, ""); importPath = importPath.replaceFirst("^[.]/", ""); importPath = importPath.replaceFirst("^/", ""); if (!importPath.endsWith(".nf")) { importPath = importPath + ".nf"; } return importPath; }

Target:
protected static String getRelativeImportPathFromLine(String line, String workingDirectoryForFile) { final String nextflowFileExtension = ".nf"; String importPath = StringUtils.substringBetween(line, "'", "'"); importPath = importPath.replaceFirst(workingDirectoryForFile, ""); importPath = importPath.replaceFirst("^[.]/", ""); importPath = importPath.replaceFirst("^/", ""); if (!importPath.endsWith(nextflowFileExtension)) { importPath = importPath + nextflowFileExtension; } return importPath; }
Source:
private void checkContextInRightPlace(DetailAST methodDefToken) { final DetailAST parametersToken = methodDefToken.findFirstToken(TokenTypes.PARAMETERS); final String returnType = getReturnType(methodDefToken.findFirstToken(TokenTypes.TYPE), new StringBuilder()).toString(); final boolean containsTypeParameter = TokenUtil.findFirstTokenByPredicate(parametersToken, parameterToken -> parameterToken.getType() == TokenTypes.PARAMETER_DEF && parameterToken.findFirstToken(TokenTypes.TYPE).findFirstToken(TokenTypes.IDENT) != null && parameterToken.findFirstToken(TokenTypes.TYPE).findFirstToken(TokenTypes.IDENT) .getText().equals(CONTEXT)) .isPresent(); if (containsTypeParameter) { if (returnType.startsWith(MONO_BRACKET) || returnType.startsWith(PAGED_FLUX_BRACKET)) { log(methodDefToken, String.format(ASYNC_CONTEXT_ERROR, CONTEXT)); } } else { if (returnType.startsWith(RESPONSE_BRACKET) || returnType.startsWith(PAGED_ITERABLE_BRACKET)) { log(methodDefToken, String.format(SYNC_CONTEXT_ERROR, CONTEXT)); } } }

Target:
private void checkContextInRightPlace(DetailAST methodDefToken) { final DetailAST parametersToken = methodDefToken.findFirstToken(TokenTypes.PARAMETERS); final String returnType = getReturnType(methodDefToken.findFirstToken(TokenTypes.TYPE), new StringBuilder()).toString(); final boolean containsContextParameter = TokenUtil.findFirstTokenByPredicate(parametersToken, parameterToken -> { if (parameterToken.getType() != TokenTypes.PARAMETER_DEF) { return false; } final DetailAST paramTypeIdentToken = parameterToken.findFirstToken(TokenTypes.TYPE).findFirstToken(TokenTypes.IDENT); return paramTypeIdentToken != null && CONTEXT.equals(paramTypeIdentToken.getText()); }) .isPresent(); if (containsContextParameter) { if (returnType.startsWith(MONO_BRACKET) || returnType.startsWith(PAGED_FLUX_BRACKET)) { log(methodDefToken, String.format(ASYNC_CONTEXT_ERROR, CONTEXT)); } } else { if (returnType.startsWith(RESPONSE_BRACKET)) { log(methodDefToken, String.format(SYNC_CONTEXT_ERROR, CONTEXT)); } } }
Source:
public void display(OutputStream out) { final PrintWriter stdout; try { stdout = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out, "UTF-8"))); } catch (UnsupportedEncodingException e) { throw new RuntimeException("JVM lacks UTF-8 encoding", e); } Map<String, PluginInfo> output = Maps.newTreeMap(); List<Plugin> plugins = Lists.newArrayList(pluginLoader.getPlugins(all)); Collections.sort(plugins, new Comparator<Plugin>() { @Override public int compare(Plugin a, Plugin b) { return a.getName().compareTo(b.getName()); } }); if (!format.isJson()) { stdout.format("%-30s %-10s %-8s\n", "Name", "Version", "Status"); stdout .print("-------------------------------------------------------------------------------\n"); } for (Plugin p : plugins) { PluginInfo info = new PluginInfo(); info.version = p.getVersion(); info.disabled = p.isDisabled(); if (format.isJson()) { output.put(p.getName(), info); } else { stdout.format("%-30s %-10s %-8s\n", p.getName(), Strings.nullToEmpty(info.version), info.disabled ? "DISABLED" : ""); } } if (format.isJson()) { format.newGson().toJson(output, new TypeToken<Map<String, PluginInfo>>() {}.getType(), stdout); stdout.print('\n'); } stdout.flush(); }

Target:
public void display(OutputStream out) { final PrintWriter stdout; try { stdout = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out, "UTF-8"))); } catch (UnsupportedEncodingException e) { throw new RuntimeException("JVM lacks UTF-8 encoding", e); } Map<String, PluginInfo> output = Maps.newTreeMap(); List<Plugin> plugins = Lists.newArrayList(pluginLoader.getPlugins(all)); Collections.sort(plugins, new Comparator<Plugin>() { @Override public int compare(Plugin a, Plugin b) { return a.getName().compareTo(b.getName()); } }); if (!format.isJson()) { stdout.format("%-30s %-10s %-8s\n", "Name", "Version", "Status"); stdout .print("-------------------------------------------------------------------------------\n"); } for (Plugin p : plugins) { PluginInfo info = new PluginInfo(); info.version = p.getVersion(); info.disabled = p.isDisabled() ? true : null; if (format.isJson()) { output.put(p.getName(), info); } else { stdout.format("%-30s %-10s %-8s\n", p.getName(), Strings.nullToEmpty(info.version), p.isDisabled() ? "DISABLED" : ""); } } if (format.isJson()) { format.newGson().toJson(output, new TypeToken<Map<String, PluginInfo>>() {}.getType(), stdout); stdout.print('\n'); } stdout.flush(); }
Source:
public T call() throws Exception { long delay = min; int retry = 0; int logCounter = 0; while (true) { try { return retriableCall(); } catch (CancellationException e) { throw e; } catch (Exception e) { retry++; if (delay < max && retry <= maxRetries) { delay *= 2; logger.error(String.format("Retry #%d for: %s",retry, ExceptionUtils.getFullStackTrace(e))); if(++logCounter == 1) logger.info("Exception --> "+ExceptionUtils.getFullStackTrace(e)); sleeper.sleep(delay); } else if(delay >= max && retry <= maxRetries) { logger.error(String.format("Retry #%d for: %s",retry, ExceptionUtils.getFullStackTrace(e))); sleeper.sleep(max); } else { throw e; } } finally { forEachExecution(); } } }

Target:
public T call() throws Exception { long delay = min; int retry = 0; int logCounter = 0; while (true) { try { return retriableCall(); } catch (CancellationException e) { throw e; } catch (Exception e) { retry++; if (delay < max && retry <= maxRetries) { delay *= 2; logger.error(String.format("Retry #%d for: %s",retry, e.getMessage())); if(++logCounter == 1) logger.info("Exception --> "+ExceptionUtils.getFullStackTrace(e)); sleeper.sleep(delay); } else if(delay >= max && retry <= maxRetries) { logger.error(String.format("Retry #%d for: %s",retry, ExceptionUtils.getFullStackTrace(e))); sleeper.sleep(max); } else { throw e; } } finally { forEachExecution(); } } }
Source:
public Object[][] createNonTiling() { if (percentageOfTilingTests == 0) { return new Object[][] {{0, false, false, 0, 0, null, 0}}; } int[] tileSizes = {PLANE_WIDTH}; int[] channelCounts = {1, 3}; int[] seriesCounts = {1}; int[] timeCounts = {1, 5}; String[] compressions = {COMPRESSION_UNCOMPRESSED, COMPRESSION_LZW, COMPRESSION_J2K, COMPRESSION_J2K_LOSSY, COMPRESSION_JPEG}; return getData(tileSizes, channelCounts, seriesCounts, timeCounts, compressions); }

Target:
public Object[][] createNonTiling() { if (percentageOfTilingTests == 0) { return new Object[][] {{0, false, false, 0, 0, 0, null, 0}}; } int[] tileSizes = {PLANE_WIDTH}; int[] channelCounts = {1, 3}; int[] seriesCounts = {1}; int[] timeCounts = {1, 5}; String[] compressions = {COMPRESSION_UNCOMPRESSED, COMPRESSION_LZW, COMPRESSION_J2K, COMPRESSION_J2K_LOSSY, COMPRESSION_JPEG}; return getData(tileSizes, channelCounts, seriesCounts, timeCounts, compressions); }
Source:
public Map<String, SystemAdmin> getSystemAdmins() { if (systemAdminMap.isEmpty()) { systemAdminMap = getSystemFactories().entrySet() .stream() .collect(Collectors.toMap(Entry::getKey, systemNameToFactoryEntry -> systemNameToFactoryEntry.getValue() .getAdmin(systemNameToFactoryEntry.getKey(), this, adminLabel))); } return systemAdminMap; }

Target:
public Map<String, SystemAdmin> getSystemAdmins() { return getSystemAdmins(""); }
Source:
public void testReadingValidLongDate() { String jsonString = "{\"currentDate\": 1546344000000}"; GsonTypeAdaptersTestPojo parsedDate = gson.fromJson(jsonString, GsonTypeAdaptersTestPojo.class); assertThat(parsedDate.currentDate.toString(), equalTo("Tue Jan 01 07:00:00 EST 2019")); }

Target:
public void testReadingValidLongDate() { String jsonString = "{\"currentDate\": 1546326000000}"; GsonTypeAdaptersTestPojo parsedDate = gson.fromJson(jsonString, GsonTypeAdaptersTestPojo.class); Instant parsedInstant = parsedDate.currentDate.toInstant().atOffset(ZoneOffset.UTC).toInstant(); assertThat(parsedInstant.toEpochMilli(), equalTo(1546326000000L)); }
Source:
public static void assertContainerRam(Set<PackingPlan.ContainerPlan> containerPlans, long maxRamforResources) { for (PackingPlan.ContainerPlan containerPlan : containerPlans) { Assert.assertTrue("Container with id: " + containerPlan.getId() + " requires more RAM " + "(" + containerPlan.getRequiredResource().getRam() + ")" + " than the maximimum allowed" + "(" + maxRamforResources + ")", containerPlan.getRequiredResource().getRam() <= maxRamforResources); } }

Target:
public static void assertContainerRam(Set<PackingPlan.ContainerPlan> containerPlans, long maxRamforResources) { for (PackingPlan.ContainerPlan containerPlan : containerPlans) { Assert.assertTrue(String.format("Container with id: %d requires more RAM (%d) than" + " the maximum RAM allowed (%d)", containerPlan.getId(), containerPlan.getRequiredResource().getRam(), maxRamforResources), containerPlan.getRequiredResource().getRam() <= maxRamforResources); } }
Source:
public void copyPersistedState(String destinationDir, @Nullable String destinationLocation, @Nullable CompoundTransformer transformer) { initManagementContext(); try { highAvailabilityMode = HighAvailabilityMode.HOT_STANDBY; initPersistence(); } catch (Exception e) { handleSubsystemStartupError(ignorePersistenceErrors, "persistence", e); } ManagementPlaneSyncRecord planeState = managementContext.getHighAvailabilityManager().getManagementPlaneSyncState(); BrooklynMementoRawData memento = retrieveState(false); BrooklynMementoRawData newMemento = memento; if (transformer != null) { try { newMemento = transformer.transform(memento); } catch (Exception e) { throw Throwables.propagate(e); } } copyPersistedState(newMemento, planeState, destinationDir, destinationLocation); }

Target:
public void copyPersistedState(String destinationDir, @Nullable String destinationLocation, @Nullable CompoundTransformer transformer) { initManagementContext(); try { highAvailabilityMode = HighAvailabilityMode.HOT_STANDBY; initPersistence(); } catch (Exception e) { handleSubsystemStartupError(ignorePersistenceErrors, "persistence", e); } ManagementPlaneSyncRecord planeState = managementContext.getHighAvailabilityManager().getManagementPlaneSyncState(); BrooklynMementoRawData memento = retrieveState(false); BrooklynMementoRawData newMemento = memento; if (transformer != null) { try { newMemento = transformer.transform(memento); } catch (Exception e) { throw Exceptions.propagate(e); } } copyPersistedState(newMemento, planeState, destinationDir, destinationLocation); }
Source:
public void showNoRepositorySelectedPleaseSelectARepository() { }

Target:
public void showNoRepositorySelectedPleaseSelectARepository() { ErrorPopup.showMessage( ProjectEditorResources.CONSTANTS.NoRepositorySelectedPleaseSelectARepository() ); }
Source:
<RequestT extends StorageRequest<?>> RequestT initializeRequest( RequestT request, String bucketName) throws IOException { if (authorizationHandler.isAuthorizationHandlerSet()) { logger.atFine().log( "initializeRequest(%s, %s) calling authorization handler.", request, bucketName); authorizationHandler.authorize(request, bucketName); } return configureRequest(request, bucketName); }

Target:
<RequestT extends StorageRequest<?>> RequestT initializeRequest( RequestT request, String bucketName) throws IOException { if (storageRequestAuthorizer != null) { logger.atFine().log( "initializeRequest(%s, %s) calling authorization handler.", request, bucketName); storageRequestAuthorizer.authorize(request, bucketName); } return configureRequest(request, bucketName); }
Source:
public Object start(IApplicationContext context) throws Exception { cleanWS(); ArgumentsParser myRunnerArguments = new ArgumentsParser(context); Generator generator = new Generator(myRunnerArguments); generator.generate(); IStatus status = generator.getStatus(); if (status != null && !status.isOK()) { throw new RuntimeException("Generation faild:" + status.getMessage()); } return IApplicationContext.EXIT_ASYNC_RESULT; }

Target:
public Object start(IApplicationContext context) throws Exception { myWorkspaceHelper = new WorkspaceHelper(); ArgumentsParser runnerArguments = null; try { runnerArguments = new ArgumentsParser(context); List<String> projectsToImport = new LinkedList<String>(runnerArguments.getRelatedProjects()); projectsToImport.add(runnerArguments.getGMFGENProjectLocation()); initWorkspace(projectsToImport); GenEditorGenerator editorGen = GMFGeneratorUtil.loadEditorGen(runnerArguments.getGMFGENProjectLocation(), runnerArguments.getGMFGENResourceLocation()); initPluginProject(runnerArguments.getGenerateProjectLocation(), editorGen.getPluginDirectory()); CodegenEmittersWithXtend2 emitters = getCodegenEmitters(editorGen, runnerArguments.getCustomEmitterBundleName(), runnerArguments.getCustomEmitterClassName()); GeneratorBase generator = new GeneratorWithXtend2(editorGen, emitters, loadFormatter(runnerArguments.getFormatter())); generator.run(new NullProgressMonitor()); } catch (Exception e) { if (runnerArguments != null && runnerArguments.shouldTrace()) { e.printStackTrace(); } throw new RuntimeException("Generation faild", e); } return IApplicationContext.EXIT_ASYNC_RESULT; }
Source:
public static boolean isQuoted(final String name, final Dialect dialect) { if ( name == null || name.isEmpty() ) { return false; } final char first = name.charAt( 0 ); final char last = name.charAt( name.length() - 1 ); return ( ( first == last ) && ( first == '`' || first == '"' || first == dialect.closeQuote() ) ); }

Target:
public static boolean isQuoted(final String name, final Dialect dialect) { if ( name == null || name.isEmpty() ) { return false; } final char first = name.charAt( 0 ); final char last = name.charAt( name.length() - 1 ); return ( ( first == last ) && ( first == '`' || first == '"' ) ) || ( first == dialect.openQuote() && last == dialect.closeQuote() ); }
Source:
public ObjectSpecification getExternalDownloadSpecification(String objectId, long offset, long length) throws IOException { log.debug("Endpoint: {}", endpoint); return retry.execute(new RetryCallback<ObjectSpecification, IOException>() { @Override public ObjectSpecification doWithRetry(RetryContext ctx) throws IOException { HttpEntity<Object> requestEntity = new HttpEntity<Object>(defaultHeaders()); return serviceRequest.exchange( endpoint + "/download/{object-id}?offset={offset}&length={length}&external=1", HttpMethod.GET, requestEntity, ObjectSpecification.class, objectId, offset, length).getBody(); } }); }

Target:
public ObjectSpecification getExternalDownloadSpecification(String objectId, long offset, long length) throws IOException { log.debug("Endpoint: {}", endpoint); return retry.execute(new RetryCallback<ObjectSpecification, IOException>() { @Override public ObjectSpecification doWithRetry(RetryContext ctx) throws IOException { val requestEntity = new HttpEntity<Object>(defaultHeaders()); return serviceRequest.exchange( endpoint + "/download/{object-id}?offset={offset}&length={length}&external=true", HttpMethod.GET, requestEntity, ObjectSpecification.class, objectId, offset, length).getBody(); } }); }
Source:
public void testGetClustersHavingHosts() { List<VDSGroup> vdsGroups = ((VdsGroupDAODbFacadeImpl) dao).getClustersHavingHosts(); assertNotNull(vdsGroups); assertEquals(4, vdsGroups.size()); }

Target:
public void testGetClustersHavingHosts() { List<VDSGroup> clusters = ((VdsGroupDAODbFacadeImpl) dao).getClustersHavingHosts(); assertNotNull(clusters); assertThat(clusters, hasSize(4)); }
Source:
private static Map<String, ApiTemplate> loadJSONConfig(JsonNode node) { Preconditions.checkNotNull(node, "Must have services node"); final Map<String, ApiTemplate> config = new HashMap<>(); node.fieldNames().forEachRemaining(serviceName -> { config.put(serviceName, ApiTemplate.fromJSON(node.get(serviceName))); }); return config; }

Target:
private static Map<String, ApiTemplate> loadJSONConfig(JsonNode node) { Preconditions.checkNotNull(node, "Must have services node"); return Streams.stream(node.fieldNames()) .collect(ImmutableMap.toImmutableMap( fieldName -> fieldName, fieldName -> ApiTemplate.fromJSON(node.get(fieldName)))); }
Source:
private void refreshVdsRunTimeInfo() { boolean isVdsUpOrGoingToMaintenance = _vds.getStatus() == VDSStatus.Up || _vds.getStatus() == VDSStatus.PreparingForMaintenance || _vds.getStatus() == VDSStatus.Error || _vds.getStatus() == VDSStatus.NonOperational; try { if (isVdsUpOrGoingToMaintenance) { if (_vdsManager.getRefreshStatistics() || _vds.getStatus() == VDSStatus.PreparingForMaintenance) { refreshVdsStats(); } else { } } else { final AtomicBoolean processHardwareNeededAtomic = new AtomicBoolean(); VDSStatus refreshReturnStatus = _vdsManager.refreshCapabilities(processHardwareNeededAtomic, _vds); processHardwareCapsNeeded = processHardwareNeededAtomic.get(); refreshedCapabilities = true; if (refreshReturnStatus != VDSStatus.NonOperational) { _vdsManager.setStatus(VDSStatus.Up, _vds); } _saveVdsDynamic = true; } beforeFirstRefreshTreatment(isVdsUpOrGoingToMaintenance); refreshVmStats(); } catch (VDSRecoveringException e) { if (_vds.getStatus() != VDSStatus.PreparingForMaintenance) { throw e; } } catch (ClassCastException cce) { log.error("Failure to refresh Vds runtime info. Incorrect vdsm version for cluster", cce); if (_vds.getStatus() != VDSStatus.PreparingForMaintenance && _vds.getStatus() != VDSStatus.Maintenance) { _vds.setStatus(VDSStatus.Error); _saveVdsDynamic = true; } } catch (Throwable t) { log.error("Failure to refresh Vds runtime info", t); throw t; } moveVDSToMaintenanceIfNeeded(); }

Target:
private void refreshVdsRunTimeInfo() { boolean isVdsUpOrGoingToMaintenance = _vds.getStatus() == VDSStatus.Up || _vds.getStatus() == VDSStatus.PreparingForMaintenance || _vds.getStatus() == VDSStatus.Error || _vds.getStatus() == VDSStatus.NonOperational; try { if (isVdsUpOrGoingToMaintenance) { if (_vdsManager.getRefreshStatistics() || _vds.getStatus() == VDSStatus.PreparingForMaintenance) { refreshVdsStats(); } else { } } else { final AtomicBoolean processHardwareNeededAtomic = new AtomicBoolean(); VDSStatus refreshReturnStatus = _vdsManager.refreshCapabilities(processHardwareNeededAtomic, _vds); processHardwareCapsNeeded = processHardwareNeededAtomic.get(); refreshedCapabilities = true; if (refreshReturnStatus != VDSStatus.NonOperational) { _vdsManager.setStatus(VDSStatus.Up, _vds); } _saveVdsDynamic = true; } beforeFirstRefreshTreatment(isVdsUpOrGoingToMaintenance); refreshVmStats(); } catch (VDSRecoveringException e) { if (_vds.getStatus() != VDSStatus.PreparingForMaintenance) { throw e; } } catch (ClassCastException cce) { log.error(String.format("Failure to refresh Vds %s runtime info. Incorrect vdsm version for cluster %s", _vds.getName(), _vds.getVdsGroupName()), cce); if (_vds.getStatus() != VDSStatus.PreparingForMaintenance && _vds.getStatus() != VDSStatus.Maintenance) { ResourceManager.getInstance().runVdsCommand(VDSCommandType.SetVdsStatus, new SetVdsStatusVDSCommandParameters(_vds.getId(), VDSStatus.Error)); } } catch (Throwable t) { log.error("Failure to refresh Vds runtime info", t); throw t; } moveVDSToMaintenanceIfNeeded(); }
Source:
public void deployJarsFrowWar() throws Exception { RepositorySystemSession session = newSession(newRepositorySystem()); assertThat(checksIfArtifactIsPresent(session)).isFalse(); File file = new File("target/test-classes/org/guvnor/m2repo/backend/server/uberfire-m2repo-editor-backend-100-SNAPSHOT.jar"); assertThat(file).exists(); M2ServletContextListener listener = new M2ServletContextListener(); GAV deployed = listener.deployJar(file.getAbsolutePath(), session); assertThat(deployed.getGroupId()).isEqualTo("org.uberfire"); assertThat(deployed.getArtifactId()).isEqualTo("uberfire-m2repo-editor-backend"); assertThat(deployed.getVersion()).isEqualTo("100-SNAPSHOT"); ArtifactRequest artifactRequest = new ArtifactRequest(); artifactRequest.setArtifact(getArtifact()); ArtifactResult result = Aether.getAether().getSystem().resolveArtifact(session, artifactRequest); assertThat(result.isMissing()).isFalse(); assertThat(result.isResolved()).isTrue(); }

Target:
public void deployJarsFrowWar() throws Exception { RepositorySystemSession session = newSession(newRepositorySystem()); assertThat(checksIfArtifactIsPresent(session)).isFalse(); File file = new File("target/test-classes/org/guvnor/m2repo/backend/server/uberfire-m2repo-editor-backend-100-SNAPSHOT.jar"); assertThat(file).exists(); M2ServletContextListener listener = new M2ServletContextListener(); GAV deployed = listener.deployJar(file.getAbsolutePath(), session); assertThat(deployed.getGroupId()).isEqualTo("org.uberfire"); assertThat(deployed.getArtifactId()).isEqualTo("uberfire-m2repo-editor-backend"); assertThat(deployed.getVersion()).isEqualTo("100-SNAPSHOT"); ArtifactRequest artifactRequest = new ArtifactRequest(); artifactRequest.setArtifact(getArtifact()); ArtifactResult result = Aether.getAether().getSystem().resolveArtifact(session, artifactRequest); assertThat(result.isMissing()).isFalse(); assertThat(result.isResolved()).isTrue(); String absolutePath = result.getArtifact().getFile().toString(); String folder = absolutePath.substring(0, absolutePath.lastIndexOf(File.separator)); File remoteRepos = new File(folder + File.separator + "_remote.repositories"); assertThat(remoteRepos.exists()).isTrue(); File metadata = new File(folder + File.separator + "maven-metadata-local.xml"); assertThat(metadata.exists()).isTrue(); File pom = new File(folder + File.separator + "uberfire-m2repo-editor-backend-100-SNAPSHOT.pom"); assertThat(pom.exists()).isTrue(); }
Source:
default int getCharge(@Nonnull Location l) { Validate.notNull(l, "Location was null!"); if (!isChargeable()) return 0; String charge = BlockStorage.getLocationInfo(l, "energy-charge"); if (charge != null) { return Integer.parseInt(charge); } else { return 0; } }

Target:
default int getCharge(@Nonnull Location l) { Validate.notNull(l, "Location was null!"); if (!isChargeable()) { return 0; } String charge = BlockStorage.getLocationInfo(l, "energy-charge"); if (charge != null) { return Integer.parseInt(charge); } else { return 0; } }
Source:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case MENU_SORT: createSortMenu(); return true; case MENU_MAP: try { Class.forName("com.google.android.maps.MapActivity"); } catch (Throwable e1) { Logger.log(AndroidLogger.TYPE_ERROR_CONFIG_STRUCTURE, "Could not load maps: " + e1); Toast noMaps = Toast.makeText(EntitySelectActivity.this, "Google Maps aren't available on this device. Please contact technical support for more information.", Toast.LENGTH_LONG); noMaps.show(); return true; } Intent i = new Intent(this, EntityMapActivity.class); this.startActivityForResult(i, MAP_SELECT); return true; case MENU_ACTION: triggerDetailAction(); return true; } return super.onOptionsItemSelected(item); }

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case MENU_SORT: createSortMenu(); return true; case MENU_MAP: Intent i = new Intent(this, EntityMapActivity.class); this.startActivityForResult(i, MAP_SELECT); return true; case MENU_ACTION: triggerDetailAction(); return true; } return super.onOptionsItemSelected(item); }
Source:
public void setUp() throws Exception { harness = GerritFixture.forVersion(2, 12).harness(); client = harness.client(); }

Target:
public void setUp() throws Exception { harness = GerritFixture.current().harness(); client = harness.client(); }
Source:
private void throwDice(GameBean game) { Integer diceFirstValue = randomUtil.pullRandomDiceNumber(new ArrayList<Integer>(asList(1, 2, 3, 4, 5, 6))); Integer diceSecondValue = randomUtil.pullRandomDiceNumber(new ArrayList<Integer>(asList(1, 2, 3, 4, 5, 6))); game.setDiceFirstValue(diceFirstValue); game.setDiceSecondValue(diceSecondValue); game.setDiceThrown(true); if (diceFirstValue + diceSecondValue != 7) { mainStageUtil.distributeResources(game); } }

Target:
private void throwDice(GameBean game) { Integer diceFirstValue = randomUtil.getRandomDiceNumber(); Integer diceSecondValue = randomUtil.getRandomDiceNumber(); log.info("First dice: " + diceFirstValue); log.info("Second dice: " + diceSecondValue); game.setDiceFirstValue(diceFirstValue); game.setDiceSecondValue(diceSecondValue); game.setDiceThrown(true); if (!isRobbersActivity(diceFirstValue, diceSecondValue)) { List<HexBean> hexesWithCurrentDiceValue = game.fetchHexesWithCurrentDiceValue(); log.debug("Hexes with current dice value:" + hexesWithCurrentDiceValue); mainStageUtil.produceResourcesFromActiveDiceHexes(hexesWithCurrentDiceValue); } else{ log.debug("Robbers activity due to dice value 7"); } }
Source:
public String toString() { return "ChePlugin{" + "editors=" + editors + "} " + super.toString(); }

Target:
public String toString() { return "ChePlugin{" + "name='" + getName() + '\'' + ", id='" + getId() + '\'' + ", version='" + getVersion() + '\'' + ", containers=" + getContainers() + ", endpoints=" + getEndpoints() + ", editors=" + getEditors() + '}'; }
Source:
private String readRequestToString(InputStream inputStream) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); StringWriter writer = new StringWriter(); String line; while ((line = bufferedReader.readLine()) != null) { if (line.isEmpty()) { break; } writer.write(line); writer.write('\n'); } return writer.toString(); }

Target:
private String readRequestToString(InputStream inputStream) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); StringWriter writer = new StringWriter(); String line = null; while ((line = bufferedReader.readLine()) != null) { if (line.isEmpty()) { break; } writer.write(line); writer.write('\n'); } return writer.toString(); }
Source:
public RequiredData2014Reviewer(ErrorMessageUtil msgUtil, CertificationResultRules certRules) { super(msgUtil, certRules); this.msgUtil = msgUtil; this.certRules = certRules; }

Target:
public RequiredData2014Reviewer(ErrorMessageUtil msgUtil, CertificationResultRules certRules) { super(msgUtil, certRules); }
Source:
public void completed(final Exchange exchange) { if (exchange.getOrigin() == Origin.LOCAL) { Request originRequest = exchange.getCurrentRequest(); if (!originRequest.hasMID()) { } else { KeyMID idByMID = KeyMID.fromOutboundMessage(exchange.getCurrentRequest()); exchangeStore.remove(idByMID); } KeyToken idByToken = KeyToken.fromOutboundMessage(originRequest); exchangeStore.remove(idByToken); if(!exchange.getCurrentRequest().getOptions().hasObserve()) { exchangeStore.releaseToken(idByToken); } LOGGER.log(Level.FINER, "Exchange [{0}, {1}] completed", new Object[]{idByToken, exchange.getOrigin()}); } else { Response response = exchange.getCurrentResponse(); Request request = exchange.getCurrentRequest(); if (response != null && response.getType() != Type.ACK) { KeyMID midKey = KeyMID.fromOutboundMessage(response); exchangeStore.remove(midKey); LOGGER.log(Level.FINER, "Exchange [{0}, {1}] completed", new Object[]{midKey, exchange.getOrigin()}); } ObserveRelation relation = exchange.getRelation(); if (relation != null) { removeNotificationsOf(relation); } } }

Target:
public void completed(final Exchange exchange) { if (exchange.getOrigin() == Origin.LOCAL) { Request originRequest = exchange.getCurrentRequest(); if (!originRequest.hasMID()) { } else { KeyMID idByMID = KeyMID.fromOutboundMessage(originRequest); exchangeStore.remove(idByMID); } KeyToken idByToken = KeyToken.fromOutboundMessage(originRequest); exchangeStore.remove(idByToken); if(!originRequest.getOptions().hasObserve()) { exchangeStore.releaseToken(idByToken); } LOGGER.log(Level.FINER, "Exchange [{0}, origin: {1}] completed", new Object[]{idByToken, exchange.getOrigin()}); } else { Response response = exchange.getCurrentResponse(); Request request = exchange.getCurrentRequest(); if (response != null && response.getType() != Type.ACK) { KeyMID midKey = KeyMID.fromOutboundMessage(response); exchangeStore.remove(midKey); LOGGER.log(Level.FINER, "Exchange [{0}, {1}] completed", new Object[]{midKey, exchange.getOrigin()}); } ObserveRelation relation = exchange.getRelation(); if (relation != null) { removeNotificationsOf(relation); } } }
Source:
public boolean test(HermesResponse response) { return response == null || isClientTimeoutOrServerError(response) || isFailedExceptionally(response) || isSocketTimeoutException(response.getFailureCause()); }

Target:
public boolean test(HermesResponse response) { return response == null || isClientTimeoutOrServerError(response) || isFailedExceptionally(response) || isSocketTimeoutException(response); }
Source:
private void releaseByteBuf() { if (entries != null) { for (LedgerEntry entry : entries) { entry.getEntryBuffer().release(1); } } }

Target:
private void releaseByteBuf() { if (entries != null) { entries.forEach(LedgerEntry::close); entries.clear(); entries = null; } }
Source:
private void buildClaim( ProcessedClaimCollection claimsColl, Principal principal, URI claimType, Object value) { if (value == null) { return; } ProcessedClaim c = new ProcessedClaim(); c.setClaimType(claimType); c.setPrincipal(principal); Pattern p = Pattern.compile("^\\[(.*)\\]$"); Matcher m = p.matcher((String) value); if (m.matches()) { for (String s : m.group(1).split(",")) { c.addValue(s.trim()); } } else { c.addValue(value); } claimsColl.add(c); }

Target:
private void buildClaim( ProcessedClaimCollection claimsColl, Principal principal, URI claimType, Object value) { if (value == null) { return; } ProcessedClaim c = new ProcessedClaim(); c.setClaimType(claimType); c.setPrincipal(principal); Matcher m = attributePattern.matcher((String) value); if (m.matches()) { for (String s : m.group(1).split(",")) { c.addValue(s.trim()); } } else { c.addValue(value); } claimsColl.add(c); }
Source:
public boolean sendFIR(int mediaSenderSSRC) { KeyframeRequester oldRequester = kfRequesters.putIfAbsent( mediaSenderSSRC, new KeyframeRequester(mediaSenderSSRC)); KeyframeRequester kfRequester = kfRequesters.get(mediaSenderSSRC); if (oldRequester == null) { recurringProcessibleExecutor .registerRecurringProcessible(kfRequester); } return kfRequester.maybeRequest(true); }

Target:
public boolean sendFIR(int mediaSenderSSRC) { boolean registerRecurringProcessible = false; synchronized (kfRequesters) { if (!kfRequesters.containsKey(mediaSenderSSRC)) { kfRequesters.put( mediaSenderSSRC, new KeyframeRequester(mediaSenderSSRC)); registerRecurringProcessible = true; } } KeyframeRequester kfRequester = kfRequesters.get(mediaSenderSSRC); if (registerRecurringProcessible) { recurringProcessibleExecutor .registerRecurringProcessible(kfRequester); } return kfRequester.maybeRequest(true); }
Source:
public void visitToken(DetailAST ast) { DetailAST annotationsNode = ast.findFirstToken(TokenTypes.MODIFIERS); if (annotationsNode == null) { annotationsNode = ast.findFirstToken(TokenTypes.ANNOTATIONS); } if (annotationsNode != null) { checkAnnotations(annotationsNode); } }

Target:
public void visitToken(DetailAST ast) { DetailAST node = ast.findFirstToken(TokenTypes.MODIFIERS); if (node == null) { node = ast.findFirstToken(TokenTypes.ANNOTATIONS); } checkAnnotations(node, getExpectedAnnotationIndentation(node)); }