auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private DynamoDBQueryExpression<DynamoExternalIdentifier> createGetQuery(StudyIdentifier studyId, String offsetKey, int pageSize, String idFilter, Boolean assignmentFilter) { Set<String> callerSubstudyIds = BridgeUtils.getRequestContext().getCallerSubstudies(); DynamoDBQueryExpression<DynamoExternalIdentifier> query = new DynamoDBQueryExpression<DynamoExternalIdentifier>(); if (idFilter != null) { query.withRangeKeyCondition(IDENTIFIER, new Condition() .withAttributeValueList(new AttributeValue().withS(idFilter)) .withComparisonOperator(BEGINS_WITH)); } if (assignmentFilter != null) { query.withQueryFilterEntry(HEALTH_CODE, new Condition() .withComparisonOperator(assignmentFilter.booleanValue() ? NOT_NULL : NULL)); } if (callerSubstudyIds != null && !callerSubstudyIds.isEmpty()) { query.withQueryFilterEntry(SUBSTUDY_ID, new Condition() .withAttributeValueList(callerSubstudyIds.stream() .map(id -> new AttributeValue(id)).collect(Collectors.toList())) .withComparisonOperator(ComparisonOperator.IN)); } query.withHashKeyValues(new DynamoExternalIdentifier(studyId.getIdentifier(), null)); if (offsetKey != null) { Map<String, AttributeValue> map = new HashMap<>(); map.put(STUDY_ID, new AttributeValue().withS(studyId.getIdentifier())); map.put(IDENTIFIER, new AttributeValue().withS(offsetKey)); query.withExclusiveStartKey(map); } query.withReturnConsumedCapacity(ReturnConsumedCapacity.TOTAL); query.withConsistentRead(true); query.withLimit(pageSize); return query; }

Target:
private DynamoDBQueryExpression<DynamoExternalIdentifier> createGetQuery(StudyIdentifier studyId, String offsetKey, int pageSize, String idFilter, Boolean assignmentFilter) { DynamoDBQueryExpression<DynamoExternalIdentifier> query = new DynamoDBQueryExpression<DynamoExternalIdentifier>(); if (idFilter != null) { query.withRangeKeyCondition(IDENTIFIER, new Condition() .withAttributeValueList(new AttributeValue().withS(idFilter)) .withComparisonOperator(BEGINS_WITH)); } if (assignmentFilter != null) { query.withQueryFilterEntry(HEALTH_CODE, new Condition() .withComparisonOperator(assignmentFilter.booleanValue() ? NOT_NULL : NULL)); } query.withHashKeyValues(new DynamoExternalIdentifier(studyId.getIdentifier(), null)); if (offsetKey != null) { Map<String, AttributeValue> map = new HashMap<>(); map.put(STUDY_ID, new AttributeValue().withS(studyId.getIdentifier())); map.put(IDENTIFIER, new AttributeValue().withS(offsetKey)); query.withExclusiveStartKey(map); } query.withReturnConsumedCapacity(ReturnConsumedCapacity.TOTAL); query.withConsistentRead(true); query.withLimit(pageSize); return query; }
Source:
protected void builUI(Group root) { EditorGameAssets gameAssets = controller.getEditorGameAssets(); gameAssets.setLoadingPath("src/test/resources/framesTest", true); controller.getCommands().pushContext(); Frames frames = new Frames(); for (int i = 0; i < 20; ++i) { Frame frame = new Frame(); Image image = new Image(); image.setUri(gameAssets .resolve("externalResources/ic_" + (i % 10) + ".png") .file().getAbsolutePath()); frame.setRenderer(image); frame.setTime(MathUtils.random(.1f, .5f)); frames.getFrames().add(frame); } FramesTimeline widget = new FramesTimeline(controller); widget.setFrames(frames.getFrames()); Container container = new Container(widget); container.setFillParent(true); root.addActor(container); }

Target:
protected void builUI(Group root) { EditorGameAssets gameAssets = controller.getEditorGameAssets(); gameAssets.setLoadingPath("framesTest", true); controller.getCommands().pushContext(); Frames frames = new Frames(); for (int i = 0; i < 20; ++i) { Frame frame = new Frame(); Image image = new Image(); image.setUri("externalResources/ic_" + (i % 10) + ".png"); frame.setRenderer(image); frame.setTime(MathUtils.random(.1f, .5f)); frames.getFrames().add(frame); } FramesTimeline widget = new FramesTimeline(controller); widget.setFrames(frames.getFrames()); Container container = new Container(widget); container.setFillParent(true); root.addActor(container); }
Source:
public void deleteVertex(Vertex vertex, Authorizations authorizations) { checkNotNull(vertex, "vertex cannot be null"); Span trace = Trace.start("deleteVertex"); trace.data("vertexId", vertex.getId()); try { FetchHints edgeFetchHints = new FetchHintsBuilder() .setIncludeExtendedDataTableNames(true) .build(); for (Edge edge : vertex.getEdges(Direction.BOTH, edgeFetchHints, authorizations)) { deleteEdge(edge, authorizations); } deleteAllExtendedDataForElement(vertex, authorizations); getSearchIndex().deleteElement(this, vertex, authorizations); addMutations(VertexiumObjectType.VERTEX, elementMutationBuilder.getDeleteRowMutation(vertex.getId())); if (hasEventListeners()) { queueEvent(new DeleteVertexEvent(this, vertex)); } } finally { trace.stop(); } }

Target:
public void deleteVertex(Vertex vertex, Authorizations authorizations) { deleteElements(Stream.of(vertex), authorizations); }
Source:
public static Map<Integer, SubQueryPlan> instantiate(final List<PlanFragmentEncoding> fragments, final ConstructArgs args) throws CatalogException { int idx = 0; for (PlanFragmentEncoding fragment : fragments) { fragment.setFragmentIndex(idx++); } sanityCheckEdges(fragments); assignWorkersToFragments(fragments, args); Map<Integer, PlanFragmentEncoding> op2OwnerFragmentMapping = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { for (OperatorEncoding<?> op : fragment.operators) { op2OwnerFragmentMapping.put(op.opId, fragment); } } Map<Integer, Operator> allOperators = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { instantiateOperators(fragment, args, allOperators); } while (!setConsumerSchema(fragments, allOperators)) { } Map<Integer, SubQueryPlan> plan = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { RootOperator op = instantiateFragment(fragment, args, allOperators); for (Integer worker : fragment.workers) { if (!plan.containsKey(worker)) { plan.put(worker, new SubQueryPlan()); } SubQueryPlan workerPlan = plan.get(worker); workerPlan.addRootOp(op); } } return plan; }

