auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private List<InternalHiveSplit> getBucketedSplits(Path path, FileSystem fileSystem, InternalHiveSplitFactory splitFactory, BucketSplitInfo bucketSplitInfo) { int bucketCount = bucketSplitInfo.getBucketCount(); ArrayList<LocatedFileStatus> files = new ArrayList<>(bucketCount); try { Iterators.addAll(files, new HiveFileIterator(path, fileSystem, directoryLister, namenodeStats, FAIL)); } catch (NestedDirectoryNotAllowedException e) { throw new PrestoException(HIVE_INVALID_BUCKET_FILES, format("%s Found sub-directory in bucket directory for partition: %s", getCorruptBucketingMsg(), splitFactory.getPartitionName())); } if (files.size() != bucketCount) { throw new PrestoException(HIVE_INVALID_BUCKET_FILES, format("%s The number of files in the directory (%s) does not match the declared bucket count (%s) for partition: %s", getCorruptBucketingMsg(), files.size(), bucketCount, splitFactory.getPartitionName())); } files.sort(null); List<InternalHiveSplit> splitList = new ArrayList<>(); for (int bucketNumber = 0; bucketNumber < bucketCount; bucketNumber++) { if (bucketSplitInfo.isBucketEnabled(bucketNumber)) { LocatedFileStatus file = files.get(bucketNumber); splitFactory.createInternalHiveSplit(file, bucketNumber) .ifPresent(splitList::add); } } return splitList; }

Target:
private List<InternalHiveSplit> getBucketedSplits(Path path, FileSystem fileSystem, InternalHiveSplitFactory splitFactory, BucketSplitInfo bucketSplitInfo) { int bucketCount = bucketSplitInfo.getBucketCount(); ArrayList<LocatedFileStatus> files = new ArrayList<>(bucketCount); try { Iterators.addAll(files, new HiveFileIterator(path, fileSystem, directoryLister, namenodeStats, FAIL)); } catch (NestedDirectoryNotAllowedException e) { throw new PrestoException( HIVE_INVALID_BUCKET_FILES, format("Hive table '%s' is corrupt. Found sub-directory in bucket directory for partition: %s", new SchemaTableName(table.getDatabaseName(), table.getTableName()), splitFactory.getPartitionName())); } if (files.size() != bucketCount) { throw new PrestoException( HIVE_INVALID_BUCKET_FILES, format("Hive table '%s' is corrupt. The number of files in the directory (%s) does not match the declared bucket count (%s) for partition: %s", new SchemaTableName(table.getDatabaseName(), table.getTableName()), files.size(), bucketCount, splitFactory.getPartitionName())); } files.sort(null); List<InternalHiveSplit> splitList = new ArrayList<>(); for (int bucketNumber = 0; bucketNumber < bucketCount; bucketNumber++) { if (bucketSplitInfo.isBucketEnabled(bucketNumber)) { LocatedFileStatus file = files.get(bucketNumber); splitFactory.createInternalHiveSplit(file, bucketNumber) .ifPresent(splitList::add); } } return splitList; }
Source:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateMessageEventCatching emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertMessageEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }

Target:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateMessageEventCatching emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertMessageEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
public void initWeights() { InitMethod defaultMode = InitMethod.ZERO; initWeight(defaultMode); }

Target:
public void initWeights() { InitMethod defaultMode = InitMethod.ZERO_ONE_RANGE_RANDOM; initWeight(defaultMode); }
Source:
public void testDistributedSQLForOnlyLOCAL_KEYIterationType() throws InterruptedException { dsDistributedMap3.put(1, new User(1, "TestName1", "TestSurname1", 10)); dsDistributedMap3.put(2, new User(2, "TestName2", "TestSurname2", 20)); dsDistributedMap3.put(3, new User(3, "TestName3", "TestSurname3", 30)); Message<?> msg = null; for (int i = 0; i < 10; i++) { msg = dsMapChannel3.receive(); if (((Collection) msg.getPayload()).iterator().hasNext()) { break; } Thread.sleep(1_000); } Assert.assertNotNull(msg); Assert.assertNotNull(msg.getPayload()); Assert.assertTrue(msg.getPayload() instanceof Collection); Assert.assertEquals(2, ((Collection) msg.getPayload()).iterator().next()); }

Target:
public void testDistributedSQLForOnlyLOCAL_KEYIterationType() throws InterruptedException { dsDistributedMap3.put(1, new HazelcastIntegrationTestUser(1, "TestName1", "TestSurname1", 10)); dsDistributedMap3.put(2, new HazelcastIntegrationTestUser(2, "TestName2", "TestSurname2", 20)); dsDistributedMap3.put(3, new HazelcastIntegrationTestUser(3, "TestName3", "TestSurname3", 30)); Message<?> msg = dsMapChannel3.receive(2_000); Assert.assertNotNull(msg); Assert.assertNotNull(msg.getPayload()); Assert.assertTrue(msg.getPayload() instanceof Collection); Assert.assertEquals(2, ((Collection<?>) msg.getPayload()).iterator().next()); }
Source:
protected void ExecuteVmCommand() { if (getVm().getstatus() == VMStatus.Up) { runVdsCommand(getParameters().getAction().getCommandType(), new HotPlugUnplgNicVDSParameters(getVm().getrun_on_vds().getValue(), getVm().getId(), DbFacade.getInstance().getVmNetworkInterfaceDAO().get(getParameters().getNicId()), vmDevice)); } TransactionSupport.executeInNewTransaction(updateDevice()); VmDeviceUtils.updateBootOrderInVmDevice(getVm().getStaticData()); setSucceeded(true); }

