auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static PublicKey decodeKeyString(final String key) throws IOException, GeneralSecurityException { String[] words = key.split("\\s+", 3); if (!words[0].equals(SSH_RSA)) { throw new GeneralSecurityException("Unsupported SSH public key"); } try ( ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64.decodeBase64(words[1])); DataInputStream dataInputStream = new DataInputStream(inputStream) ) { if (!Arrays.equals(getByteArrayOfData(dataInputStream), SSH_RSA.getBytes(StandardCharsets.UTF_8))) { throw new GeneralSecurityException("Unsupported SSH public key"); } byte[] exponentBytes = getByteArrayOfData(dataInputStream); byte[] modulusBytes = getByteArrayOfData(dataInputStream); return KeyFactory.getInstance("RSA").generatePublic( new RSAPublicKeySpec( new BigInteger(modulusBytes), new BigInteger(exponentBytes) ) ); } }

Target:
public static PublicKey decodeKeyString(final String key) throws IOException, GeneralSecurityException { String[] words = key.split("\\s+", 3); if (words.length < 2 || !SSH_RSA.equals(words[0])) { throw new GeneralSecurityException("Unsupported SSH public key"); } try ( ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64.decodeBase64(words[1])); DataInputStream dataInputStream = new DataInputStream(inputStream) ) { if (!Arrays.equals(getByteArrayOfData(dataInputStream), SSH_RSA.getBytes(StandardCharsets.UTF_8))) { throw new GeneralSecurityException("Unsupported SSH public key"); } byte[] exponentBytes = getByteArrayOfData(dataInputStream); byte[] modulusBytes = getByteArrayOfData(dataInputStream); return KeyFactory.getInstance("RSA").generatePublic( new RSAPublicKeySpec( new BigInteger(modulusBytes), new BigInteger(exponentBytes) ) ); } }
Source:
public Map<String, String> configure(@NotNull Module ijModule) { JavaModuleClasspath moduleClasspath = new JavaModuleClasspath(); moduleClasspath.dependentModules().add(ijModule); collectModuleClasspath(moduleClasspath, ijModule, true, false); Map<String, String> properties = new HashMap<>(); if (!moduleClasspath.libraries().isEmpty()) { String joinedLibs = StringUtils.join(moduleClasspath.libraries(), SEPARATOR); properties.put(JAVA_LIBRARIES_PROPERTY, joinedLibs); } if (!moduleClasspath.testLibraries().isEmpty()) { String joinedLibs = StringUtils.join(moduleClasspath.testLibraries(), SEPARATOR); properties.put(JAVA_TEST_LIBRARIES_PROPERTY, joinedLibs); } if (!moduleClasspath.binaries().isEmpty()) { String joinedPaths = StringUtils.join(moduleClasspath.binaries(), SEPARATOR); properties.put(JAVA_BINARIES_PROPERTY, joinedPaths); } if (!moduleClasspath.testBinaries().isEmpty()) { String joinedPaths = StringUtils.join(moduleClasspath.testBinaries(), SEPARATOR); properties.put(JAVA_TEST_BINARIES_PROPERTY, joinedPaths); } configureJavaSourceTarget(ijModule, properties); return properties; }

Target:
public Map<String, String> configure(@NotNull Module ijModule) { JavaModuleClasspath moduleClasspath = new JavaModuleClasspath(); moduleClasspath.dependentModules().add(ijModule); collectModuleClasspath(moduleClasspath, ijModule, true, false); Map<String, String> properties = new HashMap<>(); setMultiValuePropertyIfNonEmpty(properties, JAVA_LIBRARIES_PROPERTY, moduleClasspath.libraries()); setMultiValuePropertyIfNonEmpty(properties, JAVA_TEST_LIBRARIES_PROPERTY, moduleClasspath.testLibraries()); setMultiValuePropertyIfNonEmpty(properties, JAVA_BINARIES_PROPERTY, moduleClasspath.binaries()); setMultiValuePropertyIfNonEmpty(properties, JAVA_TEST_BINARIES_PROPERTY, moduleClasspath.testBinaries()); configureJavaSourceTarget(ijModule, properties); return properties; }
Source:
public FileVisitResult preVisitDirectory(final Path dir, final BasicFileAttributes attrs) throws IOException { if(ignoreHiddenFiles && Files.isHidden(dir)){ logger.debug("Skipping cause ignore hidden files/directories", dir); return FileVisitResult.SKIP_SUBTREE; } if(ignoreHiddenFiles && System.getProperty("os.name").contains("Windows") && Files.readAttributes(dir, DosFileAttributes.class).isHidden()){ logger.debug("Skipping since we are ignoring hidden files", dir); return FileVisitResult.SKIP_SUBTREE; } return FileVisitResult.CONTINUE; }

Target:
public FileVisitResult preVisitDirectory(final Path dir, final BasicFileAttributes attrs) throws IOException { if(ignoreHiddenFiles && Files.isHidden(dir)){ logger.debug("Skipping cause ignore hidden files/directories", dir); return FileVisitResult.SKIP_SUBTREE; } if(ignoreHiddenFiles && PathUtils.isHiddenWindowsFile(dir)){ logger.debug("Skipping since we are ignoring hidden files", dir); return FileVisitResult.SKIP_SUBTREE; } return FileVisitResult.CONTINUE; }
Source:
private String getSignatureAlgorithmURI(X509Certificate certificate) { String sigAlgoUri = RFC5698_DSSC_OID_TO_URI_MAP.get(certificate.getSigAlgOID()); if (sigAlgoUri == null) { sigAlgoUri = ("DSA".equalsIgnoreCase(certificate.getPublicKey().getAlgorithm())) ? WSS4JConstants.SHA384 : WSS4JConstants.RSA; } LOGGER.debug("Using Signature algorithm {}", sigAlgoUri); return sigAlgoUri; }

Target:
private String getSignatureAlgorithmURI(X509Certificate certificate) { String sigAlgoUri = ("DSA".equalsIgnoreCase(certificate.getPublicKey().getAlgorithm())) ? DSA_ALGO_URI : RSA_ALGO_URI; LOGGER.debug("Using Signature algorithm {}", sigAlgoUri); return sigAlgoUri; }
Source:
public void tick() { long timeStart = System.currentTimeMillis(); long timeStop = timeStart + CubicChunks.Config.getMaxTimeSpentGeneratingCubesPerTick(); this.skylightCubeDiffuseProcessor.processQueueUntil(timeStop); }

