auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void handle(HttpExchange t) throws IOException { String query = t.getRequestURI().getRawQuery(); String contextPath = t.getHttpContext().getPath(); ByteArrayOutputStream response = this.response.get(); response.reset(); OutputStreamWriter osw = new OutputStreamWriter(response, UTF_8); if ("/-/healthy".equals(contextPath)) { osw.write(HEALTHY_RESPONSE); } else { TextFormat.write004(osw, registry.filteredMetricFamilySamples(parseQuery(query))); } osw.close(); t.getResponseHeaders().set("Content-Type", TextFormat.CONTENT_TYPE_004); if (shouldUseCompression(t)) { t.getResponseHeaders().set("Content-Encoding", "gzip"); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0); final GZIPOutputStream os = new GZIPOutputStream(t.getResponseBody()); try { response.writeTo(os); } finally { os.close(); } } else { t.getResponseHeaders().set("Content-Length", String.valueOf(response.size())); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, response.size()); response.writeTo(t.getResponseBody()); } t.close(); }

Target:
public void handle(HttpExchange t) throws IOException { String query = t.getRequestURI().getRawQuery(); String contextPath = t.getHttpContext().getPath(); ByteArrayOutputStream response = this.response.get(); response.reset(); OutputStreamWriter osw = new OutputStreamWriter(response, Charset.forName("UTF-8")); if ("/-/healthy".equals(contextPath)) { osw.write(HEALTHY_RESPONSE); } else { TextFormat.write004(osw, registry.filteredMetricFamilySamples(parseQuery(query))); } osw.close(); t.getResponseHeaders().set("Content-Type", TextFormat.CONTENT_TYPE_004); if (shouldUseCompression(t)) { t.getResponseHeaders().set("Content-Encoding", "gzip"); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0); final GZIPOutputStream os = new GZIPOutputStream(t.getResponseBody()); try { response.writeTo(os); } finally { os.close(); } } else { t.getResponseHeaders().set("Content-Length", String.valueOf(response.size())); t.sendResponseHeaders(HttpURLConnection.HTTP_OK, response.size()); response.writeTo(t.getResponseBody()); } t.close(); }
Source:
public Mono<Void> renewSessionLock(String sessionId, Duration maxLockRenewalDuration) { if (isDisposed.get()) { throw logger.logExceptionAsError(new IllegalStateException( String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "getAutoRenewSessionLock"))); } else if (!receiverOptions.isSessionReceiver()) { throw logger.logExceptionAsError(new IllegalStateException( "Cannot renew session lock on a non-session receiver.")); } else if (maxLockRenewalDuration == null) { throw logger.logExceptionAsError(new NullPointerException("'maxLockRenewalDuration' cannot be null.")); } else if (maxLockRenewalDuration.isNegative()) { throw logger.logExceptionAsError(new IllegalArgumentException( "'maxLockRenewalDuration' cannot be negative.")); } else if (Objects.isNull(sessionId)) { throw logger.logExceptionAsError(new NullPointerException("'sessionId' cannot be null.")); } else if (sessionId.isEmpty()) { throw logger.logExceptionAsError(new IllegalArgumentException("'sessionId' cannot be empty.")); } final LockRenewalOperation operation = new LockRenewalOperation(sessionId, maxLockRenewalDuration, true, this::renewSessionLock); renewalContainer.addOrUpdate(sessionId, Instant.now().plus(maxLockRenewalDuration), operation); return operation.getCompletionOperation(); }

Target:
public Mono<Void> renewSessionLock(String sessionId, Duration maxLockRenewalDuration) { if (isDisposed.get()) { return monoError(logger, new IllegalStateException( String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "getAutoRenewSessionLock"))); } else if (!receiverOptions.isSessionReceiver()) { return monoError(logger, new IllegalStateException( "Cannot renew session lock on a non-session receiver.")); } else if (maxLockRenewalDuration == null) { return monoError(logger, new NullPointerException("'maxLockRenewalDuration' cannot be null.")); } else if (maxLockRenewalDuration.isNegative()) { return monoError(logger, new IllegalArgumentException( "'maxLockRenewalDuration' cannot be negative.")); } else if (Objects.isNull(sessionId)) { return monoError(logger, new NullPointerException("'sessionId' cannot be null.")); } else if (sessionId.isEmpty()) { return monoError(logger, new IllegalArgumentException("'sessionId' cannot be empty.")); } final LockRenewalOperation operation = new LockRenewalOperation(sessionId, maxLockRenewalDuration, true, this::renewSessionLock); renewalContainer.addOrUpdate(sessionId, Instant.now().plus(maxLockRenewalDuration), operation); return operation.getCompletionOperation(); }
Source:
public String getDocumentation() { return "?"; }

Target:
public String getDocumentation() { return getDocHeader() + "Behavior: Returns the current index of the given reference. \n" + "Return: the greatest extant multiplicity of the reference. \n" + "Arguments: The reference to be checked, or none for current position " + "Example: position(/data/repeat) returns '2' if two iterations have been created"; }
Source:
public record InputRequireThisRecordAsTopLevel(int x, int y) { private static int i; public InputRequireThisRecordAsTopLevel { method1(); method2(42); method3(); } InputRequireThisRecordAsTopLevel(int x) { this(x,42); method1(); } public static int getI() { return i; } public static void setI(int i) { InputRequireThisRecordAsTopLevel.i = i; } void method1() { setI(3); } void method2(int i) { i++; this.setI(i); method1(); try { this.method1(); } catch (RuntimeException e) { e.toString(); } this.setI(this.getI() - 1); Integer.toString(10); } <T> void method3() { setI(3); } void method4() { this.<String>method3(); } }