Target:
protected void ExecuteVmCommand() { if (vmStatusDemandsHotPlugNic(getVm().getstatus())) { runVdsCommand(getParameters().getAction().getCommandType(), new HotPlugUnplgNicVDSParameters(getVm().getrun_on_vds().getValue(), getVm().getId(), DbFacade.getInstance().getVmNetworkInterfaceDAO().get(getParameters().getNicId()), vmDevice)); } TransactionSupport.executeInNewTransaction(updateDevice()); VmDeviceUtils.updateBootOrderInVmDevice(getVm().getStaticData()); setSucceeded(true); }
Source:
public Response importDevice( @MultipartForm ImporterForm form, @Context HttpServletRequest request) { final Variant variant = loadVariantWhenAuthorized(request); if (variant == null) { return appendAllowOriginHeader( Response.status(Status.UNAUTHORIZED) .header("WWW-Authenticate", "Basic realm=\"AeroGear UnifiedPush Server\"") .entity("Unauthorized Request"), request); } List<Installation> devices = null; try { devices = mapper.readValue(form.getJsonFile(), new TypeReference<List<Installation>>() {}); } catch (IOException e) { logger.log(Level.SEVERE, "Error when parsing importer json file"); } logger.log(Level.INFO, "Devices to import: " + devices.size()); clientInstallationService.addInstallations(variant, devices); return Response.status(Status.OK) .entity("Job submitted for processing").build(); }

Target:
public Response importDevice( @MultipartForm ImporterForm form, @Context HttpServletRequest request) { final Variant variant = loadVariantWhenAuthorized(request); if (variant == null) { return appendAllowOriginHeader( Response.status(Status.UNAUTHORIZED) .header("WWW-Authenticate", "Basic realm=\"AeroGear UnifiedPush Server\"") .entity("Unauthorized Request"), request); } List<Installation> devices; try { devices = mapper.readValue(form.getJsonFile(), new TypeReference<List<Installation>>() {}); } catch (IOException e) { logger.log(Level.SEVERE, "Error when parsing importer json file", e); return Response.status(Status.BAD_REQUEST).build(); } logger.log(Level.INFO, "Devices to import: " + devices.size()); clientInstallationService.addInstallations(variant, devices); return Response.status(Status.OK) .entity("Job submitted for processing").build(); }
Source:
private Object onMutation(MutationRecord[] records) { for (MutationRecord r : records) { System.out.println(r.target.nodeName + " " + r.attributeName + ": " + r.oldValue + " type: " + r.type); Element element = Js.cast(r.target); for (Widget w : getChildren()) { if (w instanceof MaterialCollapsibleItem && element.equals(w.getElement())) { fireCollapsibleHandler((MaterialCollapsibleItem) w); break; } } } return null; }

Target:
private Object onMutation(MutationRecord[] records) { for (MutationRecord r : records) { Element element = Js.cast(r.target); for (Widget w : getChildren()) { if (w instanceof MaterialCollapsibleItem && element.equals(w.getElement())) { fireCollapsibleHandler((MaterialCollapsibleItem) w); break; } } } return null; }
Source:
public void updateDroneLeashPath(PathSource pathSource) { final BaiduMap map = getBaiduMap(); if (map == null) return; List<LatLong> pathCoords = pathSource.getPathPoints(); final List<LatLng> pathPoints = new ArrayList<LatLng>(pathCoords.size()); for (LatLong coord : pathCoords) { pathPoints.add(CoordToLatLang(coord)); } if (pathPoints.size() < 2) { if (mDroneLeashPath != null) { mDroneLeashPath.remove(); mDroneLeashPath = null; } return; } if (mDroneLeashPath == null) { PolylineOptions flightPath = new PolylineOptions(); flightPath.color(DRONE_LEASH_DEFAULT_COLOR).width( DroneHelper.scaleDpToPixels(DRONE_LEASH_DEFAULT_WIDTH, getResources())); mDroneLeashPath = (Polyline)getBaiduMap().addOverlay(flightPath); } else { mDroneLeashPath.setPoints(pathPoints); } }

Target:
public void updateDroneLeashPath(PathSource pathSource) { @PolyLineType int PolyLineType = LEASH_PATH; mDroneLeashPath = updatePath(mDroneLeashPath, pathSource, PolyLineType); }
Source:
public void viewEvent() { LOG.debug("view-event: begin"); if (null == selectedEvent) { LOG.info("no event selected for view."); HelperUtil.addMessageError(null, "You need to selected an event."); return; } selectedEvent = service.getLogEvent(selectedEvent.getId()); if (StringUtils.isNotBlank(selectedEvent.getDescription())) { selectedEventJson = new JSONObject(selectedEvent.getDescription()); } HelperUtil.execPFShowDialog("wgvDlgViewEventErrorlog"); }

Target:
public void viewEvent() { if (null == selectedEvent) { return; } selectedEvent = service.getLogEvent(selectedEvent.getId()); if (StringUtils.isNotBlank(selectedEvent.getDescription())) { selectedEventJson = new JSONObject(selectedEvent.getDescription()); } HelperUtil.execPFShowDialog("wgvDlgViewEventErrorlog"); }
Source:
private void handleFinishRollup(final FinishRollupMessage message) { _metrics.recordCounter("rollup/executor/finish_rollup_message/received", 1); _rollupManager.tell(message, getSelf()); final RollupDefinition defn = message.getRollupDefinition(); if (shouldRequestConsistencyCheck(message)) { requestConsistencyCheck(defn); } fetchRollup(); }

Target:
private void handleFinishRollup(final FinishRollupMessage message) { _metrics.recordCounter("rollup/executor/finish_rollup_message/received", 1); _rollupManager.tell(message, getSelf()); fetchRollup(); }
Source:
public void shouldThrowException_whenUpdatingToInvalidState() throws Exception { PaymentRequestEntity paymentRequestEntity = aValidPaymentRequestEntity() .withGatewayAccountEntity(gatewayAccount) .build(); paymentRequestDao.persist(paymentRequestEntity); paymentRequestDao.updateChargeTransactionStatus(paymentRequestEntity.getExternalId(), ChargeStatus.AUTHORISATION_READY); }

Target:
public void shouldThrowException_whenUpdatingToInvalidState() throws Exception { ChargeStatus initialStatus = ChargeStatus.CREATED; PaymentRequestEntity paymentRequestEntity = aValidPaymentRequestEntity() .withGatewayAccountEntity(gatewayAccount) .withTransactions(aChargeTransactionEntity().withStatus(initialStatus).build()) .build(); paymentRequestDao.persist(paymentRequestEntity); statusUpdater.updateChargeTransactionStatus(paymentRequestEntity.getExternalId(), ChargeStatus.AUTHORISATION_READY); }
Source:
@Override public Card getCard() { return null; }

