auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void notifyListeners(Repository repository, IndexDiffData indexDiffData) { IndexDiffChangedListener[] tmpListeners; synchronized (listeners) { tmpListeners = listeners .toArray(new IndexDiffChangedListener[listeners.size()]); } for (int i = 0; i < tmpListeners.length; i++) { tmpListeners[i].indexDiffChanged(repository, indexDiffData); } }

Target:
private void notifyListeners(Repository repository, IndexDiffData indexDiffData) { IndexDiffChangedListener[] tmpListeners; synchronized (listeners) { tmpListeners = listeners .toArray(new IndexDiffChangedListener[listeners.size()]); } for (int i = 0; i < tmpListeners.length; i++) tmpListeners[i].indexDiffChanged(repository, indexDiffData); }
Source:
private void createImageForMemoryDump() { StorageDomainStatic storageDomainStatic = DbFacade.getInstance().getStorageDomainStaticDao().get(storageDomainId); VDSReturnValue retVal = Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.CreateImage, new CreateImageVDSCommandParameters( storagePool.getId(), storageDomainId, memoryDumpImageGroupId, vm.getTotalMemorySizeInBytes(), HibernateVmCommand.getMemoryVolumeTypeForPool(storageDomainStatic.getStorageType()), VolumeFormat.RAW, memoryDumpVolumeId, "")); if (!retVal.getSucceeded()) { throw new VdcBLLException(VdcBllErrors.VolumeCreationError, "Failed to create image for memory!"); } Guid taskId = enclosingCommand.persistAsyncTaskPlaceHolder(CREATE_IMAGE_FOR_MEMORY_DUMP_TASK_KEY); Guid guid = enclosingCommand.createTask(taskId, retVal.getCreationInfo(), enclosingCommand.getActionType(), VdcObjectType.Storage, storageDomainId); enclosingCommand.getTaskIdList().add(guid); }

Target:
private void createImageForMemoryDump() { StorageDomainStatic storageDomainStatic = DbFacade.getInstance().getStorageDomainStaticDao().get(storageDomainId); VDSReturnValue retVal = Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.CreateImage, new CreateImageVDSCommandParameters( storagePool.getId(), storageDomainId, memoryDumpImageGroupId, vm.getTotalMemorySizeInBytes(), HibernateVmCommand.getMemoryVolumeTypeForStorageDomain(storageDomainStatic.getStorageType()), VolumeFormat.RAW, memoryDumpVolumeId, "")); if (!retVal.getSucceeded()) { throw new VdcBLLException(VdcBllErrors.VolumeCreationError, "Failed to create image for memory!"); } Guid taskId = enclosingCommand.persistAsyncTaskPlaceHolder(CREATE_IMAGE_FOR_MEMORY_DUMP_TASK_KEY); Guid guid = enclosingCommand.createTask(taskId, retVal.getCreationInfo(), enclosingCommand.getActionType(), VdcObjectType.Storage, storageDomainId); enclosingCommand.getTaskIdList().add(guid); }
Source:
protected void setOrdinal(int ordinal, boolean forced) { if (forced) { this.ordinal = ordinal; } }

Target:
protected void setOrdinal(int ordinal, boolean forced) { if (forced) { this.ordinal = ordinal; } else { setOrdinal(ordinal); } }
Source:
public Response add(GlusterBricks bricks) { for (GlusterBrick brick : bricks.getGlusterBricks()) { validateParameters(brick, "serverId", "brickDir"); } List<GlusterBrickEntity> brickEntities = mapBricks(asGuid(getVolumeId()), bricks); int replicaCount = bricks.isSetNewReplicaCount() ? bricks.getNewReplicaCount() : 0; int stripeCount = bricks.isSetNewStripeCount() ? bricks.getNewStripeCount() : 0; return performCreationMultiple(VdcActionType.AddBricksToGlusterVolume, new GlusterVolumeBricksActionParameters(asGuid(getVolumeId()), brickEntities, replicaCount, stripeCount), new QueryIdResolver(VdcQueryType.GetGlusterBrickById, IdQueryParameters.class)); }

Target:
public Response add(GlusterBricks bricks) { for (GlusterBrick brick : bricks.getGlusterBricks()) { validateParameters(brick, "serverId", "brickDir"); } List<GlusterBrickEntity> brickEntities = mapBricks(asGuid(getVolumeId()), bricks); int replicaCount = bricks.isSetReplicaCount() ? bricks.getReplicaCount() : 0; int stripeCount = bricks.isSetStripeCount() ? bricks.getStripeCount() : 0; return performCreationMultiple(VdcActionType.AddBricksToGlusterVolume, new GlusterVolumeBricksActionParameters(asGuid(getVolumeId()), brickEntities, replicaCount, stripeCount), new QueryIdResolver(VdcQueryType.GetGlusterBrickById, IdQueryParameters.class)); }
Source:
public void leaderCanProcessMultiClientLeaderTimeRequest() { TestableTimelockServer leader = cluster.currentLeaderFor(client.namespace()); MultiClientConjureTimelockService multiClientConjureTimelockService = leader.multiClientService(); Set<String> expectedNamespaces = ImmutableSet.of("alpha", "beta"); List<NamespacedLeaderTime> leaderTimes = multiClientConjureTimelockService.leaderTimes(AUTH_HEADER, expectedNamespaces); Set<String> namespaces = leaderTimes.stream().map(NamespacedLeaderTime::getNamespace).collect(Collectors.toSet()); assertThat(namespaces).hasSameElementsAs(expectedNamespaces); Set<LeadershipId> leadershipIds = leaderTimes.stream() .map(NamespacedLeaderTime::getLeaderTime) .map(LeaderTime::id) .collect(Collectors.toSet()); assertThat(leadershipIds).hasSameSizeAs(expectedNamespaces); }

Target:
public void leaderCanProcessMultiClientLeaderTimeRequest() { TestableTimelockServer leader = cluster.currentLeaderFor(client.namespace()); MultiClientConjureTimelockService multiClientConjureTimelockService = leader.multiClientService(); Set<String> expectedNamespaces = ImmutableSet.of("alpha", "beta"); List<NamespacedLeaderTime> leaderTimes = multiClientConjureTimelockService.leaderTimes(AUTH_HEADER, expectedNamespaces); Set<String> namespaces = leaderTimes.stream().map(NamespacedLeaderTime::getNamespace).collect(Collectors.toSet()); assertThat(namespaces).hasSameElementsAs(expectedNamespaces); Set<UUID> leadershipIds = leaderTimes.stream() .map(NamespacedLeaderTime::getLeaderTime) .map(LeaderTime::id) .map(LeadershipId::id) .collect(Collectors.toSet()); assertThat(leadershipIds).hasSameSizeAs(expectedNamespaces); }
Source:
public static <T> BinaryOperator<T> ensureOnlyOne() { return (a, b) -> { throw new IllegalArgumentException(Messages.format("Duplicates found: and {}", a, b)); }; }