Target:
public record InputRequireThisRecordAsTopLevel(int x, int y) { private static int i; public InputRequireThisRecordAsTopLevel { method1(); method2(42); method3(); int z = x + y + 2; System.out.println(y + x); } InputRequireThisRecordAsTopLevel(int x) { this(x,42); method1(); } public int getIPlusX() { return i + x; } public static void setI(int i) { InputRequireThisRecordAsTopLevel.i = i; } void method1() { i = 3 + y; int w = this.x; } void method2(int i) { i++; this.setI(i); method1(); try { this.method1(); } catch (RuntimeException e) { e.toString(); } this.setI(this.getIPlusX() - 1); Integer.toString(10); } <T> void method3() { setI(3); } void method4() { this.<String>method3(); } }
Source:
public static boolean deleteDirectory(File dir) throws IOException { if (!dir.exists() || !dir.isDirectory()) { throw new IOException("Could not delete directory '" + dir.getAbsolutePath() + "' (not a directory)"); } if (log.isDebugEnabled()) { log.debug("Deleting directory " + dir.getAbsolutePath()); } File[] fileList = dir.listFiles(); if (fielList != null) { for (File f : fileList) { if (f.isDirectory()) { deleteDirectory(f); } boolean success = f.delete(); if (log.isDebugEnabled()) { log.debug(" deleting " + f.getName() + " : " + (success ? "ok" : "failed")); } if (!success) { f.deleteOnExit(); } } } boolean success = dir.delete(); if (!success) { log.warn(" ...could not remove directory: " + dir.getAbsolutePath()); dir.deleteOnExit(); } if (success && log.isDebugEnabled()) { log.debug(" ...and directory itself"); } return success; }

Target:
public static boolean deleteDirectory(File dir) throws IOException { if (!dir.exists() || !dir.isDirectory()) { throw new IOException("Could not delete directory '" + dir.getAbsolutePath() + "' (not a directory)"); } if (log.isDebugEnabled()) { log.debug("Deleting directory " + dir.getAbsolutePath()); } File[] fileList = dir.listFiles(); if (fileList != null) { for (File f : fileList) { if (f.isDirectory()) { deleteDirectory(f); } boolean success = f.delete(); if (log.isDebugEnabled()) { log.debug(" deleting " + f.getName() + " : " + (success ? "ok" : "failed")); } if (!success) { f.deleteOnExit(); } } } boolean success = dir.delete(); if (!success) { log.warn(" ...could not remove directory: " + dir.getAbsolutePath()); dir.deleteOnExit(); } if (success && log.isDebugEnabled()) { log.debug(" ...and directory itself"); } return success; }
Source:
public void testQueryDefinitionsFromKjar() throws Exception { String containerOne = "container-one"; String containerTwo = "container-two"; KieServerAssert.assertSuccess(client.createContainer(containerOne, new KieContainerResource(containerOne, releaseIdKjarOne))); Map<String, QueryDefinition> queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); Assertions.assertThat(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)).isNull(); KieServerAssert.assertSuccess(client.createContainer(containerTwo, new KieContainerResource(containerTwo, releaseIdKjarTwo))); queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); KieServerAssert.assertSuccess(client.disposeContainer(containerOne)); queriesMap = retrieveQueryDefinitions(); Assertions.assertThat(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)).isNull(); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); KieServerAssert.assertSuccess(client.createContainer(containerOne, new KieContainerResource(containerOne, releaseIdKjarOne))); queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); }

Target:
public void testQueryDefinitionsFromKjar() throws Exception { String containerIdKjarOne = "container-one"; String containerIdKjarTwo = "container-two"; KieServerAssert.assertSuccess(client.createContainer(containerIdKjarOne, new KieContainerResource(containerIdKjarOne, releaseIdKjarOne))); Map<String, QueryDefinition> queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); Assertions.assertThat(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)).isNull(); KieServerAssert.assertSuccess(client.createContainer(containerIdKjarTwo, new KieContainerResource(containerIdKjarTwo, releaseIdKjarTwo))); queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); KieServerAssert.assertSuccess(client.disposeContainer(containerIdKjarOne)); queriesMap = retrieveQueryDefinitions(); Assertions.assertThat(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)).isNull(); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); KieServerAssert.assertSuccess(client.createContainer(containerIdKjarOne, new KieContainerResource(containerIdKjarOne, releaseIdKjarOne))); queriesMap = retrieveQueryDefinitions(); assertKjarOneQuery(queriesMap.get(KJAR_ONE_REGISTERED_QUERY)); assertKjarTwoQuery(queriesMap.get(KJAR_TWO_REGISTERED_QUERY)); }
Source:
private void checkUnsupportedIssueStatus(Issue issue) throws AphroditeException { if (issue.getStatus() == IssueStatus.CREATED) { throw new AphroditeException("bugzila not insist on the CREATED status!"); } }

Target:
private void checkUnsupportedIssueStatus(Issue issue) throws AphroditeException { if (issue.getStatus() == IssueStatus.CREATED) { throw new AphroditeException("bugzilla not insist on the CREATED status! it is not found in the bugzilla status"); } }
Source:
public boolean isConnectedToMobileNetwork() { int simState = telephonyManager.getSimState(); if (simState == TelephonyManager.SIM_STATE_READY) { NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); return networkInfo != null && networkInfo.isConnected(); } return false; }

Target:
public boolean isConnectedToMobileNetwork() { NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); return networkInfo != null && networkInfo.isConnected(); }
Source:
protected FormValidation doTestConnection(URL ec2endpoint, boolean useInstanceProfileForCredentials, String credentialsId, String privateKey, String roleArn, String roleSessionName, String region) throws IOException, ServletException { Jenkins.get().checkPermission(Jenkins.ADMINISTER); try { AWSCredentialsProvider credentialsProvider = createCredentialsProvider(useInstanceProfileForCredentials, credentialsId, roleArn, roleSessionName, region); AmazonEC2 ec2 = AmazonEC2Factory.getInstance().connect(credentialsProvider, ec2endpoint); ec2.describeInstances(); if (privateKey == null) return FormValidation.error("Private key is not specified. Please fill up the private key field with a valid one."); if (privateKey.trim().length() > 0) { EC2PrivateKey pk = new EC2PrivateKey(privateKey); if (pk.find(ec2) == null) return FormValidation .error("The EC2 key pair private key isn't registered to this EC2 region (fingerprint is " + pk.getFingerprint() + ")"); } return FormValidation.ok(Messages.EC2Cloud_Success()); } catch (AmazonClientException e) { LOGGER.log(Level.WARNING, "Failed to check EC2 credential", e); return FormValidation.error(e.getMessage()); } }