Target:
@Override @Nullable public Card getCard() { return null; }
Source:
public void testIPV6EncodeProxyV1() { HAProxyMessageEncoder encoder = new HAProxyMessageEncoder(); EmbeddedChannel ch = new EmbeddedChannel(encoder); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V1, HAProxyCommand.PROXY, HAProxyProxiedProtocol.TCP6, "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "1050:0:0:0:5:600:300c:326b", 56324, 443); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); assertEquals("PROXY TCP6 2001:0db8:85a3:0000:0000:8a2e:0370:7334 1050:0:0:0:5:600:300c:326b 56324 443\r\n", byteBuf.toString(CharsetUtil.US_ASCII)); }

Target:
public void testIPV6EncodeProxyV1() { EmbeddedChannel ch = new EmbeddedChannel(INSTANCE); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V1, HAProxyCommand.PROXY, HAProxyProxiedProtocol.TCP6, "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "1050:0:0:0:5:600:300c:326b", 56324, 443); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); assertEquals("PROXY TCP6 2001:0db8:85a3:0000:0000:8a2e:0370:7334 1050:0:0:0:5:600:300c:326b 56324 443\r\n", byteBuf.toString(CharsetUtil.US_ASCII)); byteBuf.release(); assertFalse(ch.finish()); }
Source:
public void getCores(IDMContext dmc, final DataRequestMonitor<ICoreDMContext[]> rm) { if (!getSessionInitializationComplete()) { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Debug session not initialized yet", null)); return; } if (dmc instanceof ICPUDMContext) { final ICPUDMContext cpuDmc = (ICPUDMContext)dmc; getResourcesInformation(dmc, CPUResourceClass, new DataRequestMonitor<IResourcesInformation>(getExecutor(), rm) { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleCompleted() { if (isSuccess()) { ICoreInfo[] cores = new CoreList(getData()).getCoreList(); rm.done(parseCoresInfoForCores(cpuDmc, cores)); } else { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, NOT_SUPPORTED, "Operation not supported", null)); } } }); } else { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid DMC type", null)); } }

Target:
public void getCores(IDMContext dmc, final DataRequestMonitor<ICoreDMContext[]> rm) { if (!getSessionInitializationComplete()) { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Debug session not initialized yet", null)); return; } if (dmc instanceof ICPUDMContext) { final ICPUDMContext cpuDmc = (ICPUDMContext)dmc; if (coreListCache != null) { rm.done(parseCoresInfoForCores(cpuDmc, coreListCache)); return; } getResourcesInformation(dmc, CPUResourceClass, new DataRequestMonitor<IResourcesInformation>(getExecutor(), rm) { @Override @ConfinedToDsfExecutor("getExecutor()") protected void handleCompleted() { if (isSuccess()) { coreListCache = new CoreList(getData()).getCoreList(); rm.done(parseCoresInfoForCores(cpuDmc, coreListCache)); } else { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, NOT_SUPPORTED, "Operation not supported", null)); } } }); } else { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid DMC type", null)); } }
Source:
private <T extends TEntityType.Builder<T>> T convert(org.eclipse.winery.model.tosca.yaml.TEntityType node, T builder) { builder.addDocumentation(node.getDescription()) .setDerivedFrom(node.getDerivedFrom()) .addTags(convertMetadata(node.getMetadata())) .setTargetNamespace(node.getMetadata().get("targetNamespace")); if (node.getVersion() != null) { TTag tag = new TTag(); tag.setName("version"); tag.setValue(node.getVersion().getVersion()); builder.addTags(tag); } if (!node.getProperties().isEmpty()) { WinerysPropertiesDefinition properties = new WinerysPropertiesDefinition(); PropertyDefinitionKVList propertyDefinitionKVList = new PropertyDefinitionKVList(); node.getProperties().forEach((name, property) -> { QName type = TypeConverter.INSTANCE.convert(property.getType()); propertyDefinitionKVList.add(new PropertyDefinitionKV(name, Optional.ofNullable(type.getPrefix()) .map(i -> i.concat(":")).orElse("") .concat(type.getLocalPart()))); }); WinerysPropertiesDefinition propertiesDefinition = new WinerysPropertiesDefinition(); propertiesDefinition.setPropertyDefinitionKVList(propertyDefinitionKVList); builder.addAny(propertiesDefinition); builder.setPropertiesDefinition(convertPropertyDefinition(builder.build().getIdFromIdOrNameField() + "_Properties")); } return builder; }

Target:
private <T extends TEntityType.Builder<T>> T convert(org.eclipse.winery.model.tosca.yaml.TEntityType node, T builder) { builder.addDocumentation(node.getDescription()) .setDerivedFrom(node.getDerivedFrom()) .addTags(convertMetadata(node.getMetadata())) .setTargetNamespace(node.getMetadata().get("targetNamespace")); if (node.getVersion() != null) { TTag tag = new TTag(); tag.setName("version"); tag.setValue(node.getVersion().getVersion()); builder.addTags(tag); } if (!node.getProperties().isEmpty()) { PropertyDefinitionKVList propertyDefinitionKVList = new PropertyDefinitionKVList(); node.getProperties().forEach((name, property) -> { QName type = TypeConverter.INSTANCE.convert(property.getType()); propertyDefinitionKVList.add(new PropertyDefinitionKV(name, Optional.ofNullable(type.getPrefix()) .map(i -> i.concat(":")).orElse("") .concat(type.getLocalPart()))); }); WinerysPropertiesDefinition propertiesDefinition = new WinerysPropertiesDefinition(); propertiesDefinition.setPropertyDefinitionKVList(propertyDefinitionKVList); builder.addAny(propertiesDefinition); builder.setPropertiesDefinition(convertPropertyDefinition(builder.build().getIdFromIdOrNameField() + "_Properties")); } return builder; }
Source:
public DefaultConsistentHash union(DefaultConsistentHash dch2) { if (!hashFunction.equals(dch2.getHashFunction())) { throw new IllegalArgumentException("The consistent hash objects must have the same hash function"); } if (numSegments != dch2.getNumSegments()) { throw new IllegalArgumentException("The consistent hash objects must have the same number of segments"); } if (numOwners != dch2.getNumOwners()) { throw new IllegalArgumentException("The consistent hash objects must have the same number of owners"); } List<Address> unionMembers = new ArrayList<Address>(this.members); mergeLists(unionMembers, dch2.getMembers()); List<Address>[] unionSegmentOwners = new List[numSegments]; for (int i = 0; i < numSegments; i++) { unionSegmentOwners[i] = new ArrayList<Address>(locateOwnersForSegment(i)); mergeLists(unionSegmentOwners[i], dch2.locateOwnersForSegment(i)); } return new DefaultConsistentHash(hashFunction, numOwners, numSegments, unionMembers, capacityFactors, unionSegmentOwners); }