Target:
public static <T> BinaryOperator<T> ensureOnlyOne() { return (a, b) -> { throw new IllegalArgumentException(Messages.format( "Multiple values found where only one was expected: and {}", a, b)); }; }
Source:
private void waitUntilCheck(Predicate<JsonRpcClient> check, String formatBefore, String formatAfter) throws InterruptedException { if (logger.isDebugEnabled()) { logger.debug(formatBefore, client.getHostname()); } int retries = 50; while (check.test(this.client)) { if (retries == 0) { throw new VDSNetworkException("Unable to reconnect to " + client.getHostname() + " after policy reset"); } retries--; TimeUnit.MILLISECONDS.sleep(200); } if (logger.isDebugEnabled()) { logger.debug(formatAfter, client.getHostname()); } }

Target:
private void waitUntilCheck(Predicate<JsonRpcClient> check, String formatBefore, String formatAfter) throws InterruptedException { String hostname = client.getHostname(); if (logger.isDebugEnabled()) { logger.debug(formatBefore, hostname); } int retries = 50; while (check.test(this.client)) { if (retries == 0) { throw new VDSNetworkException("Unable to reconnect to " + hostname + " after policy reset"); } retries--; TimeUnit.MILLISECONDS.sleep(200); } if (logger.isDebugEnabled()) { logger.debug(formatAfter, hostname); } }
Source:
protected State collectInput() { String filePatterns = listPresetFilePatterns_.getValue( listPresetFilePatterns_.getSelectedIndex()); if (filePatterns == "custom") filePatterns = txtFilePattern_.getText(); ArrayList<String> list = new ArrayList<String>(); for (String pattern : filePatterns.split(",")) { String trimmedPattern = pattern.trim(); if (trimmedPattern.length() > 0) list.add(trimmedPattern); } String excludeFilePatterns = listPresetExcludeFilePatterns_.getValue( listPresetExcludeFilePatterns_.getSelectedIndex()); if (excludeFilePatterns == "custom") excludeFilePatterns = txtExcludeFilePattern_.getText(); ArrayList<String> excludeList = new ArrayList<String>(); for (String pattern : excludeFilePatterns.split(",")) { String trimmedPattern = pattern.trim(); if (trimmedPattern.length() > 0) excludeList.add(trimmedPattern); } return State.createState(txtSearchPattern_.getText(), getEffectivePath().getPath(), checkboxRegex_.getValue(), checkboxCaseSensitive_.getValue(), JsUtil.toJsArrayString(list), JsUtil.toJsArrayString(excludeList)); }

Target:
protected State collectInput() { String includeFilePatterns = listPresetFilePatterns_.getValue( listPresetFilePatterns_.getSelectedIndex()); if (includeFilePatterns == "custom") includeFilePatterns = txtFilePattern_.getText(); ArrayList<String> list = new ArrayList<String>(); for (String pattern : includeFilePatterns.split(",")) { String trimmedPattern = pattern.trim(); if (trimmedPattern.length() > 0) list.add(trimmedPattern); } String excludeFilePatterns = listPresetExcludeFilePatterns_.getValue( listPresetExcludeFilePatterns_.getSelectedIndex()); if (StringUtil.equals(excludeFilePatterns, "custom")) excludeFilePatterns = txtExcludeFilePattern_.getText(); ArrayList<String> excludeList = new ArrayList<String>(); for (String pattern : excludeFilePatterns.split(",")) { String trimmedPattern = pattern.trim(); if (trimmedPattern.length() > 0) excludeList.add(trimmedPattern); } return State.createState(txtSearchPattern_.getText(), getEffectivePath().getPath(), checkboxRegex_.getValue(), checkboxCaseSensitive_.getValue(), JsUtil.toJsArrayString(list), JsUtil.toJsArrayString(excludeList)); }
Source:
public static void refreshSizeEstimates(String keyspace, String table) throws Exception { long deadline = System.nanoTime() + REFRESH_SIZE_ESTIMATES_TIMEOUT.roundTo(NANOSECONDS); while (System.nanoTime() < deadline) { flushTable(keyspace, table); refreshSizeEstimates(); List<SizeEstimate> sizeEstimates = getSession().getSizeEstimates(keyspace, table); if (!sizeEstimates.isEmpty()) { log.info("Size estimates for the table %s.%s have been refreshed successfully: %s", keyspace, table, sizeEstimates); return; } log.info("Size estimates haven't been refreshed as expected. Retrying ..."); } throw new TimeoutException(format("Size estimates refresh for the table %s.%s has been timed out after %s", keyspace, table, REFRESH_SIZE_ESTIMATES_TIMEOUT)); }

Target:
public static void refreshSizeEstimates(String keyspace, String table) throws Exception { long deadline = System.nanoTime() + REFRESH_SIZE_ESTIMATES_TIMEOUT.roundTo(NANOSECONDS); while (System.nanoTime() < deadline) { flushTable(keyspace, table); refreshSizeEstimates(); List<SizeEstimate> sizeEstimates = getSession().getSizeEstimates(keyspace, table); if (!sizeEstimates.isEmpty()) { log.info("Size estimates for the table %s.%s have been refreshed successfully: %s", keyspace, table, sizeEstimates); return; } log.info("Size estimates haven't been refreshed as expected. Retrying ..."); } throw new TimeoutException(format("Attempting to refresh size estimates for table %s.%s has timed out after %s", keyspace, table, REFRESH_SIZE_ESTIMATES_TIMEOUT)); }
Source:
public void mergeRequests(long ts, Request baseRequest, Request mergedRequest) { int mergedQuark = removeWaitingRequest(ts, mergedRequest.getSector()); Long baseSector = baseRequest.getSector(); baseRequest.mergeRequest(mergedRequest); int baseQuark = updateWaitingRequest(ts, baseRequest, baseSector); if (mergedQuark != ITmfStateSystem.INVALID_ATTRIBUTE) { try { int issuedFromQuark = fSs.getQuarkRelativeAndAdd(mergedQuark, Attributes.MERGED_IN); fSs.modifyAttribute(ts, fSs.getAttributeName(baseQuark), issuedFromQuark); } catch (StateValueTypeException e) { Activator.getDefault().logError("Error adding the merged request information", e); } } updateQueuesLength(ts); }