Target:
protected FormValidation doTestConnection(URL ec2endpoint, boolean useInstanceProfileForCredentials, String credentialsId, String privateKey, String roleArn, String roleSessionName, String region) throws IOException, ServletException { Jenkins.get().checkPermission(Jenkins.ADMINISTER); try { AWSCredentialsProvider credentialsProvider = createCredentialsProvider(useInstanceProfileForCredentials, credentialsId, roleArn, roleSessionName, region); AmazonEC2 ec2 = AmazonEC2Factory.getInstance().connect(credentialsProvider, ec2endpoint); ec2.describeInstances(); if (privateKey == null) return FormValidation.error("Private key is not specified. Please fill the private key field with a valid one."); if (privateKey.trim().length() > 0) { EC2PrivateKey pk = new EC2PrivateKey(privateKey); if (pk.find(ec2) == null) return FormValidation .error("The EC2 key pair private key isn't registered to this EC2 region (fingerprint is " + pk.getFingerprint() + ")"); } return FormValidation.ok(Messages.EC2Cloud_Success()); } catch (AmazonClientException e) { LOGGER.log(Level.WARNING, "Failed to check EC2 credential", e); return FormValidation.error(e.getMessage()); } }
Source:
public HashSet<String> getAllHandlesFromIndex() { HashSet<String> handlesFromStoreageIndex = new HashSet<>(); try { String allHandlesStr = get(STORE_KEY_INDEX_OF_HANDLES); logger.debug("All available handles: {}", allHandlesStr); if (allHandlesStr == null) { return handlesFromStoreageIndex; } return gson.fromJson(allHandlesStr, HashSet.class); } catch (RuntimeException storeNotAvailable) { return handlesFromStoreageIndex; } }

Target:
public Set<String> getAllHandlesFromIndex() { Set<String> handlesFromStoreageIndex = new HashSet<>(); try { String allHandlesStr = get(STORE_KEY_INDEX_OF_HANDLES); logger.debug("All available handles: {}", allHandlesStr); if (allHandlesStr == null) { return handlesFromStoreageIndex; } return gson.fromJson(allHandlesStr, HashSet.class); } catch (RuntimeException storeNotAvailable) { return handlesFromStoreageIndex; } }
Source:
public List<String> getSSTablesForKey(String key, boolean hexFormat) { log(" getSSTablesForKey(String key)"); MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>(); queryParams.add("key", key); if (hexFormat) { queryParams.add("hf", "True"); } return client.getListStrValue("column_family/sstables/by_key/" + getCFName(), queryParams); }

Target:
public List<String> getSSTablesForKey(String key, boolean hexFormat) { log(" getSSTablesForKey(String key)"); MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>(); queryParams.add("key", key); if (hexFormat) { queryParams.add("format", "hex"); } return client.getListStrValue("column_family/sstables/by_key/" + getCFName(), queryParams); }
Source:
public void testValidationErrorValue() { SWTBotVSMEditor odesignEditor = openViewpointSpecificationModel(VSM); bot.editorByTitle(VSM).setFocus(); SWTBotTree tree = odesignEditor.bot().tree(); SWTBotTreeItem group = tree.expandNode(ODESIGN); SWTBotUtils.clickContextMenu(tree, "Validate"); bot.button("OK").click(); assertTrue("Empty Name error does not appear in the problems view.", checkProblemValue()); }

Target:
public void testValidationErrorValue() { SWTBotVSMEditor odesignEditor = openViewpointSpecificationModel(VSM); bot.editorByTitle(VSM).setFocus(); SWTBotTree tree = odesignEditor.bot().tree(); SWTBotUtils.clickContextMenu(tree, "Validate"); bot.button("OK").click(); checkIconNodeInvalidate(odesignEditor, tree); assertTrue("Empty Name error does not appear in the problems view.", checkProblemValue()); }
Source:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if (responses.size() == 0) { return ""; } StringBuilder csv = new StringBuilder(); StringBuilder fragments = new StringBuilder(); List<String> options = constSumOptions; Map<String, List<Integer>> optionPoints = generateOptionPointsMapping(responses); DecimalFormat df = new DecimalFormat("#.##"); for (Entry<String, List<Integer>> entry : optionPoints.entrySet()) { String option; if (distributeToRecipients) { String teamName = bundle.getTeamNameForEmail(entry.getKey()); String recipientName = bundle.getNameForEmail(entry.getKey()); option = Sanitizer.sanitizeForCsv(teamName) + "," + Sanitizer.sanitizeForCsv(recipientName); } else { option = Sanitizer.sanitizeForCsv(options.get(Integer.parseInt(entry.getKey()))); } List<Integer> points = entry.getValue(); double average = computeAverage(points); fragments.append(option).append(',') .append(df.format(average)).append(Const.EOL); } csv.append(distributeToRecipients ? "Team, Recipient" : "Option").append(", Average Points").append(Const.EOL) .append(fragments).append(Const.EOL); return csv.toString(); }

Target:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if (responses.isEmpty()) { return ""; } StringBuilder fragments = new StringBuilder(); List<String> options = constSumOptions; Map<String, List<Integer>> optionPoints = generateOptionPointsMapping(responses); DecimalFormat df = new DecimalFormat("#.##"); for (Entry<String, List<Integer>> entry : optionPoints.entrySet()) { String option; if (distributeToRecipients) { String teamName = bundle.getTeamNameForEmail(entry.getKey()); String recipientName = bundle.getNameForEmail(entry.getKey()); option = Sanitizer.sanitizeForCsv(teamName) + "," + Sanitizer.sanitizeForCsv(recipientName); } else { option = Sanitizer.sanitizeForCsv(options.get(Integer.parseInt(entry.getKey()))); } List<Integer> points = entry.getValue(); double average = computeAverage(points); fragments.append(option).append(',').append(df.format(average)).append(Const.EOL); } return (distributeToRecipients ? "Team, Recipient" : "Option") + ", Average Points" + Const.EOL + fragments + Const.EOL; }
Source:
public void execute() { for (Compressor compressor : compressors) { if (compressor.getCompressorNotConnectedFault() || compressor.getCompressorNotConnectedStickyFault() || !compressor.enabled()) { updateStatus(compressor.getName(), SystemStatus.FAIL, new Exception("COMPRESSOR NOT CONNECTED")); } else if (compressor.getCompressorShortedFault() || compressor.getCompressorShortedStickyFault()) { updateStatus(compressor.getName(), SystemStatus.FAIL, new Exception("COMPRESSOR SHORTED")); } else if (compressor.getCompressorCurrentTooHighFault() || compressor.getCompressorCurrentTooHighStickyFault()) { updateStatus(compressor.getName(), SystemStatus.FAIL, new Exception("CURRENT TOO HIGH")); } else if (compressor.getPressureSwitchValue()) { updateStatus(compressor.getName(), SystemStatus.FAIL, new Exception("LOW PRESSURE")); } } }