Target:
public DefaultConsistentHash union(DefaultConsistentHash dch2) { if (!hashFunction.equals(dch2.getHashFunction())) { throw new IllegalArgumentException("The consistent hash objects must have the same hash function"); } if (numSegments != dch2.getNumSegments()) { throw new IllegalArgumentException("The consistent hash objects must have the same number of segments"); } if (numOwners != dch2.getNumOwners()) { throw new IllegalArgumentException("The consistent hash objects must have the same number of owners"); } List<Address> unionMembers = new ArrayList<Address>(this.members); mergeLists(unionMembers, dch2.getMembers()); List<Address>[] unionSegmentOwners = new List[numSegments]; for (int i = 0; i < numSegments; i++) { unionSegmentOwners[i] = new ArrayList<Address>(locateOwnersForSegment(i)); mergeLists(unionSegmentOwners[i], dch2.locateOwnersForSegment(i)); } Map<Address, Float> unionCapacityFactors = null; if (this.capacityFactors != null || dch2.capacityFactors != null) { unionCapacityFactors = new HashMap<Address, Float>(); if (this.capacityFactors != null) { unionCapacityFactors.putAll(this.capacityFactors); } else { for (Address node : this.members) { unionCapacityFactors.put(node, 1.0f); } } if (dch2.capacityFactors != null) { unionCapacityFactors.putAll(dch2.capacityFactors); } else { for (Address node : dch2.members) { unionCapacityFactors.put(node, 1.0f); } } } return new DefaultConsistentHash(hashFunction, numOwners, numSegments, unionMembers, unionCapacityFactors, unionSegmentOwners); }
Source:
public void dispose() { treeViewerManager.dispose(); treeViewerManager = null; if (refreshAtOpeningActivator != null) { getSite().getPage().removePartListener(refreshAtOpeningActivator); } refreshAtOpeningActivator = null; super.dispose(); if (getAdapterFactory() instanceof IDisposable) { ((IDisposable) getAdapterFactory()).dispose(); } }

Target:
public void dispose() { if (refreshAtOpeningActivator != null) { getSite().getPage().removePartListener(refreshAtOpeningActivator); } refreshAtOpeningActivator = null; super.dispose(); if (getAdapterFactory() instanceof IDisposable) { ((IDisposable) getAdapterFactory()).dispose(); } }
Source:
protected AbstractQualifierPolymorphism( ProcessingEnvironment env, AnnotatedTypeFactory factory) { this.atypeFactory = factory; this.qualHierarchy = factory.getQualifierHierarchy(); this.topQuals = new AnnotationMirrorSet(qualHierarchy.getTopAnnotations()); this.completer = new SimpleAnnotatedTypeScanner<>( (type, p) -> { polyQuals.forEach( (poly, top) -> { if (type.hasAnnotation(poly)) { type.removeAnnotation(poly); if (type.getKind() != TypeKind.TYPEVAR && type.getKind() != TypeKind.WILDCARD) { type.addAnnotation( this.qualHierarchy.getBottomAnnotation( top)); } } }); return null; }); this.replacer = new SimpleAnnotatedTypeScanner<>( (type, map) -> { replace(type, map); return null; }); }

Target:
protected AbstractQualifierPolymorphism( ProcessingEnvironment env, AnnotatedTypeFactory factory) { this.atypeFactory = factory; this.qualHierarchy = factory.getQualifierHierarchy(); this.topQuals = new AnnotationMirrorSet(qualHierarchy.getTopAnnotations()); this.completer = new SimpleAnnotatedTypeScanner<>( (type, p) -> { for (Map.Entry<AnnotationMirror, AnnotationMirror> entry : polyQuals.entrySet()) { AnnotationMirror poly = entry.getKey(); AnnotationMirror top = entry.getValue(); if (type.hasAnnotation(poly)) { type.removeAnnotation(poly); if (type.getKind() != TypeKind.TYPEVAR && type.getKind() != TypeKind.WILDCARD) { type.addAnnotation( this.qualHierarchy.getBottomAnnotation(top)); } } } return null; }); this.replacer = new SimpleAnnotatedTypeScanner<>( (type, map) -> { replace(type, map); return null; }); }
Source:
public Object evaluate(Object feature) { String arg0; JSONObject arg1; try { arg0 = getExpression(0).evaluate(feature, String.class); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function mbGet argument #0 - expected type String"); } try { arg1 = getExpression(1).evaluate(feature, JSONObject.class); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function mbGet argument #1 - expected type JSONObject"); } return arg1.get(arg0); }

Target:
public Object evaluate(Object feature) { String arg0; JSONObject arg1; try { arg0 = getExpression(0).evaluate(feature, String.class); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function \"get\" argument #0 - expected type String"); } try { arg1 = getExpression(1).evaluate(feature, JSONObject.class); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function \"get\" argument #1 - expected type JSONObject"); } return arg1.get(arg0); }
Source:
public static Certificate buildCertificate(final String content) throws CertificateException { assert content != null; final BufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(content.getBytes())); final CertificateFactory cf = CertificateFactory.getInstance("X.509"); return cf.generateCertificate(bis); }

Target:
public static Certificate buildCertificate(final String content) throws CertificateException { Preconditions.checkNotNull(content, "Certificate content cannot be null"); final BufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(content.getBytes())); final CertificateFactory cf = CertificateFactory.getInstance("X.509"); return cf.generateCertificate(bis); }
Source:
public HdfsSplitInfo(final String inputPath, final InputSplit inputSplit, final String inputFormatClassName) { this.inputPath = inputPath; this.inputSplit = inputSplit; this.inputFormatClassName = inputFormatClassName; }