Target:
public void tick() { long timeStart = System.currentTimeMillis(); long timeStop = timeStart + CubicChunks.Config.getLightingTickBudget(); this.skylightCubeDiffuseProcessor.processQueueUntil(timeStop); }
Source:
public void onAcceptButtonClicked() { updateFinalEdits(); WorkspaceEdit edit = new WorkspaceEdit(); edit.setChanges(workspaceEdit.getChanges()); edit.setResourceChanges(new LinkedList<>()); for (ResourceChange resourceChange : workspaceEdit.getResourceChanges()) { edit.getResourceChanges().add(Either.forLeft(resourceChange)); } applyWorkspaceEditAction.applyWorkspaceEdit(edit); view.close(); refactoringActionDelegate.closeWizard(); }

Target:
public void onAcceptButtonClicked() { updateFinalEdits(); applyWorkspaceEditAction.applyWorkspaceEdit(workspaceEdit); view.close(); refactoringActionDelegate.closeWizard(); }
Source:
protected void onBind() { super.onBind(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { List<ActionButtonDefinition<?>> pluginActionButtonList = actionButtonPluginHandler.getButtons(getProxy().getTargetHistoryToken()); if (getTable() != null && pluginActionButtonList != null) { for(ActionButtonDefinition<?> buttonDef: pluginActionButtonList) { getTable().addActionButton((ActionButtonDefinition) buttonDef); } } } }); registerHandler(getEventBus().addHandler(AddTabActionButtonEvent.getType(), new AddTabActionButtonEvent.AddTabActionButtonHandler() { @Override public void onAddTabActionButton(AddTabActionButtonEvent event) { if (getProxy().getTargetHistoryToken().equals(event.getHistoryToken())) { if (getTable() != null) { getTable().addActionButton((ActionButtonDefinition) event.getButtonDefinition()); } } } })); }

Target:
protected void onBind() { super.onBind(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { addPluginActionButtons(actionButtonPluginHandler.getButtons(getProxy().getTargetHistoryToken())); } }); registerHandler(getEventBus().addHandler(AddTabActionButtonEvent.getType(), new AddTabActionButtonEvent.AddTabActionButtonHandler() { @Override public void onAddTabActionButton(AddTabActionButtonEvent event) { if (getProxy().getTargetHistoryToken().equals(event.getHistoryToken())) { List<ActionButtonDefinition<?>> pluginActionButtonList = new ArrayList<ActionButtonDefinition<?>>(); pluginActionButtonList.add(event.getButtonDefinition()); addPluginActionButtons(pluginActionButtonList); } } })); }
Source:
protected List<String> getExecutorCommand(String containerId) { final Map<ExecutorPort, String> ports = KubernetesConstants.EXECUTOR_PORTS.entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().toString())); final Config configuration = getConfiguration(); final Config runtimeConfiguration = getRuntimeConfiguration(); final String[] executorCommand = SchedulerUtils.getExecutorCommand(configuration, runtimeConfiguration, Integer.valueOf(containerId), ports); return Arrays.asList( "sh", "-c", KubernetesUtils.getFetchCommand(configuration, runtimeConfiguration) + " && " + setShardIdEnvironmentVariableCommand() + " && " + String.join(" ", executorCommand) ); }

Target:
protected List<String> getExecutorCommand(String containerId) { final Map<ExecutorPort, String> ports = KubernetesConstants.EXECUTOR_PORTS.entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().toString())); final Config configuration = getConfiguration(); final Config runtimeConfiguration = getRuntimeConfiguration(); final String[] executorCommand = SchedulerUtils.getExecutorCommand(configuration, runtimeConfiguration, containerId, ports); return Arrays.asList( "sh", "-c", KubernetesUtils.getFetchCommand(configuration, runtimeConfiguration) + " && " + setShardIdEnvironmentVariableCommand() + " && " + String.join(" ", executorCommand) ); }
Source:
private void updateCodePanel() { String input = info_.getSnippet(); String pattern = "\\$\\{([0-9]+):([^:=}]+)(=([^:}]+))?(:([^}]+))?\\}"; RegExp regExp = RegExp.compile(pattern, "g"); StringBuilder builder = new StringBuilder(); int inputIndex = 0; for (MatchResult matcher = regExp.exec(input); matcher != null; matcher = regExp.exec(input)) { if (matcher.getGroupCount() >= 2) { String key = matcher.getGroup(2); String value = matcher.getGroupCount() >= 4 ? matcher.getGroup(4) : null; String connStringField = matcher.getGroupCount() >= 6 ? matcher.getGroup(6) : null; if (value != null) { value = value.replaceAll("\\$colon\\$", ":"); value = value.replaceAll("\\$equal\\$", "="); } builder.append(input.substring(inputIndex, matcher.getIndex())); if (partsKeyValues_.containsKey(key)) { value = partsKeyValues_.get(key); } if (value != null) { if (connStringField != null) { builder.append(connStringField); builder.append("="); } builder.append(value); if (connStringField != null) { builder.append(";"); } } inputIndex = matcher.getIndex() + matcher.getGroup(0).length(); } } builder.append(input.substring(inputIndex, input.length())); codePanel_.setCode(builder.toString(), ""); }