Target:
public void execute() { for (Compressor compressor : compressors) { if (compressor.getCompressorNotConnectedFault() || compressor.getCompressorNotConnectedStickyFault() || !compressor.enabled()) { updateStatusFail(compressor.getName(), new Exception("COMPRESSOR NOT CONNECTED")); } else if (compressor.getCompressorShortedFault() || compressor.getCompressorShortedStickyFault()) { updateStatusFail(compressor.getName(), new Exception("COMPRESSOR SHORTED")); } else if (compressor.getCompressorCurrentTooHighFault() || compressor.getCompressorCurrentTooHighStickyFault()) { updateStatusFail(compressor.getName(), new Exception("CURRENT TOO HIGH")); } else if (compressor.getPressureSwitchValue()) { updateStatusFail(compressor.getName(), new Exception("LOW PRESSURE")); } } }
Source:
private void setupLoggers() { try { final String logDir = PathManager.getLogPath() + File.separator + "SarosLogs"; final boolean isDebugMode = Boolean.getBoolean("saros.debug"); final Level logLevel = isDebugMode ? Level.ALL : Level.INFO; System.setProperty("log4j.configurationFile", LOG4J2_CONFIG_FILENAME); MainMapLookup.setMainArguments("logDir", logDir, "logLevel", logLevel.name()); LoggerContext context = (LoggerContext) LogManager.getContext(false); context.reconfigure(); } catch (RuntimeException e) { StatusLogger.getLogger().error("initializing loggers failed", e); e.printStackTrace(); } }

Target:
private void setupLoggers() { try { final String logDir = PathManager.getLogPath() + File.separator + "SarosLogs"; final boolean isDebugMode = Boolean.getBoolean("saros.debug"); final Level logLevel = isDebugMode ? Level.ALL : Level.INFO; MainMapLookup.setMainArguments("logDir", logDir, "logLevel", logLevel.name()); Configurator.initialize( null, ConfigurationSource.fromResource( LOG4J2_CONFIG_FILENAME, SarosComponent.class.getClassLoader())); } catch (RuntimeException e) { StatusLogger.getLogger().error("initializing loggers failed", e); e.printStackTrace(); } }
Source:
private boolean hasOutputChanged(ChannelHandlerContext ctx, boolean first) { if (observeOutput) { if (lastChangeCheckTimeStamp != lastWriteTime) { lastChangeCheckTimeStamp = lastWriteTime; if (!first) { return true; } } Channel channel = ctx.channel(); Unsafe unsafe = channel.unsafe(); ChannelOutboundBuffer buf = unsafe.outboundBuffer(); if (buf != null) { int messageHashCode = System.identityHashCode(buf.current()); long pendingWriteBytes = buf.totalPendingWriteBytes(); long flushProgress = buf.currentProgress(); if (messageHashCode != lastMessageHashCode || pendingWriteBytes != lastPendingWriteBytes || flushProgress != lastFlushProgress) { lastMessageHashCode = messageHashCode; lastPendingWriteBytes = pendingWriteBytes; lastFlushProgress = flushProgress; if (!first) { return true; } } } } return false; }

Target:
private boolean hasOutputChanged(ChannelHandlerContext ctx, boolean first) { if (observeOutput) { if (lastChangeCheckTimeStamp != lastWriteTime) { lastChangeCheckTimeStamp = lastWriteTime; if (!first) { return true; } } Channel channel = ctx.channel(); Unsafe unsafe = channel.unsafe(); ChannelOutboundBuffer buf = unsafe.outboundBuffer(); if (buf != null) { int messageHashCode = System.identityHashCode(buf.current()); long pendingWriteBytes = buf.totalPendingWriteBytes(); if (messageHashCode != lastMessageHashCode || pendingWriteBytes != lastPendingWriteBytes) { lastMessageHashCode = messageHashCode; lastPendingWriteBytes = pendingWriteBytes; if (!first) { return true; } } long flushProgress = buf.currentProgress(); if (flushProgress != lastFlushProgress) { lastFlushProgress = flushProgress; if (!first) { return true; } } } } return false; }
Source:
static void loadPreference() { final String pref = Preferences.get(PREF_KEY_INTERPOLATION, Nearest.name()); try { ScaleInterpolation.valueOf(pref).menuItem.setSelected(true); } catch (Exception e) { e.printStackTrace(); Nearest.menuItem.setSelected(true); } }

Target:
static ScaleInterpolation loadPreference() { final String pref = Preferences.get(PREF_KEY_INTERPOLATION, Nearest.name()); try { return ScaleInterpolation.valueOf(pref); } catch (Exception e) { LOGGER.info("Illegal preference found for key " + PREF_KEY_INTERPOLATION + ": \"" + pref + "\". " + "Using Nearest instead."); return Nearest; } }
Source:
private boolean applicableWithUncheckedConversion(JavaSymbol.MethodJavaSymbol candidate, JavaType callSite, List<JavaType> typeParams) { return !candidate.isStatic() && isRawTypeOfParametrizedType(callSite) && typeParams.isEmpty(); }