Target:
public void mergeRequests(long ts, Request baseRequest, Request mergedRequest) { int mergedQuark = removeWaitingRequest(ts, mergedRequest.getSector()); Long baseSector = baseRequest.getSector(); baseRequest.mergeRequest(mergedRequest); int baseQuark = updateWaitingRequest(ts, baseRequest, baseSector); if (mergedQuark != ITmfStateSystem.INVALID_ATTRIBUTE) { try { int issuedFromQuark = fSs.getQuarkRelativeAndAdd(mergedQuark, Attributes.MERGED_IN); fSs.modifyAttribute(ts, Integer.parseInt(fSs.getAttributeName(baseQuark)), issuedFromQuark); } catch (StateValueTypeException e) { Activator.getDefault().logError("Error adding the merged request information", e); } } updateQueuesLength(ts); }
Source:
public static UseCase createUseCase(final Class<?> testClass) { String description = ""; String name = UseCaseDummyConfiguration.getUseCaseName(testClass, MultipleBuildsRule.getCurrentBuildRun()); if(name == null) { name = getNameFromClass(testClass); } DocuDescription docuDescription = testClass.getAnnotation(DocuDescription.class); if (docuDescription != null) { description = docuDescription.description(); } UseCase useCase = new UseCase(); useCase.setName(name); useCase.setDescription(description); useCase.addDetail("Webtest Class", testClass.getName()); addLabelsIfPresentOnTestClass(testClass, useCase); return useCase; }

Target:
public static UseCase createUseCase(final Class<?> testClass) { String description = ""; String name = getNameFromClass(testClass); DocuDescription docuDescription = testClass.getAnnotation(DocuDescription.class); if (docuDescription != null) { description = docuDescription.description(); } UseCase useCase = new UseCase(); useCase.setName(name); useCase.setDescription(description); useCase.addDetail("Webtest Class", testClass.getName()); addLabelsIfPresentOnTestClass(testClass, useCase); return useCase; }
Source:
public void testParsePersonIdent_legalCases() { final Date when = new Date(1234567890000l); final TimeZone tz = TimeZone.getTimeZone("GMT-7"); assertPersonIdent("Me <me@example.com> 1234567890 -0700", 0, new PersonIdent("Me", "me@example.com", when, tz)); assertPersonIdent(" Me <me@example.com> 1234567890 -0700", 0, new PersonIdent(" Me", "me@example.com", when, tz)); assertPersonIdent("A U Thor <author@example.com> 1234567890 -0700", 0, new PersonIdent("A U Thor", "author@example.com", when, tz)); assertPersonIdent("A U Thor<author@example.com> 1234567890 -0700", 0, new PersonIdent("A U Thor", "author@example.com", when, tz)); assertPersonIdent("A U Thor<author@example.com>1234567890 -0700", 0, new PersonIdent("A U Thor", "author@example.com", when, tz)); assertPersonIdent(" A U Thor < author@example.com > 1234567890 -0700", 0, new PersonIdent(" A U Thor ", " author@example.com ", when, tz)); assertPersonIdent("A U Thor<author@example.com>1234567890 -0700", 0, new PersonIdent("A U Thor", "author@example.com", when, tz)); assertPersonIdent( "A U Thor <author@example.com>, C O. Miter <comiter@example.com> 1234567890 -0700", 0, new PersonIdent("A U Thor", "author@example.com", when, tz)); }

Target:
public void testParsePersonIdent_legalCases() { final Date when = new Date(1234567890000l); final TimeZone tz = TimeZone.getTimeZone("GMT-7"); assertPersonIdent("Me <me@example.com> 1234567890 -0700", new PersonIdent("Me", "me@example.com", when, tz)); assertPersonIdent(" Me <me@example.com> 1234567890 -0700", new PersonIdent(" Me", "me@example.com", when, tz)); assertPersonIdent("A U Thor <author@example.com> 1234567890 -0700", new PersonIdent("A U Thor", "author@example.com", when, tz)); assertPersonIdent("A U Thor<author@example.com> 1234567890 -0700", new PersonIdent("A U Thor", "author@example.com", when, tz)); assertPersonIdent("A U Thor<author@example.com>1234567890 -0700", new PersonIdent("A U Thor", "author@example.com", when, tz)); assertPersonIdent( " A U Thor < author@example.com > 1234567890 -0700", new PersonIdent(" A U Thor ", " author@example.com ", when, tz)); assertPersonIdent("A U Thor<author@example.com>1234567890 -0700", new PersonIdent("A U Thor", "author@example.com", when, tz)); }
Source:
public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || !getClass().equals(o.getClass())) { return false; } final DoublesSketchAggregatorFactory that = (DoublesSketchAggregatorFactory) o; if (!fieldName.equals(that.fieldName)) { return false; } if (k != that.k) { return false; } return true; }

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || !getClass().equals(o.getClass())) { return false; } final DoublesSketchAggregatorFactory that = (DoublesSketchAggregatorFactory) o; if (!name.equals(that.name)) { return false; } if (!fieldName.equals(that.fieldName)) { return false; } if (k != that.k) { return false; } return true; }
Source:
public ZipIndexFileSource(DataInputSource dataInputSource) { this.dataInputSource = requireNonNull(dataInputSource, "dataInputSource is null"); this.zipData = readCentralDirectory(); }

Target:
public ZipIndexFileSource(DataInputSource dataInputSource) { this.dataInputSource = requireNonNull(dataInputSource, "dataInputSource is null"); zipData = readCentralDirectory(); }
Source:
public abstract Ref getRef(String name) throws IOException; public Ref exactRef(String name) throws IOException { Ref ref = getRef(name); if (ref == null || !name.equals(ref.getName())) { return null; } return ref; }

Target:
public abstract Ref getRef(String name) throws IOException; public Ref exactRef(String name) throws IOException { int slash = name.lastIndexOf('/'); String prefix = name.substring(0, slash + 1); String rest = name.substring(slash + 1); Ref result = getRefs(prefix).get(rest); if (result != null || slash != -1) { return result; } for (Ref ref : getAdditionalRefs()) { if (name.equals(ref.getName())) { return ref; } } return null; }
Source:
private static byte[] shortToByteArray(final short value) { ByteBuffer buffer = ByteBuffer.allocate(2).order(ByteOrder.LITTLE_ENDIAN); return buffer.putShort(value).array(); }