Target:
private void updateCodePanel() { String input = info_.getSnippet(); RegExp regExp = RegExp.compile(pattern_, "g"); StringBuilder builder = new StringBuilder(); int inputIndex = 0; for (MatchResult matcher = regExp.exec(input); matcher != null; matcher = regExp.exec(input)) { if (matcher.getGroupCount() >= 2) { String key = matcher.getGroup(2); String value = matcher.getGroupCount() >= 4 ? matcher.getGroup(4) : null; String connStringField = matcher.getGroupCount() >= 6 ? matcher.getGroup(6) : null; if (value != null) { value = value.replaceAll("\\$colon\\$", ":"); value = value.replaceAll("\\$equal\\$", "="); } builder.append(input.substring(inputIndex, matcher.getIndex())); if (partsKeyValues_.containsKey(key)) { value = partsKeyValues_.get(key); } if (value != null) { if (connStringField != null) { builder.append(connStringField); builder.append("="); } builder.append(value); if (connStringField != null) { builder.append(";"); } } inputIndex = matcher.getIndex() + matcher.getGroup(0).length(); } } builder.append(input.substring(inputIndex, input.length())); codePanel_.setCode(builder.toString(), ""); }
Source:
private void fillContactDataFromQuery(String query, List<Recipient> recipients, Map<String, Recipient> recipientMap) { ContentResolver contentResolver = getContext().getContentResolver(); query = "%" + query + "%"; final String[] PROJECTION_NICKNAME = new String[]{ContactsContract.Data.CONTACT_ID, ContactsContract.CommonDataKinds.Nickname.NAME}; final int INDEX_CONTACT_ID = 0; final int INDEX_NICKNAME = 1; Uri queryUri = ContactsContract.CommonDataKinds.Email.CONTENT_URI; Uri queryUriForNickname = ContactsContract.Data.CONTENT_URI; Cursor cursorForNickname = contentResolver.query(queryUriForNickname, PROJECTION_NICKNAME, ContactsContract.CommonDataKinds.Nickname.NAME + " LIKE ? AND " + Data.MIMETYPE + " = '" + ContactsContract.CommonDataKinds.Nickname.CONTENT_ITEM_TYPE + "'", new String[] { query }, null); if (cursorForNickname != null && cursorForNickname.moveToFirst()) { while (!cursorForNickname.isAfterLast()) { String id = cursorForNickname.getString(INDEX_CONTACT_ID); String selection = ContactsContract.Data.CONTACT_ID + " = ?"; Cursor cursor = contentResolver.query(queryUri, PROJECTION, selection, new String[]{id}, SORT_ORDER); fillContactDataFromCursor(cursor, recipients, recipientMap, cursorForNickname.getString(INDEX_NICKNAME)); cursorForNickname.moveToNext(); } cursorForNickname.close(); } String selection = Contacts.DISPLAY_NAME_PRIMARY + " LIKE ? " + " OR (" + Email.ADDRESS + " LIKE ? AND " + Data.MIMETYPE + " = '" + Email.CONTENT_ITEM_TYPE + "')"; String[] selectionArgs = { query, query }; Cursor cursor = contentResolver.query(queryUri, PROJECTION, selection, selectionArgs, SORT_ORDER); if (cursor == null) { return; } fillContactDataFromCursor(cursor, recipients, recipientMap); if (observerContact != null) { observerContact = new ForceLoadContentObserver(); contentResolver.registerContentObserver(queryUri, false, observerContact); } }

Target:
private void fillContactDataFromQuery(String query, List<Recipient> recipients, Map<String, Recipient> recipientMap) { boolean foundValidCursor = false; foundValidCursor |= fillContactDataFromNickname(query, recipients, recipientMap); foundValidCursor |= fillContactDataFromNameAndEmail(query, recipients, recipientMap); if (foundValidCursor) { registerContentObserver(); } }
Source:
protected String tryResourceLookup(Resource resource) { try { Method lookup = Resource.class.getDeclaredMethod("lookup"); return (String) lookup.invoke(resource); } catch (NoSuchMethodException e) { return ""; } catch (IllegalAccessException e) { return ""; } catch (InvocationTargetException e) { return ""; } }

Target:
protected String tryResourceLookup(Resource resource) { try { Method lookup = Resource.class.getDeclaredMethod("lookup"); return (String) lookup.invoke(resource); } catch (Exception e) { return ""; } }
Source:
private LegacyLabelType(String name, List<LabelValue> values) { super(name, values); checkArgument(id.length() <= 4, "Invalid legacy label ID: \"%s\"", id); }

Target:
private LegacyLabelType(String name, List<LabelValue> values) { super(name, values); }
Source:
private ExpressionNode nestedBlock(final MethodBuilder builder) throws ProgramDefinitionError { SourceCoordinate coord = getCoordinate(); expect(NewBlock, DelimiterOpeningTag.class); builder.addArgument("$blockSelf", getEmptySource()); if (sym == Colon) { blockPattern(builder); } if (builder.getFirstOuterMethod() == null) { throw new java.lang.NullPointerException("The outer context of a block should never be null"); } String outerMethodName = stripColons(builder.getFirstOuterMethod(). getSignature().getString()); String blockSig = "λ" + outerMethodName + "@" + lexer.getCurrentLineNumber() + "@" + lexer.getCurrentColumn(); int argSize = builder.getNumberOfArguments(); for (int i = 1; i < argSize; i++) { blockSig += ":"; } builder.setSignature(symbolFor(blockSig)); ExpressionNode expressions = blockContents(builder); expect(EndBlock, DelimiterClosingTag.class); lastMethodsSourceSection = getSource(coord); return expressions; }

Target:
private ExpressionNode nestedBlock(final MethodBuilder builder) throws ProgramDefinitionError { SourceCoordinate coord = getCoordinate(); expect(NewBlock, DelimiterOpeningTag.class); builder.addArgument("$blockSelf", getEmptySource()); if (sym == Colon) { blockPattern(builder); } String outerMethodName = stripColons(builder.getOuterBuilder(). getSignature().getString()); String blockSig = "λ" + outerMethodName + "@" + coord.startLine + "@" + coord.startColumn; int argSize = builder.getNumberOfArguments(); for (int i = 1; i < argSize; i++) { blockSig += ":"; } builder.setSignature(symbolFor(blockSig)); ExpressionNode expressions = blockContents(builder); expect(EndBlock, DelimiterClosingTag.class); lastMethodsSourceSection = getSource(coord); return expressions; }
Source:
public int visit(IASTExpression expression) { if (!ctorDtorStack.empty()) { if (expression instanceof IASTFunctionCallExpression) { IASTFunctionCallExpression fCall = (IASTFunctionCallExpression) expression; IASTExpression fNameExp = fCall.getFunctionNameExpression(); IBinding fBinding = null; if (fNameExp instanceof IASTIdExpression) { IASTIdExpression fName = (IASTIdExpression) fNameExp; fBinding = fName.getName().resolveBinding(); } else if (fNameExp instanceof IASTFieldReference) { IASTFieldReference fName = (IASTFieldReference) fNameExp; if (referencesThis(fName.getFieldOwner())) fBinding = fName.getFieldName().resolveBinding(); } if (fBinding != null && fBinding instanceof ICPPMethod) { ICPPMethod method = (ICPPMethod) fBinding; if (method.isPureVirtual() || ClassTypeHelper.isVirtual(method)) { reportProblem(VIRTUAL_CALL_ID, expression); } } } } return PROCESS_CONTINUE; }