Target:
public static Map<Integer, SubQueryPlan> instantiate(final List<PlanFragmentEncoding> fragments, final ConstructArgs args) throws CatalogException { int idx = 0; for (PlanFragmentEncoding fragment : fragments) { fragment.setFragmentIndex(idx++); } sanityCheckEdges(fragments); assignWorkersToFragments(fragments, args); Map<Integer, PlanFragmentEncoding> op2OwnerFragmentMapping = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { for (OperatorEncoding<?> op : fragment.operators) { op2OwnerFragmentMapping.put(op.opId, fragment); } } Map<Integer, Operator> allOperators = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { instantiateFragmentOperators(fragment, args, allOperators); } int loopCount = 0; while (setConsumerSchema(fragments, allOperators) && loopCount++ < allOperators.size()) { } Map<Integer, SubQueryPlan> plan = Maps.newHashMap(); for (PlanFragmentEncoding fragment : fragments) { RootOperator op = instantiateFragment(fragment, args, allOperators); for (Integer worker : fragment.workers) { if (!plan.containsKey(worker)) { plan.put(worker, new SubQueryPlan()); } SubQueryPlan workerPlan = plan.get(worker); workerPlan.addRootOp(op); } } return plan; }
Source:
public ListenableFuture<?> startMemoryRevoke() { return null; }

Target:
public ListenableFuture<?> startMemoryRevoke() { throw new UnsupportedOperationException("startMemoryRevoke not supported for InMemoryHashAggregationBuilder"); }
Source:
public void addBccAddresses(Address... bccRecipients) { if (bccRecipients.length > 0) { addRecipientsFromAddresses(RecipientType.BCC, bccRecipients); String bccAddress = account.getAlwaysBcc(); boolean alreadyVisible = recipientMvpView.isBccVisible(); boolean singleBccRecipientFromAccount = bccRecipients.length == 1 && bccRecipients[0].toString().equals(bccAddress); recipientMvpView.setBccVisibility(alreadyVisible || !singleBccRecipientFromAccount); updateRecipientExpanderVisibility(); } }

Target:
public void addBccAddresses(Address... bccRecipients) { if (bccRecipients.length > 0) { String bccAddress = account.getAlwaysBcc(); boolean alreadyVisible = recipientMvpView.isBccVisible(); boolean singleBccRecipientFromAccount = bccRecipients.length == 1 && bccRecipients[0].toString().equals(bccAddress); boolean showBcc = alreadyVisible || !singleBccRecipientFromAccount; if ( showBcc ) { addRecipientsFromAddresses(RecipientType.BCC, bccRecipients); } else { defaultBccAddress = bccRecipients[0]; } recipientMvpView.setBccVisibility(showBcc); updateRecipientExpanderVisibility(); } }
Source:
public GoogleComputeEngineServiceAdapter(GoogleComputeEngineApi api, @UserProject Supplier<String> userProject, Function<TemplateOptions, ImmutableMap.Builder<String, String>> metatadaFromTemplateOptions, @Named("zone") Predicate<AtomicReference<Operation>> operationDonePredicate, @Named(OPERATION_COMPLETE_INTERVAL) Long operationCompleteCheckInterval, @Named(OPERATION_COMPLETE_TIMEOUT) Long operationCompleteCheckTimeout, @Memoized Supplier<Map<URI, ? extends Location>> zones, @Memoized Supplier<Map<URI, ? extends Hardware>> hardwareMap, FirewallTagNamingConvention.Factory firewallTagNamingConvention) { this.api = checkNotNull(api, "google compute api"); this.userProject = checkNotNull(userProject, "user project name"); this.metatadaFromTemplateOptions = checkNotNull(metatadaFromTemplateOptions, "metadata from template options function"); this.operationCompleteCheckInterval = checkNotNull(operationCompleteCheckInterval, "operation completed check interval"); this.operationCompleteCheckTimeout = checkNotNull(operationCompleteCheckTimeout, "operation completed check timeout"); this.retryOperationDonePredicate = retry(operationDonePredicate, operationCompleteCheckTimeout, operationCompleteCheckInterval, TimeUnit.MILLISECONDS); this.zones = checkNotNull(zones, "zones"); this.hardwareMap = checkNotNull(hardwareMap, "hardwareMap"); this.firewallTagNamingConvention = firewallTagNamingConvention; }

Target:
public GoogleComputeEngineServiceAdapter(GoogleComputeEngineApi api, @UserProject Supplier<String> userProject, Function<TemplateOptions, ImmutableMap.Builder<String, String>> metatadaFromTemplateOptions, @Named("zone") Predicate<AtomicReference<Operation>> operationDonePredicate, @Named(OPERATION_COMPLETE_INTERVAL) Long operationCompleteCheckInterval, @Named(OPERATION_COMPLETE_TIMEOUT) Long operationCompleteCheckTimeout, @Memoized Supplier<Map<URI, ? extends Location>> zones, @Memoized Supplier<Map<URI, ? extends Hardware>> hardwareMap, FirewallTagNamingConvention.Factory firewallTagNamingConvention) { this.api = checkNotNull(api, "google compute api"); this.userProject = checkNotNull(userProject, "user project name"); this.metatadaFromTemplateOptions = checkNotNull(metatadaFromTemplateOptions, "metadata from template options function"); this.operationCompleteCheckInterval = checkNotNull(operationCompleteCheckInterval, "operation completed check interval"); this.operationCompleteCheckTimeout = checkNotNull(operationCompleteCheckTimeout, "operation completed check timeout"); this.retryOperationDonePredicate = retry(operationDonePredicate, operationCompleteCheckTimeout, operationCompleteCheckInterval, TimeUnit.MILLISECONDS); this.zones = checkNotNull(zones, "zones"); this.hardwareMap = checkNotNull(hardwareMap, "hardwareMap"); this.firewallTagNamingConvention = checkNotNull(firewallTagNamingConvention, "firewallTagNamingConvention"); }
Source:
public AnnotationCommandTargetResolver() { super(); }