Target:
private HdfsSplitInfo(final String inputPath, final InputSplit inputSplit, final String inputFormatClassName) { this.inputPath = inputPath; this.inputSplit = inputSplit; this.inputFormatClassName = inputFormatClassName; }
Source:
public String sendUpdateDescriptionOperation(String userid, Collection<PID> pids) { Element contentEl = createAtomEntry(userid, pids.iterator().next(), CDRActions.UPDATE_MODS); Element updateEl = new Element("updateMods", CDR_MESSAGE_NS); contentEl.addContent(updateEl); Element subjects = new Element("subjects", CDR_MESSAGE_NS); updateEl.addContent(subjects); for (PID sub : pids) { subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.getRepositoryPath())); } Document msg = contentEl.getDocument(); sendMessage(msg); return getMessageId(msg); }

Target:
public String sendUpdateDescriptionOperation(String userid, Collection<PID> pids) { Element contentEl = createAtomEntry(userid, pids.iterator().next(), CDRActions.UPDATE_DESCRIPTION); Element updateEl = new Element(CDRActions.UPDATE_DESCRIPTION.getName(), CDR_MESSAGE_NS); contentEl.addContent(updateEl); Element subjects = new Element("subjects", CDR_MESSAGE_NS); updateEl.addContent(subjects); for (PID sub : pids) { subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.getRepositoryPath())); } Document msg = contentEl.getDocument(); sendMessage(msg); return getMessageId(msg); }
Source:
public Set<Integer> getAlts() { Set<Integer> states = new HashSet<Integer>(); for (ATNConfig c : configs) { states.add(c.alt); } return states; }

Target:
public BitSet getAlts() { BitSet alts = new BitSet(); for (ATNConfig config : configs) { alts.set(config.alt); } return alts; }
Source:
public void initializeFrom(ILaunchConfiguration configuration) { final ILaunchConfiguration config = configuration; final ILaunchConfigurationTab[] tabs = getTabs(); BusyIndicator.showWhile(Display.getCurrent(), () -> { try { if (config instanceof ILaunchConfigurationWorkingCopy) { checkBackwardCompatibility((ILaunchConfigurationWorkingCopy) config); } } catch (CoreException e) { } for (ILaunchConfigurationTab tab : tabs) { tab.initializeFrom(config); } }); }

Target:
public void initializeFrom(ILaunchConfiguration configuration) { final ILaunchConfiguration config = configuration; BusyIndicator.showWhile(Display.getCurrent(), () -> { try { if (config instanceof ILaunchConfigurationWorkingCopy) { BundleLauncherHelper.migrateOsgiLaunchConfiguration(config); } } catch (CoreException e) { } super.initializeFrom(configuration); }); }
Source:
private void initProtobufMetadataManager(GlobalConfiguration globalCfg, GlobalComponentRegistry gcr, BasicComponentRegistry bcr) { ProtobufMetadataManagerImpl protobufMetadataManager = new ProtobufMetadataManagerImpl(); bcr.registerComponent(ProtobufMetadataManager.class, protobufMetadataManager, true).running(); if (globalCfg.globalJmxStatistics().enabled()) { registerProtobufMetadataManagerMBean(protobufMetadataManager, gcr); } SerializationContext serCtx = protobufMetadataManager.getSerializationContext(); ClassLoader classLoader = globalCfg.classLoader(); processProtostreamSerializationContextInitializers(classLoader, serCtx); processSerializationContextInitializer(globalCfg.serialization().contextInitializer(), serCtx); EncoderRegistry encoderRegistry = gcr.getComponent(EncoderRegistry.class); encoderRegistry.registerWrapper(ProtobufWrapper.INSTANCE); encoderRegistry.registerTranscoder(new ProtostreamJsonTranscoder(serCtx)); encoderRegistry.registerTranscoder(new ProtostreamTextTranscoder(serCtx)); encoderRegistry.registerTranscoder(new ProtostreamObjectTranscoder(serCtx, classLoader)); }

Target:
private void initProtobufMetadataManager(GlobalConfiguration globalCfg, GlobalComponentRegistry gcr, BasicComponentRegistry bcr) { ProtobufMetadataManagerImpl protobufMetadataManager = new ProtobufMetadataManagerImpl(); bcr.registerComponent(ProtobufMetadataManager.class, protobufMetadataManager, true).running(); if (globalCfg.globalJmxStatistics().enabled()) { registerProtobufMetadataManagerMBean(protobufMetadataManager, gcr); } SerializationContext serCtx = protobufMetadataManager.getSerializationContext(); ClassLoader classLoader = globalCfg.classLoader(); processSerializationContextInitializer(globalCfg.serialization().contextInitializer(), serCtx); processProtostreamSerializationContextInitializers(classLoader, serCtx); EncoderRegistry encoderRegistry = gcr.getComponent(EncoderRegistry.class); encoderRegistry.registerWrapper(ProtobufWrapper.INSTANCE); encoderRegistry.registerTranscoder(new ProtostreamJsonTranscoder(serCtx)); encoderRegistry.registerTranscoder(new ProtostreamTextTranscoder(serCtx)); encoderRegistry.registerTranscoder(new ProtostreamObjectTranscoder(serCtx, classLoader)); }
Source:
public void sendVerificationmail(User user, String url) { String message = "Please click on the following link to complete your registration: <a href=\"" + url + "\">" + url; sendMail(user.getEmail(), user.getUsername(), "Confirm your registration", message); }

Target:
public void sendVerificationmail(User user, String url) { String message = "Please click on the following link to complete your registration: <a href=\"" + url + "\">" + url + "</a>"; sendMail(user.getEmail(), user.getUsername(), "Confirm your registration", message); }
Source:
public String getJMXUrl() { ServerDelegate sd = (ServerDelegate)server.loadAdapter(ServerDelegate.class, null); int port = -1; if( !(sd instanceof IManagementPortProvider)) port = IJBossToolingConstants.AS7_MANAGEMENT_PORT_DEFAULT_PORT; else { port = ((IManagementPortProvider)sd).getManagementPort(); } String url = "service:jmx:remoting-jmx://" + server.getHost() + ":" + port; return url; }

Target:
public String getJMXUrl() { return getJMXUrl(IJBossToolingConstants.AS7_MANAGEMENT_PORT_DEFAULT_PORT, "service:jmx:remoting-jmx"); }
Source:
public int getMaxConversationDelay() { return sessions.get(resolveCurrentSessionKey()).maxConversationDelay; }