Target:
public int visit(IASTExpression expression) { if (!ctorDtorStack.empty() && ctorDtorStack.peek()) { if (expression instanceof IASTFunctionCallExpression) { IASTFunctionCallExpression fCall = (IASTFunctionCallExpression) expression; IASTExpression fNameExp = fCall.getFunctionNameExpression(); IBinding fBinding = null; IASTNode problemNode = expression; if (fNameExp instanceof IASTIdExpression) { IASTIdExpression fName = (IASTIdExpression) fNameExp; fBinding = fName.getName().resolveBinding(); } else if (fNameExp instanceof IASTFieldReference) { IASTFieldReference fName = (IASTFieldReference) fNameExp; problemNode = fName.getFieldName(); if (referencesThis(fName.getFieldOwner())) fBinding = fName.getFieldName().resolveBinding(); } if (fBinding instanceof ICPPMethod) { ICPPMethod method = (ICPPMethod) fBinding; if (method.isPureVirtual() || ClassTypeHelper.isVirtual(method)) { reportProblem(VIRTUAL_CALL_ID, problemNode); } } } } return PROCESS_CONTINUE; }
Source:
public PhoenixTTLRegionScanner(RegionCoprocessorEnvironment env, Scan scan, RegionScanner scanner) throws IOException { this.scan = scan; this.scanner = scanner; byte[] requestIdBytes = scan.getAttribute(MASK_PHOENIX_TTL_EXPIRED_REQUEST_ID_ATTR); this.requestId = Bytes.toLong(requestIdBytes); deleteIfExpired = ScanUtil.isDeleteTTLExpiredRows(scan); maskIfExpired = !deleteIfExpired && ScanUtil.isMaskTTLExpiredRows(scan); region = env.getRegion(); emptyCF = scan.getAttribute(EMPTY_COLUMN_FAMILY_NAME); emptyCQ = scan.getAttribute(EMPTY_COLUMN_QUALIFIER_NAME); byte[] txnScn = scan.getAttribute(BaseScannerRegionObserver.TX_SCN); if (txnScn != null) { TimeRange timeRange = scan.getTimeRange(); scan.setTimeRange(timeRange.getMin(), Bytes.toLong(txnScn)); } minTimestamp = scan.getTimeRange().getMin(); maxTimestamp = scan.getTimeRange().getMax(); now = maxTimestamp != HConstants.LATEST_TIMESTAMP ? maxTimestamp : EnvironmentEdgeManager.currentTimeMillis(); }

Target:
public PhoenixTTLRegionScanner(RegionCoprocessorEnvironment env, Scan scan, RegionScanner scanner) throws IOException { this.scan = scan; this.scanner = scanner; byte[] requestIdBytes = scan.getAttribute(MASK_PHOENIX_TTL_EXPIRED_REQUEST_ID_ATTR); this.requestId = Bytes.toString(requestIdBytes); deleteIfExpired = ScanUtil.isDeleteTTLExpiredRows(scan); maskIfExpired = !deleteIfExpired && ScanUtil.isMaskTTLExpiredRows(scan); region = env.getRegion(); emptyCF = scan.getAttribute(EMPTY_COLUMN_FAMILY_NAME); emptyCQ = scan.getAttribute(EMPTY_COLUMN_QUALIFIER_NAME); scanTableName = scan.getAttribute(BaseScannerRegionObserver.PHOENIX_TTL_SCAN_TABLE_NAME); byte[] txnScn = scan.getAttribute(BaseScannerRegionObserver.TX_SCN); if (txnScn != null) { TimeRange timeRange = scan.getTimeRange(); scan.setTimeRange(timeRange.getMin(), Bytes.toLong(txnScn)); } minTimestamp = scan.getTimeRange().getMin(); maxTimestamp = scan.getTimeRange().getMax(); now = maxTimestamp != HConstants.LATEST_TIMESTAMP ? maxTimestamp : EnvironmentEdgeManager.currentTimeMillis(); }
Source:
public void initialize() { windowSize = this.windowSizeOption.getValue(); alphaDrift = this.alphaDriftOption.getValue(); alphaWarning = this.alphaWarningOption.getValue(); storedPredictions = new byte[windowSize]; resetLearning(); System.out.println("STEPD - Parameters: Window Size = " + windowSize + ", Alpha Drift = " + alphaDrift + ", Alpha Warning = " + alphaWarning); }

Target:
public void initialize() { windowSize = this.windowSizeOption.getValue(); alphaDrift = this.alphaDriftOption.getValue(); alphaWarning = this.alphaWarningOption.getValue(); storedPredictions = new byte[windowSize]; resetLearning(); }
Source:
public void testSeekControlsPostAdBreak() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(2); eventEmitter.on(OnceUxEventType.END_AD_BREAK, new EventListener() { @Override public void processEvent(Event event) { Log.v(TAG, "END_AD_BREAK Emitted. Seeking from: " + progress); seekTo(40000); latch.countDown(); } }); eventEmitter.on(EventType.PROGRESS, new EventListener() { @Override public void processEvent(Event event) { if (progress > 39500) { if (progress < 41500) { Log.v(TAG, "Successful seek at: " + progress); latch.countDown(); } else { Log.v(TAG, "Too far."); } } else { Log.v(TAG, "Not far enough. "); } } }); mainActivity.getOnceUxPlugin().processVideo(adUrl, contentUrl); eventEmitter.emit(EventType.PLAY); assertTrue("Timeout occurred.", latch.await(2, TimeUnit.MINUTES)); brightcoveVideoView.stopPlayback(); }

Target:
public void testSeekControlsPostAdBreak() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(2); eventEmitter.on(OnceUxEventType.END_AD_BREAK, new EventListener() { @Override public void processEvent(Event event) { Log.v(TAG, "END_AD_BREAK Emitted. Seeking from: " + progress); seekTo(40000); latch.countDown(); } }); eventEmitter.on(EventType.PROGRESS, new EventListener() { @Override public void processEvent(Event event) { int playheadPositionBefore = 39500; int playheadPositionAfter = 41500; if (progress > playheadPositionBefore) { if (progress < playheadPositionAfter) { Log.v(TAG, "Successful seek at: " + progress); latch.countDown(); } else { Log.v(TAG, "Position has extended past the defined seek location."); } } else { Log.v(TAG, "Position has not yet reached the defined seek location."); } } }); mainActivity.getOnceUxPlugin().processVideo(adUrl, contentUrl); eventEmitter.emit(EventType.PLAY); assertTrue("Timeout occurred.", latch.await(2, TimeUnit.MINUTES)); brightcoveVideoView.stopPlayback(); }
Source:
public Object getResult() { if(resultField == null) { return ""; } try { return resultField.get(this); } catch (IllegalArgumentException e) { log.error("Cannot access result field"); } catch (IllegalAccessException e) { log.error("No permissions to access result field"); } return null; }

Target:
public Object getResult() { if (resultField == null) { return null; } try { return resultField.get(this); } catch (IllegalArgumentException e) { log.error("Cannot access result field"); } catch (IllegalAccessException e) { log.error("No permissions to access result field"); } return null; }
Source:
private boolean isCanadaFipsCountryCode (String countryCode) { return (StringUtils.isNotBlank(countryCode) && StringUtils.equalsIgnoreCase(countryCode, PaymentWorksConstants.COUNTRY_CODE_CANADA)); }