Target:
private static byte[] shortToByteArray(final short value) { final ByteBuffer buffer = ByteBuffer.allocate(2).order(ByteOrder.LITTLE_ENDIAN); return buffer.putShort(value).array(); }
Source:
public String remoteName() { SocketAddress addr = remoteAddress(); if(addr != null) return addr.host(); return null; }

Target:
public String remoteName() { java.net.SocketAddress addr = chctx.channel().remoteAddress(); if (addr instanceof InetSocketAddress) { return ((InetSocketAddress)addr).getHostString(); } return null; }
Source:
MappingJacksonValue getAllSeats(@RequestParam(value = "admin", required = false) boolean admin, @AuthenticationPrincipal User user) { MappingJacksonValue result = new MappingJacksonValue(seatService.getAllSeats()); if (!admin || !user.getAuthorities().contains(Role.ROLE_ADMIN)) { System.out.println("Setting Public View..."); result.setSerializationView(View.Public.class); } return result; }

Target:
MappingJacksonValue getAllSeats(@RequestParam(value = "admin", required = false) boolean admin, @AuthenticationPrincipal User user) { MappingJacksonValue result = new MappingJacksonValue(seatService.getAllSeats()); if (!admin || !user.getAuthorities().contains(Role.ROLE_ADMIN)) { result.setSerializationView(View.Public.class); } return result; }
Source:
public static String getCssValueFromTheme(Display display, String value) { BundleContext context = FrameworkUtil.getBundle(E4ThemeColor.class).getBundleContext(); try { Object reference = MethodUtils.invokeMethod(context, "getServiceReference", "org.eclipse.e4.ui.css.swt.theme.IThemeManager"); if (reference != null) { Object iThemeManager = MethodUtils.invokeMethod(context, "getService", reference); if (iThemeManager != null) { Object themeEngine = MethodUtils.invokeMethod(iThemeManager, "getEngineForDisplay", Display.getDefault()); Shell shell = display.getActiveShell(); if (themeEngine != null && shell != null) { Object shellStyle = MethodUtils.invokeMethod(themeEngine, "getStyle", shell); if (shellStyle != null && shellStyle instanceof CSSStyleDeclaration) { CSSValue cssValue = ((CSSStyleDeclaration) shellStyle).getPropertyCSSValue(value); if (cssValue != null) { return cssValue.getCssText(); } } } } } } catch (NoSuchMethodException nsme) { return null; } catch (InvocationTargetException ite) { return null; } catch (IllegalAccessException iae) { return null; } return null; }

Target:
public static String getCssValueFromTheme(Display display, String value) { BundleContext context = FrameworkUtil.getBundle(E4ThemeColor.class).getBundleContext(); try { Object reference = MethodUtils.invokeMethod(context, "getServiceReference", "org.eclipse.e4.ui.css.swt.theme.IThemeManager"); if (reference != null) { Object iThemeManager = MethodUtils.invokeMethod(context, "getService", reference); if (iThemeManager != null) { Object themeEngine = MethodUtils.invokeMethod(iThemeManager, "getEngineForDisplay", display); Shell shell = display.getActiveShell(); if (themeEngine != null && shell != null) { Object shellStyle = MethodUtils.invokeMethod(themeEngine, "getStyle", shell); if (shellStyle instanceof CSSStyleDeclaration) { CSSValue cssValue = ((CSSStyleDeclaration) shellStyle).getPropertyCSSValue(value); if (cssValue != null) { return cssValue.getCssText(); } } } } } } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { if (!loggedError) { StatusHandler.log(new Status(IStatus.ERROR, CommonsUiConstants.ID_PLUGIN, e.getMessage(), e)); loggedError = true; } return null; } return null; }
Source:
public ActionResult execute() { String idOfCourseToRestore = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_ID, idOfCourseToRestore); String nameOfSessionToRestore = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); Assumption.assertPostParamNotNull(Const.ParamsNames.FEEDBACK_SESSION_NAME, nameOfSessionToRestore); gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(idOfCourseToRestore, account.googleId), logic.getFeedbackSession(nameOfSessionToRestore, idOfCourseToRestore), false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); try { logic.deleteFeedbackSession(nameOfSessionToRestore, idOfCourseToRestore); statusToUser.add(new StatusMessage(Const.StatusMessages.FEEDBACK_SESSION_DELETED, StatusMessageColor.SUCCESS)); statusToAdmin = "Feedback Session <span class=\"bold\">[" + nameOfSessionToRestore + "]</span> " + "from Course: <span class=\"bold\">[" + idOfCourseToRestore + " permanently deleted."; } catch (Exception e) { setStatusForException(e); } return createRedirectResult(Const.ActionURIs.INSTRUCTOR_FEEDBACK_SESSIONS_PAGE); }

Target:
public ActionResult execute() { String idOfCourseToDelete = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_ID, idOfCourseToDelete); String nameOfSessionToDelete = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); Assumption.assertPostParamNotNull(Const.ParamsNames.FEEDBACK_SESSION_NAME, nameOfSessionToDelete); gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(idOfCourseToDelete, account.googleId), logic.getFeedbackSession(nameOfSessionToDelete, idOfCourseToDelete), false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); try { logic.deleteFeedbackSession(nameOfSessionToDelete, idOfCourseToDelete); statusToUser.add(new StatusMessage(Const.StatusMessages.FEEDBACK_SESSION_DELETED, StatusMessageColor.SUCCESS)); statusToAdmin = "Feedback Session <span class=\"bold\">[" + nameOfSessionToDelete + "]</span> " + "from Course: <span class=\"bold\">[" + idOfCourseToDelete + " permanently deleted."; } catch (Exception e) { setStatusForException(e); } return createRedirectResult(Const.ActionURIs.INSTRUCTOR_FEEDBACK_SESSIONS_PAGE); }
Source:
protected void validateResult() throws Exception { assertTrue(isConflicting()); assertTrue(fileExists("model.di")); assertTrue(fileExists("model.notation")); assertTrue(fileExists("model.uml")); Set<String> conflicting = repository.status().getConflicting(); conflicting.contains("model.uml"); }