Target:
public int getMaxConversationDelay() { return sessions.get(getCurrentBotName()).get(getCurrentUserName()).maxConversationDelay; }
Source:
public void throwsIfBigIntegerHasMoreThan127Bits() { BigInteger bigInt = BigInteger.valueOf(2).pow(128); LockRefreshToken token = new LockRefreshToken(bigInt, 0L); assertThatThrownBy(() -> LockTokenConverter.toTokenV2(token)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("too many bits"); }

Target:
public void throwsIfBigIntegerHasMoreThan127Bits() { BigInteger bigInt = BigInteger.valueOf(2).pow(127); LockRefreshToken token = new LockRefreshToken(bigInt, 0L); assertThatThrownBy(() -> LockTokenConverter.toTokenV2(token)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("too many bits"); }
Source:
protected synchronized void createUser(final String user, final String group) throws GenieException { final CommandLine idCheckCommandLine = new CommandLine("id"); idCheckCommandLine.addArgument("-u"); idCheckCommandLine.addArgument(user); try { this.executor.execute(idCheckCommandLine); log.debug("User already exists"); } catch (final IOException ioe) { log.debug("User does not exist. Creating it now."); if (group != null && !group.equals(user) && StringUtils.isNotBlank(group)) { log.debug("Group and User are different so creating group now."); final CommandLine groupCreateCommandLine = new CommandLine("sudo"); groupCreateCommandLine.addArgument("groupadd"); groupCreateCommandLine.addArgument(group); try { log.debug("Running command [" + groupCreateCommandLine.toString() + "]"); this.executor.execute(groupCreateCommandLine); } catch (IOException ioexception) { log.debug("Group creation threw an error as it might already exist"); } } final CommandLine userCreateCommandLine = new CommandLine("sudo"); userCreateCommandLine.addArgument("useradd"); userCreateCommandLine.addArgument(user); if (StringUtils.isNotBlank(group) && !group.equals(user)) { userCreateCommandLine.addArgument("-G"); userCreateCommandLine.addArgument(group); } userCreateCommandLine.addArgument("-M"); try { log.debug("Running command [" + userCreateCommandLine.toString() + "]"); this.executor.execute(userCreateCommandLine); } catch (IOException ioexception) { throw new GenieServerException("Could not create user " + user + " with exception " + ioexception); } } }

Target:
protected synchronized void createUser(final String user, final String group) throws GenieException { final CommandLine idCheckCommandLine = new CommandLine("id"); idCheckCommandLine.addArgument("-u"); idCheckCommandLine.addArgument(user); try { this.executor.execute(idCheckCommandLine); log.debug("User already exists"); } catch (final IOException ioe) { log.debug("User does not exist. Creating it now."); final boolean isGroupValid = StringUtils.isNotBlank(group) && !group.equals(user); if (isGroupValid) { log.debug("Group and User are different so creating group now."); final CommandLine groupCreateCommandLine = new CommandLine("sudo"); groupCreateCommandLine.addArgument("groupadd"); groupCreateCommandLine.addArgument(group); try { log.debug("Running command to create group: [" + groupCreateCommandLine.toString() + "]"); this.executor.execute(groupCreateCommandLine); } catch (IOException ioexception) { log.debug("Group creation threw an error as it might already exist"); } } final CommandLine userCreateCommandLine = new CommandLine("sudo"); userCreateCommandLine.addArgument("useradd"); userCreateCommandLine.addArgument(user); if (isGroupValid) { userCreateCommandLine.addArgument("-G"); userCreateCommandLine.addArgument(group); } userCreateCommandLine.addArgument("-M"); try { log.debug("Running command to create user: [" + userCreateCommandLine.toString() + "]"); this.executor.execute(userCreateCommandLine); } catch (IOException ioexception) { throw new GenieServerException("Could not create user " + user + " with exception " + ioexception); } } }
Source:
public ItemStackSnapshot getExemplaryResult() { return exemplaryResult; }

Target:
public ItemStackSnapshot getExemplaryResult() { return this.exemplaryResult; }
Source:
public void before() throws Exception { mConf.set(PropertyKey.USER_CLIENT_CACHE_PAGE_SIZE, PAGE_SIZE_BYTES); mConf.set(PropertyKey.USER_CLIENT_CACHE_SIZE, CACHE_SIZE_BYTES); mFileContext = Mockito.mock(FileSystemContext.class); when(mFileContext.getClusterConf()).thenReturn(mConf); when(mFileContext.getPathConf(any())).thenReturn(mConf); when(mFileContext.getUriValidationEnabled()).thenReturn(true); mMetaStore = new HashSetMetaStore(); mPageStore = new HashMapPageStore(); mEvictor = new FIFOEvictor(mMetaStore); mCacheManager = new LocalCacheManager(mFileContext, mMetaStore, mPageStore, mEvictor); }

Target:
public void before() { mConf.set(PropertyKey.USER_CLIENT_CACHE_PAGE_SIZE, PAGE_SIZE_BYTES); mConf.set(PropertyKey.USER_CLIENT_CACHE_SIZE, CACHE_SIZE_BYTES); mMetaStore = new HashSetMetaStore(); mPageStore = new HashMapPageStore(); mEvictor = new FIFOEvictor(mMetaStore); mCacheManager = new LocalCacheManager(mConf, mMetaStore, mPageStore, mEvictor); }
Source:
public void endLatency(Object id, String service, Throwable er) { if(startTimestampPerId.containsKey(id)) { long elapsed = (System.nanoTime() - startTimestampPerId.get(id)) / 1000000; sendLatency(elapsed, service, er); } }

Target:
public void endLatency(Object id, String service, Throwable er) { if(startTimestampPerId.containsKey(id)) { long elapsed = NANOSECONDS.toMillis(System.nanoTime() - startTimestampPerId.get(id)); sendLatency(elapsed, service, er); startTimestampPerId.remove(id); } else { try { connection.getClient().event().description("Storm Latency Hash-Map doesn't contain received key.").service(service).tags("uncaught-exception"); } catch (Throwable t) { logger.warn("Riemann error during send : " + t.getStackTrace()); } } }
Source:
public static void fetchRevisionAuthorsDetails(final SiteModel site, List<String> authors, final FetchUsersCallback callback) { com.wordpress.rest.RestRequest.Listener listener = new RestRequest.Listener() { @Override public void onResponse(JSONObject jsonObject) { if (jsonObject != null && callback != null) { try { List<Person> people = new ArrayList<Person>(); Iterator<String> keys = jsonObject.keys(); while (keys.hasNext()) { String key = keys.next(); if (jsonObject.get(key) instanceof JSONObject) { JSONArray jsonArray = ((JSONObject) jsonObject.get(key)).getJSONArray("users"); people.addAll(peopleListFromJSON(jsonArray, site.getId(), Person.PersonType.USER)); } } callback.onSuccess(people, true); } catch (JSONException e) { AppLog.e(T.API, "JSON exception occurred while parsing the revision author details" + " from batch response for sites/%s/users: " + e); callback.onError(); } } } }; RestRequest.ErrorListener errorListener = new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { AppLog.e(T.API, volleyError); if (callback != null) { callback.onError(); } } }; Map<String, String> batchParams = new HashMap<>(); for (int i = 0; i < authors.size(); i++) { batchParams.put(String.format(Locale.US, "urls[%d]", i), String.format(Locale.US, "/sites/%d/users?search=%s&search_columns=ID", site.getSiteId(), authors.get(i))); } WordPress.getRestClientUtilsV1_1().get("batch/", batchParams, null, listener, errorListener); }

Target:
public static void fetchRevisionAuthorsDetails(final SiteModel site, List<String> authors, final FetchUsersCallback callback) { RestRequest.Listener listener = new RestRequest.Listener() { @Override public void onResponse(JSONObject jsonObject) { if (jsonObject != null && callback != null) { try { List<Person> people = new ArrayList<>(); Iterator<String> keys = jsonObject.keys(); while (keys.hasNext()) { String key = keys.next(); if (jsonObject.get(key) instanceof JSONObject) { JSONArray jsonArray = ((JSONObject) jsonObject.get(key)).getJSONArray("users"); people.addAll(peopleListFromJSON(jsonArray, site.getId(), Person.PersonType.USER)); } } callback.onSuccess(people, true); } catch (JSONException e) { AppLog.e(T.API, "JSON exception occurred while parsing the revision author details" + " from batch response for sites/%s/users: " + e); callback.onError(); } } } }; RestRequest.ErrorListener errorListener = new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { AppLog.e(T.API, volleyError); if (callback != null) { callback.onError(); } } }; Map<String, String> batchParams = new HashMap<>(); for (int i = 0; i < authors.size(); i++) { batchParams.put(String.format(Locale.US, "urls[%d]", i), String.format(Locale.US, "/sites/%d/users?search=%s&search_columns=ID", site.getSiteId(), authors.get(i))); } WordPress.getRestClientUtilsV1_1().get("batch/", batchParams, null, listener, errorListener); }
Source:
public String getString() { return "IF"; }