Target:
private boolean isCanadaFipsCountryCode (String countryCode) { return (StringUtils.equalsIgnoreCase(countryCode, PaymentWorksConstants.FIPS_COUNTRY_CODE_CANADA)); }
Source:
public WithBuilder<Q> withRecursive(final EntityPath<?> alias, Path<?>... columns) { final Expression<Object> columnsCombined = ExpressionUtils.list(Object.class, columns); final Expression<?> aliasCombined = Expressions.operation(alias.getType(), JPQLNextOps.WITH_RECURSIVE_COLUMNS, alias, columnsCombined); return new WithBuilder<Q>() { @Override public Q as(Expression expr) { Expression<?> flag = ExpressionUtils.operation(alias.getType(), JPQLNextOps.WITH_RECURSIVE_ALIAS, aliasCombined, expr); return queryMixin.addFlag(new QueryFlag(QueryFlag.Position.WITH, flag)); } }; }

Target:
public WithBuilder<Q> withRecursive(final EntityPath<?> alias, Path<?>... columns) { final Expression<Object> columnsCombined = ExpressionUtils.list(Object.class, columns); final Expression<?> aliasCombined = Expressions.operation(alias.getType(), JPQLNextOps.WITH_RECURSIVE_COLUMNS, alias, columnsCombined); return new WithBuilderImpl(JPQLNextOps.WITH_RECURSIVE_ALIAS, alias, aliasCombined); }
Source:
public static LocalDateTime combineDateTimeNew(String inputDate, String inputTimeHours) { if (inputDate == null || inputTimeHours == null) { return null; } DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy H.mm"); String dateTimeString; if ("24".equals(inputTimeHours)) { dateTimeString = inputDate + " 23.59"; } else { dateTimeString = inputDate + " " + inputTimeHours + ".00"; } try { return LocalDateTime.parse(dateTimeString, formatter); } catch (Exception e) { return null; } }

Target:
public static LocalDateTime combineDateTimeNew(String inputDate, String inputTimeHours) { if (inputDate == null || inputTimeHours == null) { return null; } DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy H.mm"); String dateTimeString; if ("24".equals(inputTimeHours)) { dateTimeString = inputDate + " 23.59"; } else { dateTimeString = inputDate + " " + inputTimeHours + ".00"; } try { return LocalDateTime.parse(dateTimeString, formatter); } catch (DateTimeParseException e) { return null; } }
Source:
protected Command getShowHideCompartmentCommand(ShowHideCompartmentRequest request) { if (getHost() instanceof TopGraphicEditPart) { List<?> views = getAllNotationViews((TopGraphicEditPart) getHost()); for (Iterator<?> iter = views.iterator(); iter.hasNext();) { View childView = (View) iter.next(); if (ViewUtil.isPropertySupported(childView, request.getPropertyID())) { if (childView.equals(request.getCompartment())) { if (request.getValue() instanceof Boolean && ((Boolean) request.getValue())) { getDiagramEventBroker().addNotificationListener(childView, listener); childlistened.add(childView); } else { getDiagramEventBroker().removeNotificationListener(childView, listener); childlistened.remove(childView); } return new ICommandProxy(new SetPropertyCommand(getEditingDomain(), new EObjectAdapter(childView), request.getPropertyID(), request.getPropertyName(), request.getValue())); } } } } return null; }

Target:
protected Command getShowHideCompartmentCommand(ShowHideCompartmentRequest request) { if (getHost() instanceof TopGraphicEditPart) { List<?> views = getAllNotationViews((TopGraphicEditPart) getHost()); for (Iterator<?> iter = views.iterator(); iter.hasNext();) { View childView = (View) iter.next(); if (ViewUtil.isPropertySupported(childView, request.getPropertyID())) { if (childView.equals(request.getCompartment())) { DiagramEventBroker diagramEventBroker = getDiagramEventBroker(); if (request.getValue() instanceof Boolean && null != diagramEventBroker) { if ((Boolean) request.getValue()) { diagramEventBroker.addNotificationListener(childView, listener); childlistened.add(childView); } else { diagramEventBroker.removeNotificationListener(childView, listener); childlistened.remove(childView); } } return new ICommandProxy(new SetPropertyCommand(getEditingDomain(), new EObjectAdapter(childView), request.getPropertyID(), request.getPropertyName(), request.getValue())); } } } } return null; }
Source:
private Configuration getConfiguration(SessionParams params) { Configuration config = new Configuration(); HardwareConfig hardwareConfig = params.getHardwareConfig(); ScreenSize screenSize = hardwareConfig.getScreenSize(); if (screenSize != null) { switch (screenSize) { case SMALL: config.screenLayout |= 0x1; break; case NORMAL: config.screenLayout |= 0x2; break; case LARGE: config.screenLayout |= 0x3; break; case XLARGE: config.screenLayout |= 0x4; } } Density density = hardwareConfig.getDensity(); if (density == null) { density = Density.MEDIUM; } config.screenWidthDp = (hardwareConfig.getScreenWidth() / density.getDpiValue()); config.screenHeightDp = (hardwareConfig.getScreenHeight() / density.getDpiValue()); if (config.screenHeightDp < config.screenWidthDp) { config.smallestScreenWidthDp = config.screenHeightDp; } else { config.smallestScreenWidthDp = config.screenWidthDp; } config.densityDpi = density.getDpiValue(); config.compatScreenWidthDp = config.screenWidthDp; config.compatScreenHeightDp = config.screenHeightDp; ScreenOrientation orientation = hardwareConfig.getOrientation(); if (orientation != null) { switch (orientation) { case PORTRAIT: config.orientation = 1; break; case LANDSCAPE: config.orientation = 2; break; case SQUARE: config.orientation = 3; } } else { config.orientation = 0; } return config; }

Target:
private static Configuration getConfiguration(SessionParams params) { Configuration config = new Configuration(); HardwareConfig hardwareConfig = params.getHardwareConfig(); ScreenSize screenSize = hardwareConfig.getScreenSize(); if (screenSize != null) { switch (screenSize) { case SMALL: config.screenLayout |= 0x1; break; case NORMAL: config.screenLayout |= 0x2; break; case LARGE: config.screenLayout |= 0x3; break; case XLARGE: config.screenLayout |= 0x4; } } Density density = hardwareConfig.getDensity(); if (density == null) { density = Density.MEDIUM; } config.screenWidthDp = (hardwareConfig.getScreenWidth() / density.getDpiValue()); config.screenHeightDp = (hardwareConfig.getScreenHeight() / density.getDpiValue()); if (config.screenHeightDp < config.screenWidthDp) { config.smallestScreenWidthDp = config.screenHeightDp; } else { config.smallestScreenWidthDp = config.screenWidthDp; } config.densityDpi = density.getDpiValue(); config.compatScreenWidthDp = config.screenWidthDp; config.compatScreenHeightDp = config.screenHeightDp; ScreenOrientation orientation = hardwareConfig.getOrientation(); if (orientation != null) { switch (orientation) { case PORTRAIT: config.orientation = 1; break; case LANDSCAPE: config.orientation = 2; break; case SQUARE: config.orientation = 3; } } else { config.orientation = 0; } return config; }
Source:
private static void sendOneZipEntry(ZipOutputStream zos, VirtualFile vf, String relativePath) throws IOException { ZipEntry e = new ZipEntry(relativePath.replace('\\', '/')); e.setTime(vf.lastModified()); zos.putNextEntry(e); try (InputStream in = vf.open()) { IOUtils.copy(in, zos); } zos.closeEntry(); }

Target:
private static void sendOneZipEntry(ZipOutputStream zos, VirtualFile vf, String relativePath) throws IOException { ZipEntry e = new ZipEntry(relativePath.replace('\\', '/')); e.setTime(vf.lastModified()); zos.putNextEntry(e); try (InputStream in = vf.open()) { IOUtils.copy(in, zos); } finally { zos.closeEntry(); } }
Source:
public static void setVmHook(VMHook vmHook) { logger.warn("This deprecated method doesn't set VM hook. Define your hook component as a Spring bean."); }

Target:
public static void setVmHook(VMHook vmHook) { logger.warn("VM.setVmHook(VMHook vmHook) is deprecated method. Define your hook component as a Spring bean."); BackwardCompatibilityVmHook.setDeprecatedHook(vmHook); }
Source:
public void call(final Subscriber<? super Cursor> subscriber) { final ContentResolver contentResolver = context.getContentResolver(); final DefaultContentObserver observer = new DefaultContentObserver(new Handler(Looper.getMainLooper())) { @Override public void onChange(boolean selfChange) { worker.schedule(new Action0() { @Override public void call() { subscriber.onNext(getCursor()); } }); } }; final Subscription subscription = AndroidSubscriptions.unsubscribeInUiThread(new Action0() { @Override public void call() { contentResolver.unregisterContentObserver(observer); } }); worker.schedule(new Action0() { @Override public void call() { subscriber.onNext(getCursor()); } }); contentResolver.registerContentObserver(uri, true, observer); subscriber.add(subscription); }

Target:
public void call(final Subscriber<? super Cursor> subscriber) { final DefaultContentObserver observer = new DefaultContentObserver(new Handler(Looper.getMainLooper())) { @Override public void onChange(boolean selfChange) { worker.schedule(new Action0() { @Override public void call() { subscriber.onNext(executeQuery()); } }); } }; final Subscription subscription = Subscriptions.create(new Action0() { @Override public void call() { resolver.unregisterContentObserver(observer); } }); worker.schedule(new Action0() { @Override public void call() { subscriber.onNext(executeQuery()); } }); resolver.registerContentObserver(uri, true, observer); subscriber.add(subscription); }
Source:
public void getSlotsEligibleReturnsSlotsThatWereNotRolled() { slotStateManager.createOrUpdateForSlotAndMillisecond(0, 1234L); List<Integer> slots = slotStateManager.getSlotsEligibleForRollup(2346L, 0, 1); assertNotNull(slots); assertEquals(1, slots.size()); assertEquals(0, slots.get(0).intValue()); }

Target:
public void getSlotsEligibleReturnsSlotsThatWereNotRolled() { slotStateManager.createOrUpdateForSlotAndMillisecond(0, 1234L); List<Integer> slots = slotStateManager.getSlotsEligibleForRollup(2346L, 0, 1); assertNotNull(slots); assertEquals("Only one slot should be returned", 1, slots.size()); assertEquals("Slot zero should be included", 0, slots.get(0).intValue()); }
Source:
public static PythonDependencyInfo create(PythonConfig pythonConfig, DistributedCache distributedCache) { Map<String, String> pythonFiles = new HashMap<>(); Map<String, String> filesIdToFilesName = pythonConfig.getPythonFilesInfo(); for (Map.Entry<String, String> entry: filesIdToFilesName.entrySet()) { File pythonFile = distributedCache.getFile(entry.getKey()); String filePath = pythonFile.getAbsolutePath(); pythonFiles.put(filePath, entry.getValue()); } String requirementsFilePath = null; String requirementsCacheDir = null; if (pythonConfig.getPythonRequirementsFileInfo().isPresent()) { requirementsFilePath = distributedCache.getFile( pythonConfig.getPythonRequirementsFileInfo().get()).getAbsolutePath(); if (pythonConfig.getPythonRequirementsCacheDirInfo().isPresent()) { requirementsCacheDir = distributedCache.getFile( pythonConfig.getPythonRequirementsCacheDirInfo().get()).getAbsolutePath(); } } Map<String, String> archives = new HashMap<>(); Map<String, String> archivesMap = pythonConfig.getPythonArchivesInfo(); for (Map.Entry<String, String> entry: archivesMap.entrySet()) { String archiveFilePath = distributedCache.getFile(entry.getKey()).getAbsolutePath(); String targetPath = entry.getValue(); archives.put(archiveFilePath, targetPath); } String pythonExec = pythonConfig.getPythonExec(); return new PythonDependencyInfo( pythonFiles, requirementsFilePath, requirementsCacheDir, archives, pythonExec); }

Target:
public static PythonDependencyInfo create(PythonConfig pythonConfig, DistributedCache distributedCache) { Map<String, String> pythonFiles = new HashMap<>(); for (Map.Entry<String, String> entry: pythonConfig.getPythonFilesInfo().entrySet()) { File pythonFile = distributedCache.getFile(entry.getKey()); String filePath = pythonFile.getAbsolutePath(); pythonFiles.put(filePath, entry.getValue()); } String requirementsFilePath = null; String requirementsCacheDir = null; if (pythonConfig.getPythonRequirementsFileInfo().isPresent()) { requirementsFilePath = distributedCache.getFile( pythonConfig.getPythonRequirementsFileInfo().get()).getAbsolutePath(); if (pythonConfig.getPythonRequirementsCacheDirInfo().isPresent()) { requirementsCacheDir = distributedCache.getFile( pythonConfig.getPythonRequirementsCacheDirInfo().get()).getAbsolutePath(); } } Map<String, String> archives = new HashMap<>(); for (Map.Entry<String, String> entry: pythonConfig.getPythonArchivesInfo().entrySet()) { String archiveFilePath = distributedCache.getFile(entry.getKey()).getAbsolutePath(); String targetPath = entry.getValue(); archives.put(archiveFilePath, targetPath); } String pythonExec = pythonConfig.getPythonExec(); return new PythonDependencyInfo( pythonFiles, requirementsFilePath, requirementsCacheDir, archives, pythonExec); }
Source:
private void setDiskImageActiveBySnapshotType(Map<Guid, List<DiskImage>> diskImageMap, Snapshot snapshot) { List<DiskImage> diskImages = diskImageMap.get(snapshot.getId()); if (diskImages == null) { return; } diskImages.forEach(diskImage -> diskImage.setActive(snapshot.getType() == SnapshotType.ACTIVE || snapshot.getType() == SnapshotType.PREVIEW)); diskImageMap.remove(snapshot.getId()); }

Target:
private void setDiskImageActiveBySnapshotType(Map<Guid, List<DiskImage>> diskImageMap, Snapshot snapshot) { List<DiskImage> diskImages = diskImageMap.get(snapshot.getId()); if (diskImages == null) { return; } boolean isActiveSnapshotType = snapshot.getType() == SnapshotType.ACTIVE || snapshot.getType() == SnapshotType.PREVIEW; diskImages.forEach(diskImage -> diskImage.setActive(isActiveSnapshotType)); diskImageMap.remove(snapshot.getId()); }
Source:
public Iterator<String> getKeys(final String prefix) { return new Iterator<String>() { Iterator<String> iter = getKeys(); String next; String prev; { while (iter.hasNext()) { next = iter.next(); if (next.startsWith(prefix)) { break; } else { next = null; } } } @Override public boolean hasNext() { return next != null; } @Override public String next() { if (next == null) { throw new IllegalStateException(); } prev = next; while (iter.hasNext()) { next = iter.next(); if (next.startsWith(prefix)) { break; } else { next = null; } } if (next != null && next.equals(prev)) { next = null; } return prev; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }

Target:
public Iterator<String> getKeys(final String prefix) { return new Iterator<String>() { Iterator<String> iter = getKeys(); String next; { while (iter.hasNext()) { next = iter.next(); if (next.startsWith(prefix)) { break; } else { next = null; } } } @Override public boolean hasNext() { return next != null; } @Override public String next() { if (next == null) { throw new IllegalStateException(); } String current = next; next = null; while (iter.hasNext()) { next = iter.next(); if (next.startsWith(prefix)) { break; } else { next = null; } } return current; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }
Source:
public void onEntityConstructing(AttachCapabilitiesEvent<Entity> e) { Entity obj = e.getObject(); if (obj instanceof EntityPlayer && !(obj instanceof FakePlayer)) { EntityPlayer player = (EntityPlayer) obj; e.addCapability(ResourceHelperDE.getResource("toggleShield"), new PlayerCapabilitiesProvider()); } }

Target:
public void onEntityConstructing(AttachCapabilitiesEvent<Entity> e) { Entity obj = e.getObject(); if (obj instanceof EntityPlayer && !(obj instanceof FakePlayer)) { EntityPlayer player = (EntityPlayer) obj; e.addCapability(ResourceHelperDE.getResource("toggle_shield"), new ShieldStateProvider()); } }
Source:
public void call(Subscriber<? super R> s) { Observable<? extends T>[] sources = this.sources; int count = 0; if (sources == null) { if (sourcesIterable instanceof List) { sources = (Observable[])(((List)sourcesIterable).toArray(EMPTY)); count = sources.length; } else { sources = new Observable[8]; for (Observable<? extends T> p : sourcesIterable) { if (count == sources.length) { Observable<? extends T>[] b = new Observable[count + (count >> 2)]; System.arraycopy(sources, 0, b, 0, count); sources = b; } sources[count++] = p; } } } else { count = sources.length; } if (count == 0) { s.onCompleted(); return; } LatestCoordinator<T, R> lc = new LatestCoordinator<T, R>(s, combiner, count, bufferSize, delayError); lc.subscribe(sources); }

Target:
public void call(Subscriber<? super R> s) { Observable<? extends T>[] sources = this.sources; int count = 0; if (sources == null) { if (sourcesIterable instanceof List) { List list = (List)sourcesIterable; sources = (Observable[])list.toArray(new Observable[list.size()]); count = sources.length; } else { sources = new Observable[8]; for (Observable<? extends T> p : sourcesIterable) { if (count == sources.length) { Observable<? extends T>[] b = new Observable[count + (count >> 2)]; System.arraycopy(sources, 0, b, 0, count); sources = b; } sources[count++] = p; } } } else { count = sources.length; } if (count == 0) { s.onCompleted(); return; } LatestCoordinator<T, R> lc = new LatestCoordinator<T, R>(s, combiner, count, bufferSize, delayError); lc.subscribe(sources); }
Source:
public static <T> WeldInjectionTarget<T> createInjectionTarget(Class<?> componentClass, Bean<T> bean, BeanManagerImpl beanManager, boolean interceptionSupport) { final ClassTransformer transformer = beanManager.getServices().get(ClassTransformer.class); @SuppressWarnings("unchecked") final Class<T> clazz = (Class<T>) componentClass; EnhancedAnnotatedType<T> type = transformer.getEnhancedAnnotatedType(clazz, beanManager.getId()); if (!type.getJavaClass().equals(componentClass)) { final ClassLoader classLoader; if (WildFlySecurityManager.isChecking()) { classLoader = AccessController.doPrivileged((PrivilegedAction<ClassLoader>) () -> componentClass.getClassLoader()); } else { classLoader = componentClass.getClassLoader(); } final String bdaId = beanManager.getId() + classLoader.hashCode(); type = transformer.getEnhancedAnnotatedType(clazz, bdaId); } if (Beans.getBeanConstructor(type) == null) { return beanManager.getInjectionTargetFactory(type).createNonProducibleInjectionTarget(); } WeldInjectionTargetBuilder<T> builder = beanManager.createInjectionTargetBuilder(type); builder.setBean(bean); builder.setResourceInjectionEnabled(false); if (interceptionSupport) { return builder.build(); } else { return builder.setInterceptionEnabled(false).setTargetClassLifecycleCallbacksEnabled(false).setDecorationEnabled(false).build(); } }

Target:
public static <T> WeldInjectionTarget<T> createInjectionTarget(Class<?> componentClass, Bean<T> bean, BeanManagerImpl beanManager, boolean interceptionSupport) { final ClassTransformer transformer = beanManager.getServices().get(ClassTransformer.class); @SuppressWarnings("unchecked") final Class<T> clazz = (Class<T>) componentClass; EnhancedAnnotatedType<T> type = transformer.getEnhancedAnnotatedType(clazz, beanManager.getId()); if (!type.getJavaClass().equals(componentClass)) { final ClassLoader classLoader = WildFlySecurityManager.isChecking() ? doPrivileged(new GetClassLoaderAction(componentClass)) : componentClass.getClassLoader(); final String bdaId = beanManager.getId() + classLoader.hashCode(); type = transformer.getEnhancedAnnotatedType(clazz, bdaId); } if (Beans.getBeanConstructor(type) == null) { return beanManager.getInjectionTargetFactory(type).createNonProducibleInjectionTarget(); } WeldInjectionTargetBuilder<T> builder = beanManager.createInjectionTargetBuilder(type); builder.setBean(bean); builder.setResourceInjectionEnabled(false); if (interceptionSupport) { return builder.build(); } else { return builder.setInterceptionEnabled(false).setTargetClassLifecycleCallbacksEnabled(false).setDecorationEnabled(false).build(); } }
Source:
private void checkIfPathContainsShardingKey(String path) { if (!path.startsWith(_zkRealmShardingKey)) { throw new IllegalArgumentException( "Given path: " + path + " does not match the sharding key: " + _zkRealmShardingKey + " for this DedicatedZkClient!"); } }

Target:
private void checkIfPathContainsShardingKey(String path) { try { String zkRealmForPath = _metadataStoreRoutingData.getMetadataStoreRealm(path); if (!_zkRealmAddress.equals(zkRealmForPath)) { throw new IllegalArgumentException("Given path: " + path + "'s ZK realm: " + zkRealmForPath + " does not match the ZK realm: " + _zkRealmAddress + " and sharding key: " + _zkRealmShardingKey + " for this DedicatedZkClient!"); } } catch (NoSuchElementException e) { throw new IllegalArgumentException( "Given path: " + path + " does not have a valid sharding key!"); } }
Source:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); StudentAttributes student = null; if (userInfo == null) { Optional<StudentAttributes> studentCheck = getUnregisteredStudent(); if (studentCheck.isPresent()) { student = studentCheck.get(); } } else if (userInfo.isInstructor) { String studentEmail = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); student = logic.getStudentForEmail(courseId, studentEmail); } else if (userInfo.isStudent) { student = logic.getStudentForGoogleId(courseId, userInfo.id); } if (student == null) { return new JsonResult("No student found", HttpStatus.SC_NOT_FOUND); } StudentData studentData = new StudentData(student); if (userInfo == null || userInfo.isStudent) { studentData.setComments(null); studentData.setJoinState(null); } return new JsonResult(studentData); }

Target:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); StudentAttributes student = null; String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); if (studentEmail == null) { student = getUnregisteredStudent().orElseGet(() -> { if (userInfo == null) { return null; } return logic.getStudentForGoogleId(courseId, userInfo.id); }); } else { student = logic.getStudentForEmail(courseId, studentEmail); } if (student == null) { return new JsonResult(STUDENT_NOT_FOUND, HttpStatus.SC_NOT_FOUND); } StudentData studentData = new StudentData(student); if (studentEmail == null) { studentData.setComments(null); studentData.setJoinState(null); } return new JsonResult(studentData); }
Source:
public void disconnectContentType(@NonNull IContentType contentType) { for (IPath path : connectedDocuments.keySet()) { IFile[] foundFiles = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(path.toFile().toURI()); if(foundFiles.length != 0) { try { if (contentType.equals(foundFiles[0].getContentDescription().getContentType())) { disconnect(path); } } catch (CoreException e) { LanguageServerPlugin.logError( "Error occured while disabling Language Server for content type " + contentType, e); } } } }