Target:
protected void validateResult() throws Exception { assertTrue(isConflicting()); assertTrue(fileExists("model.di")); assertTrue(fileExists("model.notation")); assertTrue(fileExists("model.uml")); Set<String> conflicting = repository.status().getConflicting(); assertEquals(conflicting.size(), 1); assertTrue(conflicting.contains("Project1/model.uml")); }
Source:
private void loadData() { client.friendsNews() .compose(bindToLifecycle()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(feeds -> { this.feeds = feeds; trySetAdapter(); }); client.profile() .compose(bindToLifecycle()) .observeOn(AndroidSchedulers.mainThread()) .map(this::extractFriendsAvatar) .subscribe(friendsAvatar -> { this.friendsAvatar = friendsAvatar; trySetAdapter(); }); }

Target:
private void loadData() { MyShowsClient client = MyShowsClientImpl.getInstance(); client.friendsNews() .compose(bindToLifecycle()) .subscribe(feeds -> { this.feeds = feeds; trySetAdapter(); }); client.profile() .compose(bindToLifecycle()) .map(this::extractFriendsAvatar) .subscribe(friendsAvatar -> { this.friendsAvatar = friendsAvatar; trySetAdapter(); }); }
Source:
protected boolean canDoAction() { if (isImagesAlreadyOnTarget()) { if (ovfEntityData == null && !getParameters().isImportAsNewEntity()) { return false; } setStorageDomainId(ovfEntityData.getStorageDomainId()); if (!validate(new StorageDomainValidator(getStorageDomain()).isDomainExistAndActive())) { return false; } if (!getStorageDomain().getStorageDomainType().isDataDomain()) { addCanDoActionMessage("$domainId " + getParameters().getStorageDomainId()); addCanDoActionMessage("$domainType " + getStorageDomain().getStorageDomainType()); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED); return false; } } return super.canDoAction(); }

Target:
protected boolean canDoAction() { if (isImagesAlreadyOnTarget()) { if (ovfEntityData == null && !getParameters().isImportAsNewEntity()) { return false; } setStorageDomainId(ovfEntityData.getStorageDomainId()); if (!validate(new StorageDomainValidator(getStorageDomain()).isDomainExistAndActive())) { return false; } if (!getStorageDomain().getStorageDomainType().isDataDomain()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED, String.format("$domainId %1$s", getParameters().getStorageDomainId()), String.format("$domainType %1$s", getStorageDomain().getStorageDomainType())); } } return super.canDoAction(); }
Source:
private void buildTxClause(StringBuilder sb, String txsAlias) { sb.append(txsAlias); if (OptionsUtil.isHistorical(getOptions())) { sb.append(".mod_type IN ("); sb.append(String.valueOf(ModificationType.NEW.getValue())); sb.append(", "); sb.append(String.valueOf(ModificationType.DELETED.getValue())); sb.append(", "); sb.append(String.valueOf(ModificationType.ARTIFACT_DELETED.getValue())); sb.append(", "); sb.append(String.valueOf(ModificationType.MODIFIED.getValue())); sb.append(")"); } else { sb.append(".tx_current = "); sb.append(String.valueOf(TxChange.CURRENT.getValue())); } }

Target:
private void buildTxClause(StringBuilder sb, String txsAlias) { sb.append(txsAlias); if (!OptionsUtil.isHistorical(getOptions())) { sb.append(".tx_current = "); sb.append(String.valueOf(TxChange.CURRENT.getValue())); } }
Source:
protected void doTearDown() throws Exception { super.doTearDown(); if (project.exists()) { project.delete(true, null); } }

Target:
protected void doTearDown() throws Exception { if (project.exists()) { project.delete(true, null); } super.doTearDown(); }
Source:
protected ScheduledExecutorService executor() { final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor( new ThreadFactoryBuilder() .setDaemon(true) .setNameFormat(serviceName()) .build()); addListener(new Listener() { @Override public void terminated(State from) { executor.shutdown(); } @Override public void failed(State from, Throwable failure) { executor.shutdown(); }}, MoreExecutors.sameThreadExecutor()); return executor; }

Target:
protected ScheduledExecutorService executor() { final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor( new ThreadFactoryBuilder() .setDaemon(true) .setNameFormat(serviceName()) .build()); addListener(new Listener() { @Override public void terminated(State from) { executor.shutdown(); } @Override public void failed(State from, Throwable failure) { executor.shutdown(); }}, MoreExecutors.directExecutor()); return executor; }
Source:
private static void retrieveSimpleColumn(Session session) { Row row = session.execute("SELECT b, m FROM examples.blobs WHERE k = 1").one(); ByteBuffer buffer = row.getBytes("b"); assert buffer.limit() - buffer.position() == 16; for (int i = buffer.position(); i < buffer.limit(); i++) { assert buffer.get(i) == (byte) 0xFF; } while (buffer.hasRemaining()) { assert buffer.get() == (byte) 0xFF; } assert buffer.position() == buffer.limit(); buffer.flip(); byte[] array = Bytes.getArray(buffer); assert array.length == 16; for (byte b : array) { assert b == (byte) 0xFF; } }

Target:
private static void retrieveSimpleColumn(Session session) { Row row = session.execute("SELECT b, m FROM examples.blobs WHERE k = 1").one(); ByteBuffer buffer = row.getBytes("b"); assert buffer.limit() - buffer.position() == 16; for (int i = buffer.position(); i < buffer.limit(); i++) { byte b = buffer.get(i); assert b == (byte) 0xFF; } while (buffer.hasRemaining()) { byte b = buffer.get(); assert b == (byte) 0xFF; } assert buffer.position() == buffer.limit(); buffer.flip(); byte[] array = Bytes.getArray(buffer); assert array.length == 16; for (byte b : array) { assert b == (byte) 0xFF; } }
Source:
public void vlanIdTakenByDifferentNetwork() throws Exception { Network otherNetwork = new Network(); otherNetwork.setVlanId(DEFAULT_VLAN_ID); otherNetwork.setId(new Guid(OTHER_GUID)); List<Network> networks = new ArrayList<Network>(); networks.add(otherNetwork); vlanIdAvailableTest(new ValidationResult(VdcBllMessages.NETWORK_VLAN_IN_USE), networks); }

Target:
public void vlanIdTakenByDifferentNetwork() throws Exception { Network otherNetwork = new Network(); otherNetwork.setVlanId(DEFAULT_VLAN_ID); otherNetwork.setId(new Guid(OTHER_GUID)); vlanIdAvailableTest(new ValidationResult(VdcBllMessages.NETWORK_VLAN_IN_USE), Collections.singletonList(otherNetwork)); }
Source:
public void setup() throws Exception { setupFlinkConfig(); flinkConfDir = temporaryFolder.newFolder().getAbsoluteFile(); hadoopConfDir = temporaryFolder.newFolder().getAbsoluteFile(); writeFlinkConfiguration(); Map<String, String> map = new HashMap<>(); map.put(ConfigConstants.ENV_FLINK_CONF_DIR, flinkConfDir.toString()); TestBaseUtils.setEnv(map); kubeClient = server.getClient().inNamespace(NAMESPACE); flinkKubeClient = new Fabric8FlinkKubeClient(flinkConfig, kubeClient, Executors::newDirectExecutorService); }