Target:
public String getString() { return lazyParams.get(0).getString(); }
Source:
public void setupUserStoreFromDefaultConfig() { SmartStoreLogger.d(TAG, "Setting up user store using config sound in res/raw/userstore.json"); setupStoreFromConfig(getSmartStore(), R.raw.userstore); }

Target:
public void setupUserStoreFromDefaultConfig() { SmartStoreLogger.d(TAG, "Setting up user store using config found in res/raw/userstore.json"); setupStoreFromConfig(getSmartStore(), R.raw.userstore); }
Source:
@Test public void updateViewWithRenamedClass() throws Exception { ListView tv = new ListView("tView"); j.jenkins.addView(tv); j.jenkins.XSTREAM2.addCompatibilityAlias("org.acme.old.Foo", ListView.class); final CLICommandInvoker.Result result = command .authorizedTo(View.READ, View.CONFIGURE, Jenkins.READ) .withStdin(this.getClass().getResourceAsStream("/hudson/cli/testview-foo.xml")) .invokeWithArgs("tView"); assertThat(result, failedWith(0)); }

Target:
@Test public void updateViewWithRenamedClass() throws Exception { ListView tv = new ListView("tView"); j.jenkins.addView(tv); j.jenkins.XSTREAM2.addCompatibilityAlias("org.acme.old.Foo", ListView.class); final CLICommandInvoker.Result result = command .authorizedTo(View.READ, View.CONFIGURE, Jenkins.READ) .withStdin(this.getClass().getResourceAsStream("/hudson/cli/testview-foo.xml")) .invokeWithArgs("tView"); assertThat(result, succeededSilently()); }
Source:
public boolean remove(K key) { checkAvailable(); R record = null; boolean removed = false; try { record = removeRecord(key); if (record != null && record.getRecordState() == READ_PERMITTED) { removed = true; nearCacheStats.incrementInvalidations(); nearCacheStats.decrementOwnedEntryCount(); } onRemove(key, record, removed); return record != null; } catch (Throwable error) { onRemoveError(key, record, removed, error); throw rethrow(error); } finally { nearCacheStats.incrementReceivedInvalidations(); } }

Target:
public boolean remove(K key) { checkAvailable(); R record = null; boolean removed = false; try { record = removeRecord(key); if (record != null && record.getRecordState() == READ_PERMITTED) { removed = true; nearCacheStats.decrementOwnedEntryCount(); } onRemove(key, record, removed); return record != null; } catch (Throwable error) { onRemoveError(key, record, removed, error); throw rethrow(error); } }
Source:
public void testIt() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(ModifierOrderCheck.class); final String[] expected = { "14:10: " + getCheckMessage(MSG_MODIFIER_ORDER, "final"), "18:12: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), "24:14: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), "34:13: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation2"), "39:13: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation2"), "49:35: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation4"), "157:14: " + getCheckMessage(MSG_MODIFIER_ORDER, "default"), }; verify(checkConfig, getPath("InputModifierIt.java"), expected); }