Target:
public void disconnectContentType(@NonNull IContentType contentType) { for (IPath path : connectedDocuments.keySet()) { IFile[] foundFiles = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(path.toFile().toURI()); if(foundFiles.length != 0) { if (LSPEclipseUtils.getFileContentTypes(foundFiles[0]).stream() .anyMatch(foundContentType -> contentType.equals(foundContentType))) { disconnect(path); } } } }
Source:
public void setHint(final String hint, final Serializable... args) { String currHint = getHint(); if (!Objects.equals(hint, currHint)) { getOrCreateComponentModel().hint = I18nUtilities.asMessage(hint, args); } }

Target:
public void setHint(final String hint, final Serializable... args) { Serializable currHint = getComponentModel().hint; Serializable hintToBeSet = I18nUtilities.asMessage(hint, args); if (!Objects.equals(hintToBeSet, currHint)) { getOrCreateComponentModel().hint = hintToBeSet; } }
Source:
private static RefundGatewayRequest buildRefundRequest(ChargeEntity chargeEntity, Long refundAmount){ return RefundGatewayRequest.valueOf(new RefundEntity(chargeEntity, refundAmount, null)); }

Target:
private static RefundGatewayRequest buildRefundRequest(ChargeEntity chargeEntity, Long refundAmount){ return RefundGatewayRequest.valueOf(new RefundEntity(chargeEntity, refundAmount, userExternalId)); }
Source:
public AnalyzedKill analyze(KillStatement<Expression> killStatement, Function<ParameterExpression, Symbol> convertParamFunction, CoordinatorTxnCtx txnCtx) { var exprAnalyzerWithoutFields = new ExpressionAnalyzer( functions, txnCtx, convertParamFunction, FieldProvider.UNSUPPORTED, null); Symbol jobId; if (killStatement.jobId() != null) { jobId = exprAnalyzerWithoutFields.convert( killStatement.jobId(), new ExpressionAnalysisContext()); } else { jobId = null; } return new AnalyzedKill(jobId); }

Target:
public AnalyzedKill analyze(KillStatement<Expression> killStatement, Function<ParameterExpression, Symbol> convertParamFunction, CoordinatorTxnCtx txnCtx) { Symbol jobId; if (killStatement.jobId() != null) { var exprAnalyzerWithoutFields = new ExpressionAnalyzer( functions, txnCtx, convertParamFunction, FieldProvider.UNSUPPORTED, null); jobId = exprAnalyzerWithoutFields.convert( killStatement.jobId(), new ExpressionAnalysisContext()); } else { jobId = null; } return new AnalyzedKill(jobId); }