Target:
public final void setup() throws Exception { setupFlinkConfig(); flinkConfDir = temporaryFolder.newFolder().getAbsoluteFile(); hadoopConfDir = temporaryFolder.newFolder().getAbsoluteFile(); writeFlinkConfiguration(); Map<String, String> map = new HashMap<>(); map.put(ConfigConstants.ENV_FLINK_CONF_DIR, flinkConfDir.toString()); TestBaseUtils.setEnv(map); kubeClient = server.getClient().inNamespace(NAMESPACE); flinkKubeClient = new Fabric8FlinkKubeClient(flinkConfig, kubeClient, Executors::newDirectExecutorService); onSetup(); }
Source:
public static Description wbFromDMN(final String description) { if (description == null) { return new Description(""); } else { return new Description(description); } }

Target:
public static Description wbFromDMN(final String description) { if (Objects.isNull(description)) { return new Description(""); } else { return new Description(description); } }
Source:
public void removeChildAtIndex(final int childIndex) { if (0 <= childIndex && childIndex < jjtGetNumChildren()) { children = ArrayUtils.remove(children, childIndex); for (int i = 0; i < jjtGetNumChildren(); i++) { jjtGetChild(i).jjtSetChildIndex(i); } } }

Target:
public void removeChildAtIndex(final int childIndex) { if (0 <= childIndex && childIndex < jjtGetNumChildren()) { children = ArrayUtils.remove(children, childIndex); for (int i = childIndex; i < jjtGetNumChildren(); i++) { jjtGetChild(i).jjtSetChildIndex(i); } } }
Source:
void deleteLargeMessageFile(final LargeServerMessage largeServerMessage) throws ActiveMQException { if (largeServerMessage.getPendingRecordID() < 0) { try { largeServerMessage.setPendingRecordID(storePendingLargeMessage(largeServerMessage.getMessageID(), largeServerMessage.getPendingRecordID())); } catch (Exception e) { throw new ActiveMQInternalErrorException(e.getMessage(), e); } } final SequentialFile file = largeServerMessage.getFile(); if (file == null) { return; } if (largeServerMessage.isDurable() && isReplicated()) { readLock(); try { if (isReplicated() && replicator.isSynchronizing()) { synchronized (largeMessagesToDelete) { largeMessagesToDelete.put(Long.valueOf(largeServerMessage.getMessageID()), largeServerMessage); } return; } } finally { readUnLock(); } } Runnable deleteAction = new Runnable() { @Override public void run() { try { readLock(); try { if (replicator != null) { replicator.largeMessageDelete(largeServerMessage.getMessageID(), JournalStorageManager.this); } file.delete(); confirmLargeMessage(largeServerMessage); } finally { readUnLock(); } } catch (Exception e) { ActiveMQServerLogger.LOGGER.journalErrorDeletingMessage(e, largeServerMessage.getMessageID()); } } }; if (executor == null) { deleteAction.run(); } else { executor.execute(deleteAction); } }

Target:
void deleteLargeMessageFile(final LargeServerMessage largeServerMessage) throws ActiveMQException { if (largeServerMessage.getPendingRecordID() < 0) { try { largeServerMessage.setPendingRecordID(storePendingLargeMessage(largeServerMessage.getMessageID(), largeServerMessage.getPendingRecordID())); } catch (Exception e) { throw new ActiveMQInternalErrorException(e.getMessage(), e); } } final SequentialFile file = largeServerMessage.getFile(); if (file == null) { return; } if (largeServerMessage.isDurable() && isReplicated()) { readLock(); try { if (isReplicated() && replicator.isSynchronizing()) { largeMessagesToDelete.put(largeServerMessage.getMessageID(), largeServerMessage); return; } } finally { readUnLock(); } } Runnable deleteAction = new Runnable() { @Override public void run() { try { readLock(); try { if (replicator != null) { replicator.largeMessageDelete(largeServerMessage.getMessageID(), JournalStorageManager.this); } file.delete(); confirmLargeMessage(largeServerMessage); } finally { readUnLock(); } } catch (Exception e) { ActiveMQServerLogger.LOGGER.journalErrorDeletingMessage(e, largeServerMessage.getMessageID()); } } }; if (executor == null) { deleteAction.run(); } else { executor.execute(deleteAction); } }
Source:
public void should_fail_when_synchronous_call_on_io_thread() throws Exception { ResultSetFuture f = session.executeAsync("select release_version from system.local"); ListenableFuture<Void> f2 = Futures.transform(f, new Function<ResultSet, Void>() { @Override public Void apply(ResultSet input) { session.execute("select release_version from system.local"); return null; } }); try { f2.get(); } catch (Exception e) { assertThat(Throwables.getRootCause(e)) .isInstanceOf(IllegalStateException.class) .hasMessageContaining("Detected a synchronous Session call"); } }

Target:
public void should_fail_when_synchronous_call_on_io_thread() throws Exception { ResultSetFuture f = session.executeAsync("select release_version from system.local"); ListenableFuture<Void> f2 = Futures.transform(f, new Function<ResultSet, Void>() { @Override public Void apply(ResultSet input) { session.execute("select release_version from system.local"); return null; } }); try { f2.get(); fail("Expected a failed future"); } catch (Exception e) { assertThat(Throwables.getRootCause(e)) .isInstanceOf(IllegalStateException.class) .hasMessageContaining("Detected a synchronous Session call"); } }
Source:
public <T> ParamConverter<T> getConverter(Class<T> rawType, Type genericType, Annotation[] annotations) { if (rawType.equals(GHPoint.class)) { return new ParamConverter<T>() { @Override public T fromString(String value) { try { return (T) GHPoint.fromString(value); } catch (IllegalArgumentException ex) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity(new MultiException(new Throwable("Cannot parse point '" + value + "'"))) .build()); } } @Override public String toString(T value) { return value.toString(); } }; } return null; }