Target:
public void testIt() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(ModifierOrderCheck.class); final String[] expected = { "14:10: " + getCheckMessage(MSG_MODIFIER_ORDER, "final"), "18:12: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), "24:14: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), "34:13: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation2"), "39:13: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation2"), "49:35: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation4"), "157:14: " + getCheckMessage(MSG_MODIFIER_ORDER, "default"), }; verify(checkConfig, getPath("InputModifierOrderIt.java"), expected); }
Source:
public void initialize() { driver.initialize(this); formBuilder.addFormItem(new FormItem(constants.namePoolGeneral(), name, 0, 0)); formBuilder.addFormItem(new FormItem(constants.descriptionPoolGeneral(), description, 1, 0)); formBuilder.addFormItem(new FormItem(constants.templatePoolGeneral(), template, 2, 0)); formBuilder.addFormItem(new FormItem(constants.osPoolGeneral(), oS, 3, 0)); formBuilder.addFormItem(new FormItem(constants.graphicsProtocol(), graphicsType, 4, 0)); formBuilder.addFormItem(new FormItem(constants.videoType(), defaultDisplayType, 5, 0)); formBuilder.addFormItem(new FormItem(constants.definedMemPoolGeneral(), definedMemory, 0, 1)); formBuilder.addFormItem(new FormItem(constants.physMemGaurPoolGeneral(), minAllocatedMemory, 1, 1)); WidgetTooltip cpuInfoWithTooltip = new WidgetTooltip(cpuInfo); cpuInfoWithTooltip.setText(constants.numOfCpuCoresTooltipPoolGeneral()); formBuilder.addFormItem(new FormItem(constants.numOfCpuCoresPoolGeneral(), cpuInfoWithTooltip, 2, 1)); formBuilder.addFormItem(new FormItem(constants.numOfMonitorsPoolGeneral(), monitorCount, 3, 1)); formBuilder.addFormItem(new FormItem(constants.usbPolicyPoolGeneral(), usbPolicy, 4, 1)); formBuilder.addFormItem(new FormItem(constants.runOnPoolGeneral(), defaultHost, 0, 2)); }

Target:
public void initialize() { driver.initialize(this); formBuilder.addFormItem(new FormItem(constants.namePoolGeneral(), name, 0, 0)); formBuilder.addFormItem(new FormItem(constants.descriptionPoolGeneral(), description, 1, 0)); formBuilder.addFormItem(new FormItem(constants.templatePoolGeneral(), template, 2, 0)); formBuilder.addFormItem(new FormItem(constants.osPoolGeneral(), oS, 3, 0)); formBuilder.addFormItem(new FormItem(constants.graphicsProtocol(), graphicsType, 4, 0)); formBuilder.addFormItem(new FormItem(constants.videoType(), defaultDisplayType, 5, 0)); formBuilder.addFormItem(new FormItem(constants.definedMemPoolGeneral(), definedMemory, 0, 1)); formBuilder.addFormItem(new FormItem(constants.physMemGaurPoolGeneral(), minAllocatedMemory, 1, 1)); WidgetTooltip cpuInfoWithTooltip = new WidgetTooltip(cpuInfo); cpuInfoWithTooltip.setHtml(templates.numOfCpuCoresTooltip()); formBuilder.addFormItem(new FormItem(constants.numOfCpuCoresPoolGeneral(), cpuInfoWithTooltip, 2, 1)); formBuilder.addFormItem(new FormItem(constants.numOfMonitorsPoolGeneral(), monitorCount, 3, 1)); formBuilder.addFormItem(new FormItem(constants.usbPolicyPoolGeneral(), usbPolicy, 4, 1)); formBuilder.addFormItem(new FormItem(constants.runOnPoolGeneral(), defaultHost, 0, 2)); }
Source:
public void setIntermediateData(Collection<IntermediateEntry> partitions) { for (IntermediateEntry i: partitions) { if (i.getPullHost().getPort() == 0) { int a= 1; } } this.intermediateData = new ArrayList<IntermediateEntry>(partitions); }

Target:
public void setIntermediateData(Collection<IntermediateEntry> partitions) { this.intermediateData = new ArrayList<IntermediateEntry>(partitions); }
Source:
public void run() { List<VDSGroup> vdsGroups = DbFacade.getInstance().getVdsGroupDao().getTrustedClusters(); List<String> vdsNames = new ArrayList<String>(); List<String> curVdsNames = new ArrayList<String>(); int i=0; boolean secondStageFlag =true; List<AttestationValue> valueList = new ArrayList<AttestationValue> (); if (vdsGroups == null || vdsGroups.size()==0) { return; } for (VDSGroup vdsGroup: vdsGroups){ vdss = DbFacade.getInstance().getVdsDao().getAllForVdsGroup(vdsGroup.getId()); if (vdss == null || vdss.size() == 0){ break; } for (VDS vds: vdss){ vdsNames.add(vds.getHostName()); } } while(vdsNames.size()>0 && i<2 && secondStageFlag){ if (vdsNames.size() <=attestationFirstStageSize){ curVdsNames = vdsNames; secondStageFlag=false; }else{ curVdsNames=(i==0)?vdsNames.subList(i, attestationFirstStageSize) :vdsNames.subList(attestationFirstStageSize, vdsNames.size()); } valueList = AttestationService.getInstance().attestHosts(curVdsNames); updateCache(valueList); i++; } }

Target:
public void run() { List<VDSGroup> vdsGroups = DbFacade.getInstance().getVdsGroupDao().getTrustedClusters(); List<String> vdsNames = new ArrayList<String>(); List<String> curVdsNames = new ArrayList<String>(); int i=0; boolean secondStageFlag =true; List<AttestationValue> valueList = new ArrayList<AttestationValue> (); if (vdsGroups == null || vdsGroups.size()==0) { return; } for (VDSGroup vdsGroup: vdsGroups){ vdss = DbFacade.getInstance().getVdsDao().getAllForVdsGroup(vdsGroup.getId()); if (vdss == null || vdss.size() == 0){ continue; } for (VDS vds: vdss){ vdsNames.add(vds.getHostName()); } } while(vdsNames.size()>0 && i<2 && secondStageFlag){ if (vdsNames.size() <=attestationFirstStageSize){ curVdsNames = vdsNames; secondStageFlag=false; }else{ curVdsNames=(i==0)?vdsNames.subList(i, attestationFirstStageSize) :vdsNames.subList(attestationFirstStageSize, vdsNames.size()); } valueList = AttestationService.getInstance().attestHosts(curVdsNames); updateCache(valueList); i++; } }