Target:
public AnnotationCommandTargetResolver() { this.identifierAnnotation = TargetAggregateIdentifier.class; this.versionAnnotation = TargetAggregateVersion.class; }
Source:
public void testCreate() throws StripeException { Map<String, Object> owner = new HashMap<String, Object>(); owner.put("email", "jenny.rosen@example.com"); Map<String, Object> params = new HashMap<String, Object>(); params.put("type", "ach_credit_transfer"); params.put("currency", "usd"); params.put("owner", owner); Source source = Source.create(params); assertNotNull(source); verifyRequest( APIResource.RequestMethod.POST, "/v1/sources", params ); }

Target:
public void testCreate() throws StripeException { final Map<String, Object> owner = new HashMap<String, Object>(); owner.put("email", "jenny.rosen@example.com"); final Map<String, Object> params = new HashMap<String, Object>(); params.put("type", "ach_credit_transfer"); params.put("currency", "usd"); params.put("owner", owner); final Source source = Source.create(params); assertNotNull(source); verifyRequest( APIResource.RequestMethod.POST, "/v1/sources", params ); }
Source:
public Adapter getContentAdapter() { if (adapter == null) { adapter = new AdapterImpl() { @Override public void notifyChanged(final Notification notification) { switch (notification.getEventType()) { case Notification.ADD: case Notification.ADD_MANY: refreshChildren(); break; case Notification.MOVE: if (notification.getNewValue() instanceof IInterfaceElement) { refreshChildren(); } break; case Notification.REMOVE: case Notification.REMOVE_MANY: refreshChildren(); break; default: break; } } }; } return adapter; }

Target:
public Adapter getContentAdapter() { if (null == adapter) { adapter = new EContentAdapter() { @Override public void notifyChanged(final Notification notification) { switch (notification.getEventType()) { case Notification.ADD: case Notification.ADD_MANY: refreshChildren(); break; case Notification.MOVE: if (notification.getNewValue() instanceof IInterfaceElement) { refreshChildren(); } break; case Notification.REMOVE: case Notification.REMOVE_MANY: refreshChildren(); break; default: break; } } }; } return adapter; }
Source:
protected void firstListenerAdded() { if (!isDisposed()) { if (listener == null) { listener = property .adaptListener(new ISimplePropertyListener<ListDiff<E>>() { @Override public void handleEvent( final SimplePropertyEvent<ListDiff<E>> event) { if (!isDisposed() && !updating) { getRealm().exec(new Runnable() { @Override public void run() { if (event.type == SimplePropertyEvent.CHANGE) { modCount++; notifyIfChanged(event.diff); } else if (event.type == SimplePropertyEvent.STALE && !stale) { stale = true; fireStale(); } } }); } } }); } getRealm().exec(new Runnable() { @Override public void run() { cachedList = new ArrayList<E>(getList()); stale = false; if (listener != null) listener.addTo(source); } }); } }

Target:
protected void firstListenerAdded() { if (!isDisposed() && listener == null) { listener = property.adaptListener(new ISimplePropertyListener<ListDiff<E>>() { @Override public void handleEvent(final SimplePropertyEvent<ListDiff<E>> event) { if (!isDisposed() && !updating) { getRealm().exec(new Runnable() { @Override public void run() { if (event.type == SimplePropertyEvent.CHANGE) { modCount++; notifyIfChanged(event.diff); } else if (event.type == SimplePropertyEvent.STALE && !stale) { stale = true; fireStale(); } } }); } } }); } getRealm().exec(new Runnable() { @Override public void run() { cachedList = new ArrayList<E>(getList()); stale = false; if (listener != null) listener.addTo(source); } }); }
Source:
public V put(V value) { if (value != null) { if (matchingMode == MATCHING_MODE.KEEP_ALL) { allList.add(value); return value; } else { if (matchingMode == MATCHING_MODE.KEEP_LAST || !firstOrLastHash.containsKey(value)) { firstOrLastHash.put(value, value); return value; } } } return null; }

Target:
public V put(V value) { if (value == null) { return null; } if (matchingMode == MATCHING_MODE.KEEP_ALL) { allList.add(value); return value; } if (matchingMode == MATCHING_MODE.KEEP_LAST) { firstOrLastHash.put(value, value); return value; } if (!firstOrLastHash.containsKey(value)) { firstOrLastHash.put(value, value); return value; } return null; }
Source:
private void shutdownCompleted(String cause) { if (!this.executor.isShutdown()) { this.executor.execute(() -> generateNacksForPendingAcks(cause)); if (!this.executorExplicitlySet) { this.executor.shutdown(); } } }

Target:
private void shutdownCompleted(String cause) { this.executor.execute(() -> generateNacksForPendingAcks(cause)); }
Source:
private int getOffset(IDocument document, StyledText textWidget, Point point) throws BadLocationException { int widgetCaret= fViewer.getTextWidget().getCaretOffset(); if (fViewer instanceof ITextViewerExtension5) { ITextViewerExtension5 ext= (ITextViewerExtension5) fViewer; int offset = ext.widgetOffset2ModelOffset(textWidget.getOffsetAtPoint(point)); if (offset == -1) { int docLineIndex= ext.widgetLine2ModelLine(textWidget.getLineIndex(point.y)); String lineDelimiter= document.getLineDelimiter(docLineIndex); int delimLength= lineDelimiter == null ? 0 : lineDelimiter.length(); return document.getLineOffset(docLineIndex) + document.getLineLength(docLineIndex) - delimLength; } return offset; } IRegion visible= fViewer.getVisibleRegion(); return widgetCaret + visible.getOffset(); }

Target:
private int getOffset(IDocument document, StyledText textWidget, Point point) throws BadLocationException { int widgetCaret= fViewer.getTextWidget().getCaretOffset(); if (fViewer instanceof ITextViewerExtension5) { ITextViewerExtension5 ext= (ITextViewerExtension5) fViewer; int widgetOffset = textWidget.getOffsetAtPoint(point); int offset = widgetOffset != -1 ? ext.widgetOffset2ModelOffset(textWidget.getOffsetAtPoint(point)) : -1; if (offset == -1) { int docLineIndex= ext.widgetLine2ModelLine(textWidget.getLineIndex(point.y)); String lineDelimiter= document.getLineDelimiter(docLineIndex); int delimLength= lineDelimiter == null ? 0 : lineDelimiter.length(); return document.getLineOffset(docLineIndex) + document.getLineLength(docLineIndex) - delimLength; } return offset; } IRegion visible= fViewer.getVisibleRegion(); return widgetCaret + visible.getOffset(); }
Source:
private static String getExpectedErrorMessageForInsertExistingBucketedTable(InsertExistingPartitionsBehavior behavior, String partitionName) { if (behavior == InsertExistingPartitionsBehavior.APPEND) { return "Cannot insert into existing partition of bucketed Hive table: " + partitionName; } else if (behavior == InsertExistingPartitionsBehavior.ERROR) { return "Cannot insert into an existing partition of Hive table: " + partitionName; } throw new IllegalArgumentException("Unexpected insertExistingPartitionsBehavior: " + behavior.name()); }