Target:
public <T> ParamConverter<T> getConverter(Class<T> rawType, Type genericType, Annotation[] annotations) { if (rawType.equals(GHPoint.class)) { return new ParamConverter<T>() { @Override public T fromString(String value) { try { return (T) GHPoint.fromString(value); } catch (IllegalArgumentException ex) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity(new MultiException(ex)) .build()); } } @Override public String toString(T value) { return value.toString(); } }; } return null; }
Source:
public void init() { mainFrame = new MainFrame(displayOption); MessageLocationHighlightRenderersEditors.getInstance().addEditor( TextMessageLocationHighlight.class, new TextMessageLocationHighlightEditor()); MessageLocationHighlightRenderersEditors.getInstance().addRenderer( TextMessageLocationHighlight.class, new TextMessageLocationHighlightRenderer()); getWorkbench().getTabbedWork().setAlternativeParent(mainFrame.getPaneDisplay()); getWorkbench().getTabbedStatus().setAlternativeParent(mainFrame.getPaneDisplay()); getWorkbench().getTabbedSelect().setAlternativeParent(mainFrame.getPaneDisplay()); getMessagePanelsPositionController().restoreState(); String statusString = ""; for(Status status : AddOn.Status.values()) { try { statusString = Constant.messages.getString("cfu.status." + status.toString()); } catch (MissingResourceException mre) { statusString = status.toString(); } statusMap.put(status, new StatusUI(status, statusString)); } }

Target:
public void init() { mainFrame = new MainFrame(displayOption); MessageLocationHighlightRenderersEditors.getInstance().addEditor( TextMessageLocationHighlight.class, new TextMessageLocationHighlightEditor()); MessageLocationHighlightRenderersEditors.getInstance().addRenderer( TextMessageLocationHighlight.class, new TextMessageLocationHighlightRenderer()); getWorkbench().getTabbedWork().setAlternativeParent(mainFrame.getPaneDisplay()); getWorkbench().getTabbedStatus().setAlternativeParent(mainFrame.getPaneDisplay()); getWorkbench().getTabbedSelect().setAlternativeParent(mainFrame.getPaneDisplay()); getMessagePanelsPositionController().restoreState(); String statusString; for(Status status : AddOn.Status.values()) { try { statusString = Constant.messages.getString("cfu.status." + status.toString()); } catch (MissingResourceException mre) { statusString = status.toString(); String errString="Caught " + mre.getClass().getName() + " " + mre.getMessage() + " when looking for i18n string: cfu.status." + statusString; if (Constant.isDevBuild()) { logger.error(errString); } else { logger.warn(errString); } } statusMap.put(status, new StatusUI(status, statusString)); } }
Source:
public TaskExecution getLatestTaskExecutionForTaskName(String taskName) { final List<TaskExecution> te = this.getLatestTaskExecutionsByTaskNames(taskName); if (te.isEmpty()) { return null; } else if (te.size() == 1) { return te.get(0); } else { throw new IllegalStateException("Only expected a single TaskExecution but received " + te.size()); } }

Target:
public TaskExecution getLatestTaskExecutionForTaskName(String taskName) { Assert.hasText(taskName, "The task name must not be empty."); final List<TaskExecution> taskExecutions = this.getLatestTaskExecutionsByTaskNames(taskName); if (taskExecutions.isEmpty()) { return null; } else if (taskExecutions.size() == 1) { return taskExecutions.get(0); } else { throw new IllegalStateException("Only expected a single TaskExecution but received " + taskExecutions.size()); } }
Source:
protected Collection<String> getThemeLines() { Collection<String> lines = new ArrayList<>(); AbstractTheme theme = getTheme(); ThemeDefinition themeDef = getThemeDefinition(); if (themeDef!= null && !themeDef.getName().equals("")) { lines.add("import {applyTheme} from 'theme/theme.js';"); lines.add("applyTheme(document);"); } if (theme != null) { if (!theme.getHeaderInlineContents().isEmpty()) { lines.add(""); theme.getHeaderInlineContents() .forEach(html -> addLines(lines, String.format(THEME_LINE_TPL, NEW_LINE_TRIM .matcher(html).replaceAll("")))); } theme.getHtmlAttributes(themeDef.getVariant()) .forEach((key, value) -> addLines(lines, String.format(THEME_VARIANT_TPL, key, value))); lines.add(""); } return lines; }

Target:
protected Collection<String> getThemeLines() { Collection<String> lines = new ArrayList<>(); AbstractTheme theme = getTheme(); ThemeDefinition themeDef = getThemeDefinition(); if (themeDef != null && !"".equals(themeDef.getName())) { lines.add("import {applyTheme} from 'theme/theme-generated.js';"); lines.add("applyTheme(document);"); } if (theme != null) { if (!theme.getHeaderInlineContents().isEmpty()) { lines.add(""); theme.getHeaderInlineContents() .forEach(html -> addLines(lines, String.format(THEME_LINE_TPL, NEW_LINE_TRIM .matcher(html).replaceAll("")))); } if (themeDef != null) { theme.getHtmlAttributes(themeDef.getVariant()).forEach( (key, value) -> addLines(lines, String.format(THEME_VARIANT_TPL, key, value))); } lines.add(""); } return lines; }
Source:
public void reset(long rateTimeInterval) { reset(rateTimeInterval, DFLT_SZ); }

Target:
public void reset(long rateTimeInterval) { reset(rateTimeInterval, DFLT_SIZE); }
Source:
public void onActionModeStarted(android.view.ActionMode mode) { if (CustomCabMenuHelper.shouldInjectCustomMenu(PageActivity.this, mode)) { CustomCabMenuHelper.injectCustomMenu(PageActivity.this, mode); } prepareActionMode(mode); super.onActionModeStarted(mode); }