Target:
private static boolean applicableWithUncheckedConversion(JavaSymbol.MethodJavaSymbol candidate, JavaType callSite, List<JavaType> typeParams) { return !candidate.isStatic() && isRawTypeOfParametrizedType(callSite) && typeParams.isEmpty(); }
Source:
public SoulBurn(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{2}{B}"); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); this.getSpellAbility().addEffect(new SoulBurnEffect()); VariableCost variableCost = this.getSpellAbility().getManaCostsToPay().getVariableCosts().get(0); if (variableCost instanceof VariableManaCost) { ((VariableManaCost) variableCost).setFilter(filterBlackOrRed); ((VariableManaCost) variableCost).setFilter(filterBlackOrRed); } }

Target:
public SoulBurn(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{2}{B}"); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); this.getSpellAbility().addEffect(new SoulBurnEffect()); VariableCost variableCost = this.getSpellAbility().getManaCostsToPay().getVariableCosts().get(0); if (variableCost instanceof VariableManaCost) { ((VariableManaCost) variableCost).setFilter(filterBlackOrRed); } }
Source:
public void action() throws Exception { log("Create an remove an empty local node source with cron policy"); createEmptyNodeSource(EMPTY_NODE_SOURCE_NAME); removeNodeSource(EMPTY_NODE_SOURCE_NAME); log("Create a local node source with " + NODES_NUMBER + " nodes with cron policy"); createNodeSource(NODE_SOURCE_NAME); log("Waiting for the cron policy to remove the nodes"); repeater.accept(NODES_NUMBER, () -> this.rmHelper.waitForAnyNodeEvent(RMEventType.NODE_REMOVED)); log("Waiting for the cron policy to add the nodes again"); RMTHelper.waitForNodesToBeUp(NODES_NUMBER, this.monitorsHandler); removeNodeSource(NODE_SOURCE_NAME); }

Target:
public void action() throws Exception { log("Create then remove an empty local node source with cron policy"); createEmptyNodeSource(EMPTY_NODE_SOURCE_NAME); removeNodeSource(EMPTY_NODE_SOURCE_NAME); log("Create a local node source with " + NODES_NUMBER + " nodes with cron policy"); createNodeSource(NODE_SOURCE_NAME); log("Waiting for the cron policy to remove the nodes"); repeater.accept(NODES_NUMBER, () -> this.rmHelper.waitForAnyNodeEvent(RMEventType.NODE_REMOVED)); log("Waiting for the cron policy to add the nodes again"); RMTHelper.waitForNodesToBeUp(NODES_NUMBER, this.monitorsHandler); removeNodeSource(NODE_SOURCE_NAME); }
Source:
public String DESCRIPTION() { StringBuilder sb = new StringBuilder(); sb.append("This MassBank record with Accession " + ACCESSION() + " contains the " + MS_TYPE()" mass spectrum" + " of '" + RECORD_TITLE().get(0) + "' with the InChIkey '" + link.getKey("INCHIKEY") + "'." return sb.toString(); }

Target:
public String DESCRIPTION() { StringBuilder sb = new StringBuilder(); sb.append("This MassBank record with Accession " + ACCESSION() + " contains the " + MS_TYPE() + " mass spectrum" + " of '" + RECORD_TITLE().get(0) + "' with the InChIkey '" + link.getKey("INCHIKEY") + "'." return sb.toString(); }
Source:
public void getCondition_shouldFindConditionGivenValidId() { int conditionId = 1; String uuid="2cc6880e-2c46-15e4-9038-a6c5e4d22fb7"; String clinical_status = "INACTIVE"; String verification_status = "PROVISIONAL"; Condition condition = conditionService.getCondition(conditionId); Assert.assertEquals(clinical_status, condition.getClinicalStatus().toString()); Assert.assertEquals(verification_status, condition.getVerificationStatus().toString()); Assert.assertEquals(uuid, condition.getUuid()); }

Target:
public void getCondition_shouldFindConditionGivenValidId() { Condition condition = conditionService.getCondition(1); Assert.assertEquals(ConditionClinicalStatus.INACTIVE, condition.getClinicalStatus()); Assert.assertEquals(ConditionVerificationStatus.PROVISIONAL, condition.getVerificationStatus()); Assert.assertEquals("2cc6880e-2c46-15e4-9038-a6c5e4d22fb7", condition.getUuid()); }
Source:
private static Config loadNeo4jConfig( Path homeDir, Path configDir, String databaseName ) { return fromFile( configDir.resolve( "neo4j.conf" ) ) .withSetting( DatabaseManagementSystemSettings.active_database, databaseName ) .withHome( homeDir ).build(); }

Target:
private static Config loadNeo4jConfig( Path homeDir, Path configDir, String databaseName ) { return fromFile( configDir.resolve( Config.DEFAULT_CONFIG_FILE_NAME ) ) .withSetting( DatabaseManagementSystemSettings.active_database, databaseName ) .withHome( homeDir ).build(); }
Source:
public Block getBlock(int[] positions, int positionCount) { checkArgument(outputPositionCount > 0, "outputPositionCount must be greater than zero"); checkState(outputRequired, "This stream reader doesn't produce output"); checkState(positionCount <= outputPositionCount, "Not enough values"); if (allNulls) { return new RunLengthEncodedBlock(outputType.createBlockBuilder(null, 1).appendNull().build(), outputPositionCount); } return makeOutputBlock(positions, positionCount, nullsAllowed && presentStream != null); }

Target:
public Block getBlock(int[] positions, int positionCount) { checkArgument(outputPositionCount > 0, "outputPositionCount must be greater than zero"); checkState(outputRequired, "This stream reader doesn't produce output"); checkState(positionCount <= outputPositionCount, "Not enough values"); if (allNulls) { return new RunLengthEncodedBlock(outputType.createBlockBuilder(null, 1).appendNull().build(), outputPositionCount); } return buildOutputBlock(positions, positionCount, nullsAllowed && presentStream != null); }
Source:
public ServiceContextImpl serviceContext(String name) { if (!enterBusy()) return null; try { Collection<ServiceContextImpl> ctxs = Optional.ofNullable(lookupDeployedServiceId(name)) .map(locServices::get).orElse(null); if (F.isEmpty(ctxs)) return null; for (ServiceContextImpl ctx : ctxs) { if (ctx.service() != null) return ctx; } return null; } finally { leaveBusy(); } }

Target:
@Override public ServiceContextImpl serviceContext(String name) { Collection<ServiceContextImpl> ctxs; synchronized (locSvcs) { ctxs = locSvcs.get(name); } if (ctxs == null) return null; synchronized (ctxs) { if (ctxs.isEmpty()) return null; for (ServiceContextImpl ctx : ctxs) { if (ctx.service() != null) return ctx; } return null; } }
Source:
private L findOrCreateCodelist(@Nonnull String codeList) { Optional<L> optionalCodeList = findCodelist(codeList); Tenant<?> currentTenant = getCurrentTenant(codeList).orElseThrow(this::warnAboutMissingTenant); if (!optionalCodeList.isPresent()) { Extension ext = getCodeListConfig(codeList); L cl = createCodeList(currentTenant, codeList); if (ext != null && !ext.isDefault()) { cl.getCodeListData().setName(ext.get(CONFIG_KEY_NAME).asString()); cl.getCodeListData().setDescription(ext.get(CONFIG_KEY_DESCRIPTION).asString()); cl.getCodeListData().setAutofill(ext.get(CONFIG_KEY_AUTOFILL).asBoolean()); } cl.getMapper().update(cl); return cl; } return optionalCodeList.get(); }

Target:
private L findOrCreateCodelist(@Nonnull String codeList) { Optional<L> optionalCodeList = findCodelist(codeList); Tenant<?> currentTenant = getCurrentTenant(codeList).orElseThrow(this::warnAboutMissingTenant); if (optionalCodeList.isPresent()) { return optionalCodeList.get(); } Extension ext = getCodeListConfig(codeList); L cl = createCodeList(currentTenant, codeList); if (ext != null && !ext.isDefault()) { cl.getCodeListData().setName(ext.get(CONFIG_KEY_NAME).asString()); cl.getCodeListData().setDescription(ext.get(CONFIG_KEY_DESCRIPTION).asString()); cl.getCodeListData().setAutofill(ext.get(CONFIG_KEY_AUTOFILL).asBoolean()); } cl.getMapper().update(cl); return cl; }
Source:
void swapTableViewPointer(long handoverTableViewPointer) { try { table = query.importHandoverTableView(handoverTableViewPointer, realm.sharedGroupManager.getNativePointer()); isCompleted = true; } catch (BadVersionException e) { throw new IllegalStateException("Caller and Worker SharedGroup should have been the same version"); } }

Target:
void swapTableViewPointer(long handoverTableViewPointer) { try { table = query.importHandoverTableView(handoverTableViewPointer, realm.sharedGroupManager.getNativePointer()); isCompleted = true; } catch (BadVersionException e) { throw new IllegalStateException("Caller and Worker Realm should have been at the same version"); } }
Source:
public void run() { try{ while (fsRunning && shouldCacheCleanerRun && isLeader()) { long lastDeletedEpochSec = HdfsVariables.getRetryCacheCleanerEpoch(); long toBeDeletedEpochSec = lastDeletedEpochSec + 1L; cleanerLog.debug("Current epoch "+(System.currentTimeMillis()/1000)+ " Last deleted epoch is " + lastDeletedEpochSec + " To be deleted epoch "+toBeDeletedEpochSec); if (toBeDeletedEpochSec < ((timer.now() - entryExpiryMillis) / 1000)) { int countDeleted = deleteAllForEpoch(toBeDeletedEpochSec); HdfsVariables.setRetryCacheCleanerEpoch(toBeDeletedEpochSec); cleanerLog.debug("Deleted "+countDeleted+" entries for epoch "+toBeDeletedEpochSec); continue; } else { Thread.sleep(1000); } } } catch (Throwable e) { if (e instanceof InterruptedException) { cleanerLog.warn("RetryCacheCleaner Interrupted"); } else { cleanerLog.error("Exception in RetryCacheCleaner: ", e); } } }

Target:
public void run() { while (fsRunning && shouldCacheCleanerRun) { try { if (isLeader()) { long lastDeletedEpochSec = HdfsVariables.getRetryCacheCleanerEpoch(); long toBeDeletedEpochSec = lastDeletedEpochSec + 1L; if (toBeDeletedEpochSec < ((timer.now() - entryExpiryMillis) / 1000)) { cleanerLog.debug("Current epoch " + (System.currentTimeMillis() / 1000) + " Last deleted epoch is " + lastDeletedEpochSec + " To be deleted epoch " + toBeDeletedEpochSec); int countDeleted = deleteAllForEpoch(toBeDeletedEpochSec); HdfsVariables.setRetryCacheCleanerEpoch(toBeDeletedEpochSec); cleanerLog.debug("Deleted " + countDeleted + " entries for epoch " + toBeDeletedEpochSec); continue; } } Thread.sleep(1000); } catch (Exception e) { if (e instanceof InterruptedException) { cleanerLog.warn("RetryCacheCleaner Interrupted"); return; } else { cleanerLog.warn("Exception in RetryCacheCleaner: ", e); } } } }
Source:
protected boolean internalUnaryEvaluation(String rawExpression, Object resultValue, Class<?> resultClass, boolean skipEmptyString) { if (rawExpression != null && skipEmptyString && rawExpression.isEmpty()) { return true; } AtomicReference<FEELEvent> errorHolder = new AtomicReference<>(); FEEL feel = newFeelEvaluator(errorHolder); EvaluationContext evaluationContext = newEvaluationContext(); List<UnaryTest> unaryTests = feel.evaluateUnaryTests(rawExpression); FEELEvent errorEvent = errorHolder.get(); if (errorEvent != null) { String detailedError = errorEvent.getMessage(); throw new IllegalArgumentException("Impossible to parse the expression '" + rawExpression + "': " + detailedError); } return unaryTests.stream() .allMatch(unaryTest -> Optional .ofNullable(unaryTest.apply(evaluationContext, resultValue)) .orElse(false)); }

Target:
protected boolean internalUnaryEvaluation(String rawExpression, Object resultValue, Class<?> resultClass, boolean skipEmptyString) { if (rawExpression != null && skipEmptyString && rawExpression.isEmpty()) { return true; } EvaluationContext evaluationContext = newEvaluationContext(); List<UnaryTest> unaryTests = executeAndVerifyErrors(feel -> feel.evaluateUnaryTests(rawExpression)); return unaryTests.stream() .allMatch(unaryTest -> Optional .ofNullable(unaryTest.apply(evaluationContext, resultValue)) .orElse(false)); }
Source:
public void testAdminLogQuery() { ______TS("Test constructor with parameters"); List<String> versionList = new ArrayList<>(); versionList.add("5-44"); ZonedDateTime startDateTime = LocalDateTime.of(1994, 5, 7, 15, 30, 12).atZone(Const.DEFAULT_TIME_ZONE); long startTime = startDateTime.toInstant().toEpochMilli(); long endTime = startDateTime.plusYears(22).toInstant().toEpochMilli(); AdminLogQuery query = new AdminLogQuery(versionList, startTime, endTime); assertEquals(startTime, query.getStartTime()); assertEquals(endTime, query.getEndTime()); assertNotNull(query.getQuery()); ______TS("Test setTimePeriod"); query = new AdminLogQuery(versionList, null, null); assertEquals(0, query.getStartTime()); assertNotEquals(endTime, query.getStartTime()); query.setTimePeriod(startTime, endTime); assertEquals(startTime, query.getStartTime()); assertEquals(endTime, query.getEndTime()); assertNotNull(query.getQuery()); }

Target:
public void testAdminLogQuery() { ______TS("Test constructor with parameters"); List<String> versionList = new ArrayList<>(); versionList.add("5-44"); ZonedDateTime startDateTime = LocalDateTime.of(1994, Month.MAY, 7, 15, 30, 12).atZone(ZoneId.of("UTC")); long startTime = startDateTime.toInstant().toEpochMilli(); long endTime = startDateTime.plusYears(22).toInstant().toEpochMilli(); AdminLogQuery query = new AdminLogQuery(versionList, startTime, endTime); assertEquals(startTime, query.getStartTime()); assertEquals(endTime, query.getEndTime()); assertNotNull(query.getQuery()); ______TS("Test setTimePeriod"); query = new AdminLogQuery(versionList, null, null); assertEquals(0, query.getStartTime()); assertNotEquals(endTime, query.getStartTime()); query.setTimePeriod(startTime, endTime); assertEquals(startTime, query.getStartTime()); assertEquals(endTime, query.getEndTime()); assertNotNull(query.getQuery()); }
Source:
public void testListStandardDrives() throws Exception { Set<String> drives = client.listStandardDrives(); assertNotNull(drives); }

Target:
public void testListStandardDrives() throws Exception { Set<String> drives = client.listStandardDrives(); assertNotNull(drives); assertFalse(drives.isEmpty(), "standard drive list should not be empty"); }
Source:
public String getFileURI() { if (resolveHostsDynamically) { try { return VFSUtils.resolveUriHost(fileURI); } catch (UnknownHostException | FileSystemException e) { log.warn("Unable to resolving hostname of transport.vfs.FileURI : " + VFSUtils.maskURLPassword(fileURI), e); } } return fileURI; }

Target:
public String getFileURI() { if (resolveHostsDynamically) { try { return VFSUtils.resolveUriHost(fileURI); } catch (UnknownHostException | FileSystemException e) { log.warn("Unable to resolve the hostname of transport.vfs.FileURI : " + VFSUtils.maskURLPassword(fileURI), e); } } return fileURI; }
Source:
public static String stateFor(String result) { result = result == null ? "" : result; String state = PENDING; if (result.equalsIgnoreCase("Passed")) { state = SUCCESS; } else if (result.equalsIgnoreCase("Failed")) { state = FAILED; } else if (result.equalsIgnoreCase("Cancelled")) { state = CANCELED; } return state; }

Target:
static String stateFor(String result) { result = result == null ? "" : result; String state = PENDING; if (result.equalsIgnoreCase("Passed")) { state = SUCCESS; } else if (result.equalsIgnoreCase("Failed")) { state = FAILED; } else if (result.equalsIgnoreCase("Cancelled")) { state = CANCELED; } return state; }
Source:
public Optional<BibEntry> extractBibtexEntry() { this.extractBibTexFields(); this.extractEditor(); this.extractAuthor(); this.extractYearAndMonth(); this.extractAbstract(); this.extractDOI(); this.extractPublisher(); this.extractRights(); this.extractSource(); this.extractSubject(); this.extractTitle(); this.extractType(); if (bibEntry.equals(new BibEntry())) { return Optional.empty(); } return Optional.of(bibEntry); }

Target:
public Optional<BibEntry> extractBibtexEntry() { this.extractBibTexFields(); this.extractEditor(); this.extractAuthor(); this.extractYearAndMonth(); this.extractAbstract(); this.extractDOI(); this.extractPublisher(); this.extractRights(); this.extractSource(); this.extractSubject(); this.extractTitle(); this.extractType(); if (bibEntry.getFieldMap().isEmpty()) { return Optional.empty(); } return Optional.of(bibEntry); }
Source:
public void feedSessionOpen(Session session, @PathParam("feedId") String feedId) { log.infoWsSessionOpened(session.getId(), endpoint); wsEndpoints.getFeedSessions().addSession(feedId, session); }

Target:
public void feedSessionOpen(Session session, @PathParam("feedId") String feedId) { log.infoWsSessionOpened(feedId, endpoint); wsEndpoints.getFeedSessions().addSession(feedId, session); }
Source:
public PulsarContainer(String pulsarVersion) { super(TestcontainersConfiguration.getInstance().getPulsarImage() + ":" + pulsarVersion); withExposedPorts(BROKER_HTTP_PORT, BROKER_PORT); withCommand("/bin/bash", "-c", "/pulsar/bin/pulsar standalone --no-functions-worker -nss"); waitingFor(Wait.forHttp(METRICS_ENDPOINT).forStatusCode(200)); }

Target:
public PulsarContainer(String pulsarVersion) { super(TestcontainersConfiguration.getInstance().getPulsarImage() + ":" + pulsarVersion); withExposedPorts(BROKER_PORT, BROKER_HTTP_PORT); withCommand("/pulsar/bin/pulsar", "standalone", "--no-functions-worker", "-nss"); waitingFor(Wait.forHttp(METRICS_ENDPOINT).forStatusCode(200).forPort(BROKER_HTTP_PORT)); }
Source:
public void shouldReturnStringWhenStringClassIdType() throws SQLException { given(resultSet.getString("class_id_type")).willReturn("java.lang.String"); Serializable newIdentifier = aclClassIdUtils.identifierFrom(IDENTIFIER_AS_STRING, resultSet); assertThat(newIdentifier).isEqualTo(IDENTIFIER_AS_STRING); }

Target:
public void shouldReturnStringWhenStringClassIdType() throws SQLException { String identifier = "MY_STRING_IDENTIFIER"; given(resultSet.getString("class_id_type")).willReturn("java.lang.String"); Serializable newIdentifier = aclClassIdUtils.identifierFrom(identifier, resultSet); assertThat(newIdentifier).isEqualTo(identifier); }
Source:
AllStoreHolder( StorageEngine engine, StorageStatement statement, Supplier<ExplicitIndexTransactionState> explicitIndexes ) { this.read = engine.storeReadLayer(); this.statement = statement; this.explicitIndexes = Suppliers.lazySingleton( explicitIndexes ); StoreHolder stores = engine.stores(); this.nodeStore = stores.getNodeStore(); this.relationshipStore = stores.getRelationshipStore(); this.groupStore = stores.getRelationshipGroupStore(); this.propertyStore = stores.getPropertyStore(); }

Target:
AllStoreHolder( StorageEngine engine, StorageStatement statement, Supplier<ExplicitIndexTransactionState> explicitIndexes ) { this.read = engine.storeReadLayer(); this.statement = statement; this.explicitIndexes = Suppliers.lazySingleton( explicitIndexes ); this.nodes = statement.nodes(); this.relationships = statement.relationships(); this.groups = statement.groups(); this.properties = statement.properties(); }
Source:
private void throwExceptionOnErrorStatus(String url, int statusCode, JsonElement node, String message) { if (Strings.isNullOrEmpty(message)) { if (node != null && node.getAsJsonObject().get("message") != null) { message = node.getAsJsonObject().get("message").getAsString(); } else { message = "There has been an error on the server"; } } if (statusCode == 412) { UserSessionInfo session = null; if (node != null) { session = RestUtils.GSON.fromJson(node, UserSessionInfo.class); } throw new ConsentRequiredException("Consent required.", url, session); } String type = (node != null) ? node.getAsJsonObject().get("type").getAsString() : "Unknown"; switch(type) { case "NotAuthenticatedException": throw new NotAuthenticatedException(message, url); case "UnauthorizedException": throw new UnauthorizedException(message, url); case "EntityNotFoundException": throw new EntityNotFoundException(message, url); case "EndpointNotFoundException": throw new EndpointNotFoundException(message, url); case "UnsupportedVersionException": throw new UnsupportedVersionException(message, url); case "EntityAlreadyExistsException": throw new EntityAlreadyExistsException(message, url); case "ConcurrentModificationException": throw new ConcurrentModificationException(message, url); case "ConstraintViolationException": throw new ConstraintViolationException(message, url); case "PublishedSurveyException": throw new PublishedSurveyException(message, url); case "InvalidEntityException": Map<String, List<String>> errors = Maps.newHashMap(); if (node != null && node.getAsJsonObject().get("errors") != null) { errors = RestUtils.GSON.fromJson(node.getAsJsonObject().get("errors"), ERRORS_MAP_TYPE_TOKEN); } throw new InvalidEntityException(message, errors, url); case "NotImplementedException": throw new NotImplementedException(message, url); case "BadRequestException": throw new BadRequestException(message, url); default: throw new BridgeSDKException(message, statusCode, url); } }

Target:
private void throwExceptionOnErrorStatus(String url, int statusCode, JsonElement node, String message) { if (Strings.isNullOrEmpty(message)) { if (node != null && node.getAsJsonObject().get("message") != null) { message = node.getAsJsonObject().get("message").getAsString(); } else { message = "There has been an error on the server"; } } if (statusCode == 412) { UserSessionInfo session = null; if (node != null) { session = RestUtils.GSON.fromJson(node, UserSessionInfo.class); } throw new ConsentRequiredException("Consent required.", url, session); } String type = (node != null) ? node.getAsJsonObject().get("type").getAsString() : "Unknown"; if ("InvalidEntityException".equals(type)) { Map<String, List<String>> errors = Maps.newHashMap(); if (node != null && node.getAsJsonObject().get("errors") != null) { errors = RestUtils.GSON.fromJson(node.getAsJsonObject().get("errors"), ERRORS_MAP_TYPE_TOKEN); } throw new InvalidEntityException(message, errors, url); } throwBridgeExceptionIfItExists(type, message, url); throw new BridgeSDKException(message, statusCode, url); }
Source:
private void addProfilePreferences() { final boolean canEditProfilePreferences = authorizationManager.authorize(WorkbenchFeatures.EDIT_PROFILE_PREFERENCES, sessionInfo.getIdentity()); profileService.call((Boolean force) -> { if(canEditProfilePreferences && !force) { adminPage.addPreference("root", "ProfilePreferences", translationService.format(PreferencesConstants.ProfilePreferences_Title), new Sets.Builder().add("fa").add("fa-list").build(), "advanced", scopeFactory.createScope(GuvnorPreferenceScopes.GLOBAL), AdminPageOptions.WITH_BREADCRUMBS); } }, (Object message, Throwable t) -> { throw new RuntimeException(t); }).isForce(); }

Target:
private void addProfilePreferences() { final boolean canEditProfilePreferences = authorizationManager.authorize(WorkbenchFeatures.EDIT_PROFILE_PREFERENCES, sessionInfo.getIdentity()); profileService.call((Boolean force) -> { if (canEditProfilePreferences && !force) { adminPage.addPreference("root", "ProfilePreferences", translationService.format(PreferencesConstants.ProfilePreferences_Title), new Sets.Builder().add("fa").add("fa-list").build(), "advanced", scopeFactory.createScope(GuvnorPreferenceScopes.GLOBAL), AdminPageOptions.WITH_BREADCRUMBS); } }).isForce(); }
Source:
public void openConnection() { try { if (reader != null) reader.startserver(); } catch (IOException e) { e.printStackTrace(); } if (connection.getpairkey().length() == 0) { connection.requestpairkey(); } else { connection.sendpairkey(); } }

Target:
public void openConnection() { try { if (reader != null) reader.startserver(); } catch (IOException e) { logger.error("Error at openconnection", e); } if (connection.getpairkey().length() == 0) { connection.requestpairkey(); } else { connection.sendpairkey(); } }
Source:
public List<CatalogItemSummary> listApplications(String regex, String fragment) { ImmutableList.<String>of(); Predicate<CatalogItem<Application, EntitySpec<? extends Application>>> filter = Predicates.and(CatalogPredicates.<Application,EntitySpec<? extends Application>>deprecated(false), CatalogPredicates.IS_TEMPLATE); return getCatalogItemSummariesMatchingRegexFragment(filter, regex, fragment); }

Target:
public List<CatalogItemSummary> listApplications(String regex, String fragment) { Predicate<CatalogItem<Application, EntitySpec<? extends Application>>> filter = Predicates.and(CatalogPredicates.<Application,EntitySpec<? extends Application>>deprecated(false), CatalogPredicates.IS_TEMPLATE); return getCatalogItemSummariesMatchingRegexFragment(filter, regex, fragment); }