Target:
private static String getExpectedErrorMessageForInsertExistingBucketedTable(InsertExistingPartitionsBehavior behavior, String partitionName) { if (behavior == InsertExistingPartitionsBehavior.APPEND) { return "Cannot insert into existing partition of bucketed Hive table: " + partitionName; } if (behavior == InsertExistingPartitionsBehavior.ERROR) { return "Cannot insert into an existing partition of Hive table: " + partitionName; } throw new IllegalArgumentException("Unexpected insertExistingPartitionsBehavior: " + behavior); }
Source:
private void waitUntilReady() { busySem.acquireUninterruptibly(); busySem.release(); }

Target:
private void waitUntilReady() { synchronized(busyLock) { while (busy) { try { busyLock.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } }
Source:
public void forAllUsers(UserIterator iterator) { Set<String> userAndRoles; for (String user : userSocketMap.keySet()) { userAndRoles = authorizationService.getRoles(user); userAndRoles.add(user); iterator.handleUser(user, userAndRoles); } }

Target:
public void forAllUsers(UserIterator iterator) { for (String user : userSocketMap.keySet()) { Set<String> userAndRoles = authorizationService.getRoles(user); userAndRoles.add(user); iterator.handleUser(user, userAndRoles); } }
Source:
private State getStateFromConfig(Config pilightConfig, PilightBindingConfig bindingConfig) { Location loc = pilightConfig.getConfig().get(bindingConfig.getLocation()); if (loc != null) { Device dev = loc.getDevices().get(bindingConfig.getDevice()); if (dev != null) { String devType = dev.getType().toString(); if (devType.equals(DeviceType.SWITCH) || devType.equals(DeviceType.DIMMER)) { OnOffType state = OnOffType.valueOf(dev.getState().toUpperCase()); if (dev.getDimlevel() != null && dev.getDimlevel() > 0) { if (state.equals(OnOffType.ON)) return new PercentType(getPercentageFromDimLevel(dev.getDimlevel().toString())); else return new PercentType(0); } return state; } else if (devType.equals(DeviceType.VALUE)) { bindingConfig.setDecimals(dev.getDeviceDecimals()); String property = bindingConfig.getProperty(); if (dev.getProperties().containsKey(property)) { String value = dev.getProperties().get(property); return getStateFromProperty(value, bindingConfig); } } } } return null; }

Target:
private State getStateFromConfig(Config pilightConfig, PilightBindingConfig bindingConfig) { Location loc = pilightConfig.getConfig().get(bindingConfig.getLocation()); if (loc != null) { Device dev = loc.getDevices().get(bindingConfig.getDevice()); if (dev != null) { String devType = dev.getType().toString(); if (devType.equals(DeviceType.SWITCH) || devType.equals(DeviceType.DIMMER)) { OnOffType state = OnOffType.valueOf(dev.getState().toUpperCase()); if (dev.getDimlevel() != null && dev.getDimlevel() > 0) { if (state.equals(OnOffType.ON)) return new PercentType(getPercentageFromDimLevel(dev.getDimlevel().toString())); else return PercentType.ZERO; } return state; } else if (devType.equals(DeviceType.VALUE)) { bindingConfig.setScale(dev.getScale()); String property = bindingConfig.getProperty(); if (dev.getProperties().containsKey(property)) { String value = dev.getProperties().get(property); return getStateFromProperty(value, bindingConfig); } } } } return null; }
Source:
private void writeFeatures() { if (vm.getClusterArch().getFamily() != ArchitectureType.x86) { return; } boolean acpiEnabled = vm.getAcpiEnable(); boolean kaslrEnabled = vmInfoBuildUtils.isKASLRDumpEnabled(vm.getVmOsId()); boolean ovmfEnabled = vm.getBiosType() == BiosType.Q35_SECURE_BOOT; if (!acpiEnabled && !hypervEnabled && !kaslrEnabled && !ovmfEnabled) { return; } writer.writeStartElement("features"); if (acpiEnabled) { writer.writeElement("acpi"); } if (hypervEnabled) { writer.writeStartElement("hyperv"); writer.writeStartElement("relaxed"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); writer.writeStartElement("vapic"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); writer.writeStartElement("spinlocks"); writer.writeAttributeString("state", "on"); writer.writeAttributeString("retries", "8191"); writer.writeEndElement(); writer.writeEndElement(); } if (kaslrEnabled) { writer.writeElement("vmcoreinfo"); } if (ovmfEnabled) { writer.writeStartElement("smm"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); } writer.writeEndElement(); }

Target:
private void writeFeatures() { if (vm.getClusterArch().getFamily() != ArchitectureType.x86) { return; } boolean acpiEnabled = vm.getAcpiEnable(); boolean kaslrEnabled = vmInfoBuildUtils.isKASLRDumpEnabled(vm.getVmOsId()); boolean secureBootEnabled = vm.getBiosType() == BiosType.Q35_SECURE_BOOT; if (!acpiEnabled && !hypervEnabled && !kaslrEnabled && !secureBootEnabled) { return; } writer.writeStartElement("features"); if (acpiEnabled) { writer.writeElement("acpi"); } if (hypervEnabled) { writer.writeStartElement("hyperv"); writer.writeStartElement("relaxed"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); writer.writeStartElement("vapic"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); writer.writeStartElement("spinlocks"); writer.writeAttributeString("state", "on"); writer.writeAttributeString("retries", "8191"); writer.writeEndElement(); writer.writeEndElement(); } if (kaslrEnabled) { writer.writeElement("vmcoreinfo"); } if (secureBootEnabled) { writer.writeStartElement("smm"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); } writer.writeEndElement(); }
Source:
public void onPlayerInteract(final PlayerInteractEvent event) { boolean updateActivity = true; switch (event.getAction()) { case RIGHT_CLICK_BLOCK: if (!event.isCancelled() && MaterialUtil.isBed(event.getClickedBlock().getType()) && ess.getSettings().getUpdateBedAtDaytime()) { User player = ess.getUser(event.getPlayer()); if (player.isAuthorized("essentials.sethome.bed") && player.getWorld().getEnvironment().equals(World.Environment.NORMAL)) { player.getBase().setBedSpawnLocation(event.getClickedBlock().getLocation()); player.sendMessage(tl("bedSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ())); } } break; case LEFT_CLICK_AIR: if (event.getPlayer().isFlying()) { final User user = ess.getUser(event.getPlayer()); if (user.isFlyClickJump()) { useFlyClickJump(user); break; } } break; case LEFT_CLICK_BLOCK: if (event.getItem() != null && event.getItem().getType() != Material.AIR) { final User user = ess.getUser(event.getPlayer()); if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getType())) { event.setCancelled(true); } } break; case PHYSICAL: updateActivity = false; break; default: break; } if (updateActivity) { ess.getUser(event.getPlayer()).updateActivityOnInteract(true); } }

Target:
public void onPlayerInteract(final PlayerInteractEvent event) { boolean updateActivity = true; switch (event.getAction()) { case RIGHT_CLICK_BLOCK: if (!event.isCancelled() && MaterialUtil.isBed(event.getClickedBlock().getType()) && ess.getSettings().getUpdateBedAtDaytime()) { User player = ess.getUser(event.getPlayer()); if (player.isAuthorized("essentials.sethome.bed") && player.getWorld().getEnvironment().equals(World.Environment.NORMAL)) { player.getBase().setBedSpawnLocation(event.getClickedBlock().getLocation()); player.sendMessage(tl("bedSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ())); } } break; case LEFT_CLICK_AIR: if (event.getPlayer().isFlying()) { final User user = ess.getUser(event.getPlayer()); if (user.isFlyClickJump()) { useFlyClickJump(user); break; } } case LEFT_CLICK_BLOCK: if (event.getItem() != null && event.getItem().getType() != Material.AIR) { final User user = ess.getUser(event.getPlayer()); if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getType())) { event.setCancelled(true); } } break; case PHYSICAL: updateActivity = false; break; default: break; } if (updateActivity) { ess.getUser(event.getPlayer()).updateActivityOnInteract(true); } }
Source:
public void shouldAddUserToWarehouse() { account = gd.getAccountService().createAccount(new Account(LOGIN, "nnPvcGXU7f", "FistName", "LastName"), getProperty("domain")); warehouseUser = service.addUserToWarehouse(warehouse, new WarehouseUser(WarehouseUser.ADMIN_ROLE, null, LOGIN)).get(60, TimeUnit.SECONDS); assertThat(warehouseUser, is(notNullValue())); }

Target:
public void shouldAddUserToWarehouse() { warehouseUser = service.addUserToWarehouse(warehouse, new WarehouseUser(WarehouseUser.ADMIN_ROLE, null, LOGIN)).get(60, TimeUnit.SECONDS); assertThat(warehouseUser, is(notNullValue())); }
Source:
@Override public void onPositiveClicked(String instanceTag) { if (instanceTag != null) { if (instanceTag == TAG_PUBLISH_CONFIRMATION_DIALOG) { mPost.setStatus(PostStatus.PUBLISHED.toString()); publishPost(); } else if (instanceTag == TAG_REMOVE_FAILED_UPLOADS_DIALOG) { mEditorFragment.removeAllFailedMediaUploads(); } } }

Target:
@Override public void onPositiveClicked(String instanceTag) { if (instanceTag != null) { if (instanceTag == TAG_PUBLISH_CONFIRMATION_DIALOG) { mPost.setStatus(PostStatus.PUBLISHED.toString()); publishPost(); } else if (instanceTag == TAG_REMOVE_FAILED_UPLOADS_DIALOG) { mEditorFragment.removeAllFailedMediaUploads(); } } else { ToastUtils.showToast(EditPostActivity.this, getString(R.string.editor_toast_no_action_taken)); AppLog.e(T.EDITOR, "Dialog instanceTag is null - positive button clicked, but no action taken"); } }
Source:
public CacheManager getCacheManager(URI uri, ClassLoader classLoader, Properties properties) { uri = uri == null ? getDefaultURI() : uri; classLoader = classLoader == null ? getDefaultClassLoader() : classLoader; properties = properties == null ? new Properties() : cloneProperties(properties); if (URI_DEFAULT.equals(uri)) { URI override = DefaultConfigurationResolver.resolveConfigURI(properties); if (override != null) { uri = override; } } Eh107CacheManager cacheManager; ConcurrentMap<URI, Eh107CacheManager> byURI; Configuration config; try { if (URI_DEFAULT.equals(uri)) { config = new DefaultConfiguration(classLoader); } else { config = new XmlConfiguration(uri.toURL(), classLoader); } } catch (Exception e) { throw new javax.cache.CacheException(e); } synchronized (cacheManagers) { byURI = cacheManagers.get(classLoader); if (byURI == null) { byURI = new ConcurrentHashMap<URI, Eh107CacheManager>(); cacheManagers.put(classLoader, byURI); } cacheManager = byURI.get(uri); if (cacheManager == null || cacheManager.isClosed()) { if(cacheManager != null) { byURI.remove(uri, cacheManager); } cacheManager = createCacheManager(config, uri, properties); byURI.put(uri, cacheManager); } } return cacheManager; }

Target:
public CacheManager getCacheManager(URI uri, ClassLoader classLoader, Properties properties) { uri = uri == null ? getDefaultURI() : uri; classLoader = classLoader == null ? getDefaultClassLoader() : classLoader; properties = properties == null ? new Properties() : cloneProperties(properties); if (URI_DEFAULT.equals(uri)) { URI override = DefaultConfigurationResolver.resolveConfigURI(properties); if (override != null) { uri = override; } } Configuration config; try { if (URI_DEFAULT.equals(uri)) { config = new DefaultConfiguration(classLoader); } else { config = new XmlConfiguration(uri.toURL(), classLoader); } } catch (Exception e) { throw new javax.cache.CacheException(e); } return getCacheManager(uri, config, properties); }
Source:
public Collection<Account> getAllAccounts() { return Collections.unmodifiableCollection(accounts); }

Target:
public Collection<Account> getAllAccounts() { return accounts; }
Source:
public int getForgottenFileGracePeriodDays() { return config.get(PRIAM_PRE + ".forgotten.file.grace.period", 1); }

Target:
public int getForgottenFileGracePeriodDays() { return config.get(PRIAM_PRE + ".forgottenFileGracePeriodDays", 1); }
Source:
public boolean isRequiredNetworkAffected(NetworkItemModel<?> op1, NetworkItemModel<?> op2) { final LogicalNetworkModel logicalNetworkModel = (LogicalNetworkModel) op1; return logicalNetworkModel.getNetwork().getCluster() != null && logicalNetworkModel.getNetwork() .getCluster() .isRequired(); }

Target:
public boolean isRequiredNetworkAffected(NetworkItemModel<?> op1, NetworkItemModel<?> op2) { final LogicalNetworkModel logicalNetworkModel = (LogicalNetworkModel) op1; return logicalNetworkModel.getNetwork().getCluster().isRequired(); }
Source:
public Map<String, Object> calculateOutPutVariables(MappingExecutionContext mappingExecutionContext, Map<String, Object> availableVariables) { Extension extensions = processExtensionService.getExtensionsForId(mappingExecutionContext.getProcessDefinitionId()); if (!extensions.hasMapping(mappingExecutionContext.getActivityId())) { return emptyMap(); } if (extensions.hasMappingTypeOutputs(mappingExecutionContext.getActivityId())) { return (availableVariables != null ? new HashMap<>(availableVariables) : emptyMap()); } if (availableVariables != null && !availableVariables.isEmpty()) { if (expressionResolver.containsExpression(availableVariables)) { throw new ActivitiIllegalArgumentException("Expressions are not allowed as variable values in the output mapping"); } return calculateOutPutVariables(mappingExecutionContext, extensions, availableVariables); } else { return emptyMap(); } }

Target:
public Map<String, Object> calculateOutPutVariables(MappingExecutionContext mappingExecutionContext, Map<String, Object> availableVariables) { Extension extensions = processExtensionService.getExtensionsForId(mappingExecutionContext.getProcessDefinitionId()); if (!extensions.hasMapping(mappingExecutionContext.getActivityId())) { return emptyMap(); } if (extensions.shouldMapAllOutputs(mappingExecutionContext.getActivityId())) { return (availableVariables != null ? new HashMap<>(availableVariables) : emptyMap()); } if (availableVariables != null && !availableVariables.isEmpty()) { if (expressionResolver.containsExpression(availableVariables)) { throw new ActivitiIllegalArgumentException("Expressions are not allowed as variable values in the output mapping"); } return calculateOutPutVariables(mappingExecutionContext, extensions, availableVariables); } else { return emptyMap(); } }
Source:
public List<Project> getProjectsByRegex(String regexPattern) { List<Project> allProjects = new ArrayList<Project>(); Pattern pattern; try { pattern = Pattern.compile(regexPattern, Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException e) { logger.error("Bad regex pattern " + regexPattern); return allProjects; } List<Project> projects = getProjects(); for (Project project : projects) { if (pattern.matcher(project.getName()).find()) { allProjects.add(project); } } return allProjects; }

Target:
public List<Project> getProjectsByRegex(String regexPattern) { List<Project> allProjects = new ArrayList<Project>(); Pattern pattern; try { pattern = Pattern.compile(regexPattern, Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException e) { logger.error("Bad regex pattern " + regexPattern); return allProjects; } for (Project project : getProjects()) { if (pattern.matcher(project.getName()).find()) { allProjects.add(project); } } return allProjects; }
Source:
public ContentInfo createContent(ContentInfo cinfo) { if (cinfo == null) { throw new IllegalArgumentException("cinfo is null"); } if (cinfo.getId() == null || cinfo.getId().matches("\\A\\s*\\z")) { throw new IllegalArgumentException("content is lacking an identifier: " + cinfo); } if (this.contentMap.containsKey(cinfo.getId())) { throw new IllegalStateException("content already exists: " + cinfo.getId()); } ContentData cdata = new ContentData(); cdata.setId(cinfo.getId()); cdata.setType(cinfo.getType()); cdata.setLabel(cinfo.getLabel()); cdata.setName(cinfo.getName()); cdata.setVendor(cinfo.getVendor()); cdata.setContentUrl(cinfo.getContentUrl()); cdata.setRequiredTags(cinfo.getRequiredTags()); cdata.setReleaseVersion(cinfo.getReleaseVersion()); cdata.setGpgUrl(cinfo.getGpgUrl()); cdata.setArches(cinfo.getArches()); cdata.setMetadataExpiration(cinfo.getMetadataExpiration()); cdata.setRequiredProductIds(cinfo.getRequiredProductIds()); cdata.setCreated(new Date()); cdata.setUpdated(new Date()); this.contentMap.put(cdata.getId(), cdata); this.contentProductMap.put(cdata.getId(), new HashSet<>()); return cdata; }

Target:
public ContentInfo createContent(ContentInfo cinfo) { if (cinfo == null) { throw new IllegalArgumentException("cinfo is null"); } if (StringUtils.isBlank(cinfo.getId())) { throw new IllegalArgumentException("content is lacking an identifier: " + cinfo); } if (this.contentMap.containsKey(cinfo.getId())) { throw new IllegalStateException("content already exists: " + cinfo.getId()); } ContentData cdata = new ContentData(); cdata.setId(cinfo.getId()); cdata.setType(cinfo.getType()); cdata.setLabel(cinfo.getLabel()); cdata.setName(cinfo.getName()); cdata.setVendor(cinfo.getVendor()); cdata.setContentUrl(cinfo.getContentUrl()); cdata.setRequiredTags(cinfo.getRequiredTags()); cdata.setReleaseVersion(cinfo.getReleaseVersion()); cdata.setGpgUrl(cinfo.getGpgUrl()); cdata.setArches(cinfo.getArches()); cdata.setMetadataExpiration(cinfo.getMetadataExpiration()); cdata.setRequiredProductIds(cinfo.getRequiredProductIds()); cdata.setCreated(new Date()); cdata.setUpdated(new Date()); this.contentMap.put(cdata.getId(), cdata); this.contentProductMap.put(cdata.getId(), new HashSet<>()); return cdata; }
Source:
public void setUp() { deviceHandler = new EventHandlerTest(); passingHandler = new FilterHandler(); filtingHandler = new FilterHandler(); filtingHandler.setFilterInvalid(true); filtingHandler.setFilterZero(true); filtingHandler.setFilterDuplicate(true); filtingHandler.setFilterFuture(true); filtingHandler.setFilterApproximate(true); filtingHandler.setFilterStatic(true); filtingHandler.setFilterDistance(10); filtingHandler.setFilterLimit(10); }

Target:
public void setUp() { passingHandler = new FilterHandler(); filtingHandler = new FilterHandler(); filtingHandler.setFilterInvalid(true); filtingHandler.setFilterZero(true); filtingHandler.setFilterDuplicate(true); filtingHandler.setFilterFuture(true); filtingHandler.setFilterApproximate(true); filtingHandler.setFilterStatic(true); filtingHandler.setFilterDistance(10); filtingHandler.setFilterLimit(10); }
Source:
private Collection<ValidationRule> getFailingRulesFromDiagramExtension(EObject objectToValidate, DiagramDescription diagDescExtension, Collection<Viewpoint> viewpoints) { Collection<ValidationRule> failingRules = viewpoints.stream().flatMap(vp -> vp.getOwnedRepresentationExtensions().stream()).filter(DiagramExtensionDescription.class::isInstance) .filter(ext -> ComponentizationHelper.match(diagDescExtension, ext)).map(ext -> ((DiagramExtensionDescription) ext).getValidationSet()).filter(Objects::nonNull) .flatMap(vs -> getFaillingRulesFromCollection(objectToValidate, vs.getAllRules().iterator()).stream()).collect(Collectors.toList()); return failingRules; }

Target:
private Collection<ValidationRule> getFailingRulesFromDiagramExtension(EObject objectToValidate, DiagramDescription diagDescExtension, Collection<Viewpoint> viewpoints) { Collection<ValidationRule> failingRules = viewpoints.stream().flatMap(vp -> vp.getOwnedRepresentationExtensions().stream()).filter(DiagramExtensionDescription.class::isInstance) .filter(ext -> ComponentizationHelper.match(diagDescExtension, ext)).map(ext -> ((DiagramExtensionDescription) ext).getValidationSet()).filter(Objects::nonNull) .flatMap(vs -> getFailingRulesFromCollection(objectToValidate, vs.getAllRules().iterator()).stream()).collect(Collectors.toList()); return failingRules; }
Source:
private Assignment getOrcreateWrapperByValueCheckStrategy(Assignment assignment, boolean isUpdate) { if ( valueSetCheckStrategy == null ) { return createNullCheckWrapper( assignment, isUpdate ); } switch ( valueSetCheckStrategy ) { case IS_NULL_INLINE: return createNullCheckWrapper( assignment, isUpdate ); case CUSTOM: String hasMethod = this.getSourceHasMethod(); if ( hasMethod == null ) { throw new IllegalArgumentException( sourceReference.getParameter().getName() + " does not have 'hasX()' method." ); } return isUpdate ? new UpdateHasCheckWrapper( assignment, method.getThrownTypes(), hasMethod ) : new HasCheckWrapper( assignment, method.getThrownTypes(), hasMethod ); case IS_NULL: default: return assignment; } }

Target:
private Assignment getOrcreateWrapperByValueCheckStrategy(Assignment assignment, boolean isUpdate) { if ( valueSetCheckStrategy == null ) { return createNullCheckWrapper( assignment, isUpdate ); } switch ( valueSetCheckStrategy ) { case IS_NULL: if (getSourceType().isPrimitive() ) { return assignment; } return createNullCheckWrapper( assignment, isUpdate ); case IS_NULL_INLINE: if (isUpdate || ( (assignment.getType().isTypeRelated() || assignment.getType().isDirect() ) && !getSourceType().isPrimitive() ) ) { return createNullCheckWrapper( assignment, isUpdate ); } return assignment; case CUSTOM: String presenceChecker = getPresenceChecker(); if ( presenceChecker == null ) { ctx.getMessager().printMessage( method.getExecutable(), Message.PROPERTYMAPPING_NO_PRESENCE_CHECKER_FOR_SOURCE_TYPE, getSourceElement() ); } return isUpdate ? new UpdatePresenceCheckWrapper( assignment, presenceChecker ) : new PresenceCheckWrapper( assignment, presenceChecker ); default: return assignment; } }
Source:
private boolean isObjectColumnPresent(TableDefinition tableDefinition) { for (Attribute attribute: tableDefinition.getAttributeList()) { if (attribute.getType() == Attribute.Type.OBJECT) { return true; } } return false; }

Target:
private boolean isObjectColumnPresent(TableDefinition tableDefinition) { return tableDefinition.getAttributeList() .stream().anyMatch(attribute -> attribute.getType() == Attribute.Type.OBJECT); }
Source:
public ListenableFuture<BufferSummary> getTaskSummary(TaskId taskId, OutputBufferId bufferId, long startingSequenceId, long maxBytes) { requireNonNull(taskId, "taskId is null"); requireNonNull(bufferId, "bufferId is null"); checkArgument(startingSequenceId >= 0, "startingSequenceId is negative"); requireNonNull(maxBytes, "maxSize is null"); return tasks.getUnchecked(taskId).getTaskSummary(bufferId, startingSequenceId, maxBytes); }

Target:
public ListenableFuture<BufferSummary> getTaskSummary(TaskId taskId, OutputBufferId bufferId, long startingSequenceId, long maxBytes) { requireNonNull(taskId, "taskId is null"); requireNonNull(bufferId, "bufferId is null"); checkArgument(startingSequenceId >= 0, "startingSequenceId is negative"); checkArgument(maxBytes > 0, "maxBytes should be at least 1"); return tasks.getUnchecked(taskId).getTaskSummary(bufferId, startingSequenceId, maxBytes); }
Source:
public void assertTenantOrParentTenant(TenantAware tenantAware) { if (tenantAware == null) { return; } if (!Objects.equals(tenantAware.getTenantAsString(), getCurrentTenant().map(Tenant::getIdAsString).orElse(null)) && !Objects.equals(tenantAware.getTenantAsString(), getCurrentTenant().map(Tenant::getParent) .map(SQLEntityRef::getId) .map(Value::of) .map(Value::getString) .orElse(null))) { throw Exceptions.createHandled().withNLSKey("BizController.invalidTenant").handle(); } }

Target:
public void assertTenantOrParentTenant(TenantAware tenantAware) { if (tenantAware == null) { return; } if (!Objects.equals(tenantAware.getTenantAsString(), getCurrentTenant().map(Tenant::getIdAsString).orElse(null)) && !Objects.equals(tenantAware.getTenantAsString(), getCurrentTenant().map(Tenant::getParent) .filter(SQLEntityRef::isFilled) .map(SQLEntityRef::getId) .map(String::valueOf) .orElse(null))) { throw Exceptions.createHandled().withNLSKey("BizController.invalidTenant").handle(); } }
Source:
public static Value haversin( AnyValue in ) { if ( in == NO_VALUE ) { return NO_VALUE; } else if ( in instanceof NumberValue ) { return doubleValue( (1.0 - Math.cos( ((NumberValue) in).doubleValue() )) / 2 ); } else { throw new CypherTypeException( "asin requires numbers", null ); } }

Target:
public static Value haversin( AnyValue in ) { if ( in == NO_VALUE ) { return NO_VALUE; } else if ( in instanceof NumberValue ) { return doubleValue( (1.0 - Math.cos( ((NumberValue) in).doubleValue() )) / 2 ); } else { throw needsNumbers( "haversin()" ); } }
Source:
public V3Server(DELEGATE delegate) { if (delegate == null) { throw new NullPointerException("The delegate of a V3 server can't be null"); } this.delegate = delegate; }

Target:
public V3Server(DELEGATE delegate) { Objects.requireNonNull(delegate, "The delegate of a V3 server can't be null"); this.delegate = delegate; }
Source:
public void shouldCreateMapWithAllValues() { final var yesterday = ZonedDateTime.now().minusDays(1); final var tomorrow = ZonedDateTime.now().plusDays(1); var params = aDirectDebitSearchMandatesParams() .withBankStatementReference("a bank statement reference") .withDisplaySize(10) .withEmail("test@test.test") .withFromDate(yesterday) .withToDate(tomorrow) .withName("test") .withPage(1) .withReference("a reference") .withState("pending") .build(); var paramsAsMap = params.paramsAsMap(); assertThat(paramsAsMap, IsMapContaining.hasEntry("bank_statement_reference", "a bank statement reference")); assertThat(paramsAsMap, IsMapContaining.hasEntry("display_size", String.valueOf(10))); assertThat(paramsAsMap, IsMapContaining.hasEntry("email", "test@test.test")); assertThat(paramsAsMap, IsMapContaining.hasEntry("from_date", yesterday.toString())); assertThat(paramsAsMap, IsMapContaining.hasEntry("to_date", tomorrow.toString())); assertThat(paramsAsMap, IsMapContaining.hasEntry("name", "test")); assertThat(paramsAsMap, IsMapContaining.hasEntry("page", String.valueOf(1))); assertThat(paramsAsMap, IsMapContaining.hasEntry("reference", "a reference")); assertThat(paramsAsMap, IsMapContaining.hasEntry("state", "pending")); assertThat(paramsAsMap, IsMapContaining.hasEntry("reference", "a reference")); }

Target:
public void shouldCreateMapWithAllValues() { final var yesterday = ZonedDateTime.now().minusDays(1); final var tomorrow = ZonedDateTime.now().plusDays(1); var params = aDirectDebitSearchMandatesParams() .withBankStatementReference("a bank statement reference") .withDisplaySize(10) .withEmail("test@test.test") .withFromDate(yesterday) .withToDate(tomorrow) .withName("test") .withPage(1) .withReference("a reference") .withState("pending") .build(); var paramsAsMap = params.paramsAsMap(); assertThat(paramsAsMap, hasEntry("bank_statement_reference", "a bank statement reference")); assertThat(paramsAsMap, hasEntry("display_size", String.valueOf(10))); assertThat(paramsAsMap, hasEntry("email", "test@test.test")); assertThat(paramsAsMap, hasEntry("from_date", yesterday.toString())); assertThat(paramsAsMap, hasEntry("to_date", tomorrow.toString())); assertThat(paramsAsMap, hasEntry("name", "test")); assertThat(paramsAsMap, hasEntry("page", String.valueOf(1))); assertThat(paramsAsMap, hasEntry("reference", "a reference")); assertThat(paramsAsMap, hasEntry("state", "pending")); assertThat(paramsAsMap, hasEntry("reference", "a reference")); }
Source:
private void forceHttpServiceLoading ( BundleContext context ) throws Exception { try { if ( System.getProperty(WebKeys.OSGI_ENABLED)!=null ) { if (null == OSGIProxyServlet.bundleContext) { initProxyServlet(context); } else { try { OSGIProxyServlet.bundleContext.getBundle(); } catch (IllegalStateException e) { initProxyServlet(context); } } } } catch ( Exception e ) { Logger.error( this, "Error loading HttpService.", e ); throw e; } }

Target:
private void forceHttpServiceLoading ( BundleContext context ) throws Exception { try { if ( System.getProperty(WebKeys.OSGI_ENABLED)!=null ) { if (null == OSGIProxyServlet.bundleContext) { synchronized (this) { if (null == OSGIProxyServlet.bundleContext) { initProxyServlet(context); } } } else { try { OSGIProxyServlet.bundleContext.getBundle(); } catch (IllegalStateException e) { initProxyServlet(context); } } } } catch ( Exception e ) { Logger.error( this, "Error loading HttpService.", e ); throw e; } }
Source:
private boolean checkIsValid() { if (isRequired()) { setValidationState(ValidationState.INVALID_BY_REQUIRED_WITHOUT_VALUE); } else { setValidationState(ValidationState.VALID); } return !isRequired(); }

Target:
private boolean checkIsValid() { if (isRequired()) { setValidationState(ValidationState.INVALID_BY_REQUIRED_WITHOUT_VALUE); return false; } else { setValidationState(ValidationState.VALID); return true; } }
Source:
public static void assertOperatorIsUnblocked(Operator operator, Duration timeout) { try { operator.isBlocked().get(timeout.toMillis(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException("interrupted", e); } catch (ExecutionException e) { throw new RuntimeException(e.getCause()); } catch (TimeoutException ignored) { fail("Operator is expected to be unblocked within " + timeout.toString()); } }

Target:
public static void assertOperatorIsUnblocked(Operator operator, Duration timeout) { if (!waitForOperatorToUnblock(operator, timeout)) { fail("Operator is expected to be unblocked within " + timeout.toString()); } }