Target:
public void onActionModeStarted(android.view.ActionMode mode) { boolean wasCabOpen = isCabOpen(); currentActionMode = new CompatActionMode(mode, wasCabOpen); if (currentActionMode.shouldInjectCustomMenu(PageActivity.this)) { currentActionMode.injectCustomMenu(PageActivity.this); } prepareActionMode(); super.onActionModeStarted(mode); }
Source:
public void testLatestApiVersionsRequest() throws IOException { final short version = ApiKeys.API_VERSIONS.latestVersion(); TransportLayer transportLayer = mock(TransportLayer.class, Answers.RETURNS_DEEP_STUBS); Map<String, ?> configs = Collections.singletonMap(BrokerSecurityConfigs.SASL_ENABLED_MECHANISMS_CONFIG, Collections.singletonList(SCRAM_SHA_256.mechanismName())); ChannelMetadataRegistry metadataRegistry = new DefaultChannelMetadataRegistry(); SaslServerAuthenticator authenticator = setupAuthenticator(configs, transportLayer, SCRAM_SHA_256.mechanismName(), metadataRegistry); final RequestHeader header = new RequestHeader(ApiKeys.API_VERSIONS, version, "clientId", 0); final Struct headerStruct = header.toStruct(); final ApiVersionsRequest request = new ApiVersionsRequest.Builder().build(version); final Struct requestStruct = request.data.toStruct(version); when(transportLayer.socketChannel().socket().getInetAddress()).thenReturn(InetAddress.getLoopbackAddress()); when(transportLayer.read(any(ByteBuffer.class))).then(invocation -> { invocation.<ByteBuffer>getArgument(0).putInt(headerStruct.sizeOf() + requestStruct.sizeOf()); return 4; }).then(invocation -> { headerStruct.writeTo(invocation.getArgument(0)); requestStruct.writeTo(invocation.getArgument(0)); return headerStruct.sizeOf() + requestStruct.sizeOf(); }); authenticator.authenticate(); assertEquals("apache-kafka-java", metadataRegistry.clientInformation().softwareName()); assertEquals(AppInfoParser.getVersion(), metadataRegistry.clientInformation().softwareVersion()); verify(transportLayer, times(2)).read(any(ByteBuffer.class)); }

Target:
public void testLatestApiVersionsRequest() throws IOException { testApiVersionsRequest(ApiKeys.API_VERSIONS.latestVersion(), "apache-kafka-java", AppInfoParser.getVersion()); }
Source:
private void onCtrlMsg(final AvroElasticMemoryMessage msg) { final TraceScope onCtrlMsgScope = Trace.startSpan(ON_CTRL_MSG, HTraceUtils.fromAvro(msg.getTraceInfo())); try { final CtrlMsg ctrlMsg = msg.getCtrlMsg(); final String key = ctrlMsg.getDataClassName().toString(); final Codec codec = serializer.getCodec(key); final List<Pair<Long, Object>> idObjectList = new LinkedList<>(); for (final AvroLongRange avroLongRange : ctrlMsg.getIdRange()) { idObjectList.addAll(memoryStore.remove(key, avroLongRange.getMin(), avroLongRange.getMax())); } final List<UnitIdPair> unitIdPairList = new LinkedList<>(); for (final Pair<Long, Object> objectId : idObjectList) { final UnitIdPair unitIdPair = UnitIdPair.newBuilder() .setUnit(ByteBuffer.wrap(codec.encode(objectId.second))) .setId(objectId.first) .build(); unitIdPairList.add(unitIdPair); } sender.get().sendDataMsg(msg.getDestId().toString(), ctrlMsg.getDataClassName().toString(), unitIdPairList, TraceInfo.fromSpan(onCtrlMsgScope.getSpan())); } finally { onCtrlMsgScope.close(); } }

Target:
private void onCtrlMsg(final AvroElasticMemoryMessage msg) { final TraceScope onCtrlMsgScope = Trace.startSpan(ON_CTRL_MSG, HTraceUtils.fromAvro(msg.getTraceInfo())); try { final CtrlMsg ctrlMsg = msg.getCtrlMsg(); final String key = ctrlMsg.getDataClassName().toString(); final Codec codec = serializer.getCodec(key); final Set<Map<Long, Object>> idObjectMapSet = new HashSet<>(); int numObject = 0; for (final AvroLongRange avroLongRange : ctrlMsg.getIdRange()) { final Map<Long, Object> idObjectMap = memoryStore.getElasticStore().removeRange(key, avroLongRange.getMin(), avroLongRange.getMax()); numObject += idObjectMap.size(); idObjectMapSet.add(idObjectMap); } final List<UnitIdPair> unitIdPairList = new ArrayList<>(numObject); for (final Map<Long, Object> idObjectMap : idObjectMapSet) { for (final Map.Entry<Long, Object> idObject : idObjectMap.entrySet()) { final UnitIdPair unitIdPair = UnitIdPair.newBuilder() .setUnit(ByteBuffer.wrap(codec.encode(idObject.getValue()))) .setId(idObject.getKey()) .build(); unitIdPairList.add(unitIdPair); } } sender.get().sendDataMsg(msg.getDestId().toString(), ctrlMsg.getDataClassName().toString(), unitIdPairList, TraceInfo.fromSpan(onCtrlMsgScope.getSpan())); } finally { onCtrlMsgScope.close(); } }
Source:
public void extra(Collection<Object> o) { for (Object obj : o) { if (obj instanceof String) { addExtraSrgLine(obj.toString()); } else if (obj instanceof File || obj instanceof DelayedFile) { addSecondarySrgFile(obj); } else { throw new IllegalArgumentException("Extra srgs must be a file or string. Found " + o.getClass()); } } }

Target:
public void extra(Collection<Object> o) { for (Object obj : o) { if (obj instanceof String || obj instanceof GString) { addExtraSrgLine(obj.toString()); } else if (obj instanceof File || obj instanceof DelayedFile) { addSecondarySrgFile(obj); } else { throw new IllegalArgumentException("Extra srgs must be a file or string. Found " + o.getClass()); } } }
Source:
IkeSaPayload(boolean critical, boolean isResp, byte[] payloadBody) throws IkeException { super(IkePayload.PAYLOAD_TYPE_SA, critical); ByteBuffer inputBuffer = ByteBuffer.wrap(payloadBody); proposalList = new LinkedList<>(); while (inputBuffer.hasRemaining()) { Proposal proposal = Proposal.readFrom(inputBuffer); proposalList.add(proposal); } if (proposalList.size() != 1 && isResp) { throw new InvalidSyntaxException( "Expected only one negotaited proposal from SA response: " + "Multiple negotaited proposals found."); } isSaResponse = isResp; }

Target:
IkeSaPayload(boolean critical, boolean isResp, byte[] payloadBody) throws IkeException { super(IkePayload.PAYLOAD_TYPE_SA, critical); ByteBuffer inputBuffer = ByteBuffer.wrap(payloadBody); proposalList = new LinkedList<>(); while (inputBuffer.hasRemaining()) { Proposal proposal = Proposal.readFrom(inputBuffer); proposalList.add(proposal); } if (isResp && proposalList.size() != 1) { throw new InvalidSyntaxException( "Expected only one negotiated proposal from SA response: " + "Multiple negotiated proposals found."); } isSaResponse = isResp; }