auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean forceEvictAndRun(MapOperation mapOperation, double evictionPercentage) { assert evictionPercentage > 0 && evictionPercentage <= 1; int partitionCount = numberOfPartitions(mapOperation); int threadCount = threadCount(mapOperation); int mod = mod(mapOperation, threadCount); ILogger logger = mapOperation.logger(); int evictionRetryTimes = noRetryIfEvictingAll(evictionPercentage); for (int i = 0; i < evictionRetryTimes; i++) { final int attempt = i + 1; try { IntStream.range(0, partitionCount) .filter(partitionId -> partitionId % threadCount == mod) .mapToObj(partitionId -> partitionMaps(mapOperation, partitionId)) .flatMap(maps -> maps.values().stream()) .filter(this::isValid) .forEach(recordStore -> { int sizeBeforeEviction = recordStore.size(); MapContainer mapContainer = recordStore.getMapContainer(); Evictor evictor = mapContainer.getEvictor(); evictor.forceEvictByPercentage(recordStore, evictionPercentage); int sizeAfterEviction = recordStore.size(); if (logger.isFineEnabled()) { String msg = "Multiple record store forced eviction " + "[attempt: %d, mainMapName: %s, evictingMapName: %s, " + "evictionPercentage: %.2f, partitionId: %d, evictedCount: %d (%d --> %d)]"; logger.fine(format(msg, attempt, mapOperation.getName(), recordStore.getName(), evictionPercentage, mapOperation.getPartitionId(), sizeBeforeEviction - sizeAfterEviction, sizeBeforeEviction, sizeAfterEviction)); } }); mapOperation.runInternal(); return true; } catch (NativeOutOfMemoryError e) { if (evictionRetryTimes > 1) { ignore(e); } else { throw e; } } } return false; }

Target:
public boolean forceEvictAndRun(MapOperation mapOperation, double evictionPercentage) { assert evictionPercentage > 0 && evictionPercentage <= 1; int partitionCount = numberOfPartitions(mapOperation); int threadCount = threadCount(mapOperation); int mod = mod(mapOperation, threadCount); ILogger logger = mapOperation.logger(); int evictionRetryTimes = retryCount(evictionPercentage); for (int i = 0; i < evictionRetryTimes; i++) { try { for (int partitionId = 0; partitionId < partitionCount; partitionId++) { if ((partitionId % threadCount) != mod) { continue; } Collection<RecordStore> recordStores = partitionMaps(mapOperation, partitionId).values(); for (RecordStore recordStore : recordStores) { int sizeBeforeEviction = recordStore.size(); MapContainer mapContainer = recordStore.getMapContainer(); Evictor evictor = mapContainer.getEvictor(); evictor.forceEvictByPercentage(recordStore, evictionPercentage); if (logger.isFineEnabled()) { logForcedEviction(logger, mapOperation, recordStore, evictionPercentage, (i + 1), sizeBeforeEviction); } } } mapOperation.runInternal(); return true; } catch (NativeOutOfMemoryError e) { if (evictionPercentage == 1D) { throw e; } else { ignore(e); } } } return false; }
Source:
private void removeTaskFromRestoring(final StreamTask task) { restoring.remove(task.id()); for (final TopicPartition tp : task.partitions()) { restoredPartitions.remove(tp); restoringByPartition.remove(tp); } }

Target:
private void removeTaskFromRestoring(final StreamTask task) { restoring.remove(task.id()); for (final TopicPartition topicPartition : task.partitions()) { restoredPartitions.remove(topicPartition); restoringByPartition.remove(topicPartition); } for (final TopicPartition topicPartition : task.changelogPartitions()) { restoredPartitions.remove(topicPartition); restoringByPartition.remove(topicPartition); } }
Source:
public String toString() { StringBuilder sb = new StringBuilder("ColumnarRow{"); sb.append("positionCount=").append(getPositionCount()).append(","); sb.append("fields count=").append(fields.length).append(","); for (int i = 0; i < fields.length; i++) { sb.append("field_").append(i).append("=").append(fields[i].toString()).append(","); } sb.append('}'); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(getClass().getSimpleName()).append("{"); sb.append("positionCount=").append(getPositionCount()).append(","); sb.append("fieldsCount=").append(fields.length).append(","); for (int i = 0; i < fields.length; i++) { sb.append("field_").append(i).append("=").append(fields[i].toString()).append(","); } sb.append('}'); return sb.toString(); }
Source:
public DbResourceGroupConfigurationManager(ClusterMemoryPoolManager memoryPoolManager, DbResourceGroupConfig config, ResourceGroupsDao dao, @ForEnvironment String environment) { super(memoryPoolManager); requireNonNull(memoryPoolManager, "memoryPoolManager is null"); requireNonNull(config, "config is null"); this.enableExactMatchSelector = config.getEnableExactMatchSelector(); requireNonNull(dao, "daoProvider is null"); this.environment = requireNonNull(environment, "environment is null"); this.dao = dao; this.dao.createResourceGroupsGlobalPropertiesTable(); this.dao.createResourceGroupsTable(); this.dao.createSelectorsTable(); if (enableExactMatchSelector) { this.dao.createExactMatchSelectorsTable(); } load(); }

Target:
public DbResourceGroupConfigurationManager(ClusterMemoryPoolManager memoryPoolManager, DbResourceGroupConfig config, ResourceGroupsDao dao, @ForEnvironment String environment) { super(memoryPoolManager); requireNonNull(memoryPoolManager, "memoryPoolManager is null"); requireNonNull(config, "config is null"); requireNonNull(dao, "daoProvider is null"); this.environment = requireNonNull(environment, "environment is null"); this.exactMatchSelectorEnabled = config.getExactMatchSelectorEnabled(); this.dao = dao; this.dao.createResourceGroupsGlobalPropertiesTable(); this.dao.createResourceGroupsTable(); this.dao.createSelectorsTable(); if (exactMatchSelectorEnabled) { this.dao.createExactMatchSelectorsTable(); } load(); }
Source:
public Set<ConnectorPlanOptimizer> getPhysicalPlanOptimizers() { return ImmutableSet.of(new HiveFilterPushdown(transactionManager, rowExpressionService, functionResolution, partitionManager, functionMetadataManager)); }

Target:
public Set<ConnectorPlanOptimizer> getPhysicalPlanOptimizers() { return planOptimizers; }
Source:
AggregateProviderDefinition() { super(new Parameters(PathElement.pathElement(AGGREGATE_PROVIDER), DiscoveryExtension.getResourceDescriptionResolver(AGGREGATE_PROVIDER)) .setAddHandler(AggregateProviderAddHandler.getInstance()) .setAddRestartLevel(OperationEntry.Flag.RESTART_RESOURCE_SERVICES) .setRemoveRestartLevel(OperationEntry.Flag.RESTART_RESOURCE_SERVICES) .setCapabilities(DISCOVERY_PROVIDER_RUNTIME_CAPABILITY)); }

Target:
AggregateProviderDefinition() { super(new Parameters(PathElement.pathElement(AGGREGATE_PROVIDER), DiscoveryExtension.getResourceDescriptionResolver(AGGREGATE_PROVIDER)) .setAddHandler(AggregateProviderAddHandler.getInstance()) .setRemoveHandler(new TrivialRemoveStepHandler(DISCOVERY_PROVIDER_RUNTIME_CAPABILITY)) .setCapabilities(DISCOVERY_PROVIDER_RUNTIME_CAPABILITY)); }
Source:
public static VmWatchdog map(WatchDog model, VmWatchdog template) { VmWatchdog entity = template == null ? new VmWatchdog() : template; if (model.isSetAction()) { WatchdogAction wdAction = WatchdogAction.fromValue(model.getAction().toUpperCase()); if (wdAction != null) { entity.setAction(map(wdAction, null)); } } if (model.isSetModel()) { WatchdogModel wdModel = WatchdogModel.fromValue(model.getModel().toUpperCase()); if (wdModel != null) { entity.setModel(map(wdModel, null)); } } entity.setModel(VmWatchdogType.getByName(model.getModel())); entity.setId(new Guid(model.getId())); return entity; }

Target:
public static VmWatchdog map(WatchDog model, VmWatchdog template) { VmWatchdog entity = template == null ? new VmWatchdog() : template; if (model.isSetAction()) { WatchdogAction wdAction = WatchdogAction.fromValue(model.getAction().toUpperCase()); if (wdAction != null) { entity.setAction(map(wdAction, null)); } } if (model.isSetModel()) { WatchdogModel wdModel = WatchdogModel.fromValue(model.getModel().toUpperCase()); if (wdModel != null) { entity.setModel(map(wdModel, null)); } } entity.setModel(VmWatchdogType.getByName(model.getModel())); entity.setId(GuidUtils.asGuid(model.getId())); return entity; }
Source:
private void loadPhysicalNetworkProviderParameters(Network network) { NetworkDao networkDao = new NetworkDaoImpl(); Network physicalProviderNetwork = networkDao.get(network.getPhysicalNetworkProviderId()); network.setVlanId(physicalProviderNetwork.getVlanId()); network.setLabel(physicalProviderNetwork.getLabel()); }

Target:
private void loadPhysicalNetworkProviderParameters(Network network) { Network physicalProviderNetwork = networkDao.get(network.getPhysicalNetworkProviderId()); network.setVlanId(physicalProviderNetwork.getVlanId()); network.setLabel(physicalProviderNetwork.getVdsmName()); }
Source:
protected boolean canDoAction() { boolean returnValue = true; if (isVmUpDownOrPoweringUp(getVm().getstatus())) { setVdsId(getVm().getrun_on_vds().getValue()); returnValue = isHotPlugSupported() && isOSSupportingHotPlug(); } else { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL); returnValue = false; } if (returnValue) { vmDevice = getVmDeviceDao().get(new VmDeviceId(getParameters().getNicId(), getParameters().getVmId())); if (vmDevice == null) { returnValue = false; addCanDoActionMessage(VdcBllMessages.VM_INTERFACE_NOT_EXIST); } } return returnValue; }

Target:
protected boolean canDoAction() { boolean returnValue = true; if (isVmStatusProperForHotPlugNic(getVm().getstatus())) { setVdsId(getVm().getrun_on_vds().getValue()); returnValue = isHotPlugSupported() && isOSSupportingHotPlug(); } else { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL); returnValue = false; } if (returnValue) { vmDevice = getVmDeviceDao().get(new VmDeviceId(getParameters().getNicId(), getParameters().getVmId())); if (vmDevice == null) { returnValue = false; addCanDoActionMessage(VdcBllMessages.VM_INTERFACE_NOT_EXIST); } } return returnValue; }
Source:
public CompletableFuture<RestoreResponse> restore(RestoreRequest request) { logRequest(request); if (request.term() != context.currentTerm()) { return CompletableFuture.completedFuture(logResponse(RestoreResponse.error())); } HeapBuffer buffer = HeapBuffer.allocate(); List<Session> sessions = Lists.newArrayList(context.sessions()); buffer.writeInt(sessions.size()); for (Session session : sessions) { buffer.writeLong(session.sessionId().id()); buffer.writeString(session.nodeId().id()); } context.service().backup(buffer); buffer.flip(); byte[] bytes = buffer.readBytes(buffer.remaining()); replicator.removePreviousOperation(request.nodeId(), context.currentIndex()); return CompletableFuture.completedFuture( RestoreResponse.ok(context.currentIndex(), context.currentTimestamp(), bytes)) .thenApply(this::logResponse); }

Target:
public CompletableFuture<RestoreResponse> restore(RestoreRequest request) { logRequest(request); if (request.term() != context.currentTerm()) { return CompletableFuture.completedFuture(logResponse(RestoreResponse.error())); } HeapBuffer buffer = HeapBuffer.allocate(); List<PrimitiveSession> sessions = Lists.newArrayList(context.sessions()); buffer.writeInt(sessions.size()); for (PrimitiveSession session : sessions) { buffer.writeLong(session.sessionId().id()); buffer.writeString(session.memberId().id()); } context.service().backup(new DefaultBackupOutput(buffer, context.service().serializer())); buffer.flip(); byte[] bytes = buffer.readBytes(buffer.remaining()); return CompletableFuture.completedFuture( RestoreResponse.ok(context.currentIndex(), context.currentTimestamp(), bytes)) .thenApply(this::logResponse); }
Source:
public void setFilter(String filter) { Cursor sqlCursor = ReaderSearchTable.getQueryStringCursor(filter, MAX_SUGGESTIONS); MatrixCursor matrixCursor = new MatrixCursor( new String[]{ ReaderSearchTable.COL_ID, ReaderSearchTable.COL_QUERY}); if (sqlCursor.moveToFirst()) { do { long id = sqlCursor.getLong(sqlCursor.getColumnIndex(ReaderSearchTable.COL_ID)); String query = sqlCursor.getString(sqlCursor.getColumnIndex(ReaderSearchTable.COL_QUERY)); matrixCursor.addRow(new Object[]{id, query}); } while (sqlCursor.moveToNext()); matrixCursor.addRow(new Object[]{CLEAR_ALL_ROW_ID, mClearAllText}); } mCurrentFilter = filter; swapCursor(matrixCursor); }

Target:
public void setFilter(String filter) { if (isCurrentFilter(filter) && getCursor() != null) { return; } Cursor sqlCursor = ReaderSearchTable.getQueryStringCursor(filter, MAX_SUGGESTIONS); MatrixCursor matrixCursor = new MatrixCursor( new String[]{ ReaderSearchTable.COL_ID, ReaderSearchTable.COL_QUERY}); if (sqlCursor.moveToFirst()) { do { long id = sqlCursor.getLong(sqlCursor.getColumnIndex(ReaderSearchTable.COL_ID)); String query = sqlCursor.getString(sqlCursor.getColumnIndex(ReaderSearchTable.COL_QUERY)); matrixCursor.addRow(new Object[]{id, query}); } while (sqlCursor.moveToNext()); matrixCursor.addRow(mClearAllRow); } mCurrentFilter = filter; swapCursor(matrixCursor); }
Source:
private void validateMimeType(String resourceType, String mimeType) { mimeType = Optional.ofNullable(mimeType) .map(t -> t.split("/")[1]) .orElseThrow(() -> new RestServerError("Invalid mime type", null)); List<String> allowedExtensions; if ("Image".equals(resourceType)){ allowedExtensions = imageAllowedExtensions; } else if ("Attach".equals(resourceType)){ allowedExtensions = fileAllowedExtensions; } else throw new RestServerError(String.format("Invalid resource type %s", resourceType), null); if (!allowedExtensions.contains(mimeType)) { throw new RestServerError(String.format("Invalid mime type: %s", mimeType), null); } }

Target:
private void validateMimeType(String resourceType, String mimeType) { mimeType = Optional.ofNullable(mimeType) .map(t -> t.split("/")[1]) .orElseThrow(() -> { log.error("Invalid mime type"); return new RestServerError("plugins.jacms.resources.invalidMimeType", null); }); List<String> allowedExtensions; if ("Image".equals(resourceType)){ allowedExtensions = imageAllowedExtensions; } else if ("Attach".equals(resourceType)){ allowedExtensions = fileAllowedExtensions; } else { log.error("File type not allowed"); throw new RestServerError("plugins.jacms.resources.invalidResourceType", null); } if (!allowedExtensions.contains(mimeType)) { log.error("Invalid mime type"); throw new RestServerError("plugins.jacms.resources.invalidMimeType", null); } }
Source:
public long size() { return conflictToGlobalTailCache.estimatedSize(); }

Target:
public long size() { return conflictCache.estimatedSize(); }
Source:
public Configuration newProjectConfiguration(String projectKey, Optional<Branch> branch) { String effectiveKey = generateProjectKey(projectKey, branch); Settings projectSettings = new ProjectSettings(globalSettings); dbClient.propertiesDao() .selectProjectProperties(effectiveKey) .forEach(property -> projectSettings.setProperty(property.getKey(), property.getValue())); return new ConfigurationBridge(projectSettings); }

Target:
public Configuration newProjectConfiguration(String projectKey, Optional<Branch> branch) { Settings projectSettings = new ProjectSettings(globalSettings); addSettings(projectSettings, projectKey); getBranchName(branch).ifPresent( b -> addSettings(projectSettings, generateBranchKey(projectKey, b))); return new ConfigurationBridge(projectSettings); }
Source:
final PublisherVerification<Integer> multiSubscribersPublisherVerification(final boolean shouldBlowUp) { return new PublisherVerification<Integer>(newTestEnvironment()) { @Override public Publisher<Integer> createPublisher(final long elements) { return new Publisher<Integer>() { private final Collection<Demand> demands = new CopyOnWriteArrayList<Demand>(); private final AtomicLong source = new AtomicLong(elements); @Override public void subscribe(Subscriber<? super Integer> s) { if (shouldBlowUp && !demands.isEmpty()) { new Demand(s); s.onError(new RuntimeException("Unexpected additional subscriber")); } else { demands.add(new Demand(s)); } } class Demand implements Subscription { final AtomicBoolean canceled = new AtomicBoolean(); Subscriber<? super Integer> subscriber; Demand(Subscriber<? super Integer> subscriber) { this.subscriber = subscriber; this.subscriber.onSubscribe(this); } @Override public void request(long n) { if (!canceled.get()) { for (long i = 0; i < n; i++) { if (source.getAndDecrement() < 0) { canceled.set(true); subscriber.onComplete(); } else { subscriber.onNext((int) i); } } } } @Override public void cancel() { canceled.set(true); subscriber = null; for (Demand demand : demands) { if (demand == this) { demands.remove(demand); } } } } }; } @Override public Publisher<Integer> createFailedPublisher() { return SKIP; } }; }

Target:
final PublisherVerification<Integer> multiSubscribersPublisherVerification(final boolean shouldBlowUp) { return new PublisherVerification<Integer>(newTestEnvironment()) { @Override public Publisher<Integer> createPublisher(final long elements) { return new Publisher<Integer>() { private final Collection<CancelableSubscription> subscriptions = new CopyOnWriteArrayList<CancelableSubscription>(); private final AtomicLong source = new AtomicLong(elements); @Override public void subscribe(Subscriber<? super Integer> s) { CancelableSubscription subscription = new CancelableSubscription(s); s.onSubscribe(subscription); if (shouldBlowUp && !subscriptions.isEmpty()) { s.onError(new RuntimeException("Unexpected additional subscriber")); } else { subscriptions.add(subscription); } } class CancelableSubscription implements Subscription { final AtomicBoolean canceled = new AtomicBoolean(); Subscriber<? super Integer> subscriber; CancelableSubscription(Subscriber<? super Integer> subscriber) { this.subscriber = subscriber; } @Override public void request(long n) { if (!canceled.get()) { for (long i = 0; i < n; i++) { if (source.getAndDecrement() < 0) { canceled.set(true); subscriber.onComplete(); } else { subscriber.onNext((int) i); } } } } @Override public void cancel() { canceled.set(true); subscriber = null; subscriptions.remove(this); } } }; } @Override public Publisher<Integer> createFailedPublisher() { return SKIP; } }; }
Source:
private void initializeDefinedElements(CContentAssistInvocationContext context) { int startOffset = getStatementStartOffset(context.getDocument(), context.getParseOffset() - fPrefix.length()); Map<String, IBinding> elementsMap = new HashMap<>(); IASTCompletionNode node = null; CContentAssistInvocationContext newContext = new CContentAssistInvocationContext( context.getViewer(), startOffset, context.getEditor(), true, false); try { node = newContext.getCompletionNode(); if (node != null) { IASTTranslationUnit tu = node.getTranslationUnit(); IASTName[] names = node.getNames(); for (IASTName name : names) { IASTCompletionContext astContext = name.getCompletionContext(); if (astContext != null) { IBinding[] bindings = astContext.findBindings(name, true); if (bindings != null) { AccessContext accessibilityContext = new AccessContext(name); for (IBinding binding : bindings) { if ((binding instanceof ICPPField || binding instanceof IVariable) && accessibilityContext.isAccessible(binding) && !elementsMap.containsKey(binding.getName())) { if (binding instanceof ICPPField) { elementsMap.put(binding.getName(), binding); } else { IASTName[] declarations = tu.getDeclarationsInAST(binding); if (declarations != null && declarations.length != 0) elementsMap.put(binding.getName(), binding); } } } } } } } } finally { fAvailableElements = new ArrayList<>(elementsMap.values()); newContext.dispose(); } }

Target:
private void initializeDefinedElements(CContentAssistInvocationContext context) { int startOffset = getStatementStartOffset(context.getDocument(), context.getParseOffset() - fPrefix.length()); Map<String, IBinding> elementsMap = new HashMap<>(); IASTCompletionNode node = null; CContentAssistInvocationContext newContext = new CContentAssistInvocationContext( context.getViewer(), startOffset, context.getEditor(), true, false); try { node = newContext.getCompletionNode(); if (node != null) { IASTTranslationUnit tu = node.getTranslationUnit(); IASTName[] names = node.getNames(); for (IASTName name : names) { IASTCompletionContext astContext = name.getCompletionContext(); if (astContext != null) { IBinding[] bindings = astContext.findBindings(name, true); if (bindings != null) { AccessContext accessibilityContext = new AccessContext(name); for (IBinding binding : bindings) { if (binding instanceof IVariable && accessibilityContext.isAccessible(binding) && !elementsMap.containsKey(binding.getName())) { if (binding instanceof ICPPField) { elementsMap.put(binding.getName(), binding); } else { IASTName[] declarations = tu.getDeclarationsInAST(binding); if (declarations.length != 0) elementsMap.put(binding.getName(), binding); } } } } } } } } finally { fAvailableElements = new ArrayList<>(elementsMap.values()); newContext.dispose(); } }
Source:
public DataBuffer write(CharSequence charSequence, Charset charset) { Assert.notNull(charSequence, "'charSequence' must not be null"); Assert.notNull(charset, "'charset' must not be null"); if (StandardCharsets.UTF_8.equals(charset)) { ByteBufUtil.writeUtf8(this.byteBuf, charSequence); } else if (StandardCharsets.US_ASCII.equals(charset)) { ByteBufUtil.writeAscii(this.byteBuf, charSequence); } else { CharsetEncoder charsetEncoder = charset.newEncoder() .onMalformedInput(CodingErrorAction.REPLACE) .onUnmappableCharacter(CodingErrorAction.REPLACE); CharBuffer inBuffer = CharBuffer.wrap(charSequence); int estimatedSize = (int) (inBuffer.remaining() * charsetEncoder.averageBytesPerChar()); this.byteBuf.ensureWritable(estimatedSize); charsetEncoder.reset(); ByteBuffer outBuffer = asByteBuffer(this.byteBuf.writerIndex(), writableByteCount()); try { for (; ; ) { CoderResult cr = inBuffer.hasRemaining() ? charsetEncoder.encode(inBuffer, outBuffer, true) : CoderResult.UNDERFLOW; if (cr.isUnderflow()) { cr = charsetEncoder.flush(outBuffer); } if (cr.isUnderflow()) { break; } if (cr.isOverflow()) { writePosition(outBuffer.position()); int maximumSize = (int) (inBuffer.remaining() * charsetEncoder.maxBytesPerChar()); this.byteBuf.ensureWritable(maximumSize); outBuffer = asByteBuffer(this.byteBuf.writerIndex(), writableByteCount()); } } } catch (CoderMalfunctionError ex) { throw new IllegalStateException(ex); } writePosition(outBuffer.position()); } return this; }

Target:
public DataBuffer write(CharSequence charSequence, Charset charset) { Assert.notNull(charSequence, "'charSequence' must not be null"); Assert.notNull(charset, "'charset' must not be null"); if (StandardCharsets.UTF_8.equals(charset)) { ByteBufUtil.writeUtf8(this.byteBuf, charSequence); } else if (StandardCharsets.US_ASCII.equals(charset)) { ByteBufUtil.writeAscii(this.byteBuf, charSequence); } else { return PooledDataBuffer.super.write(charSequence, charset); } return this; }
Source:
public StringInputRowParser( @JsonProperty("parseSpec") ParseSpec parseSpec, @JsonProperty("encoding") String encoding ) { this.parseSpec = parseSpec; this.mapParser = new MapInputRowParser(parseSpec); this.parser = parseSpec.makeParser(); if(encoding != null) { this.charset = Charset.forName(encoding); } else { this.charset = Charsets.UTF_8; } }

Target:
public StringInputRowParser( @JsonProperty("parseSpec") ParseSpec parseSpec, @JsonProperty("encoding") String encoding ) { this.parseSpec = parseSpec; this.mapParser = new MapInputRowParser(parseSpec); this.parser = parseSpec.makeParser(); if (encoding != null) { this.charset = Charset.forName(encoding); } else { this.charset = DEFAULT_CHARSET; } }
Source:
public void shouldUnRetireAProgram() throws Exception { Program program = service.getProgramByUuid(getUuid()); program.setRetired(true); program.setRetireReason("random reason"); program = service.saveProgram(program); Assert.assertTrue(program.isRetired()); String json = "{\"deleted\": \"false\"}"; SimpleObject response = deserialize(handle(newPostRequest(getURI() + "/" + getUuid(), json))); program = service.getProgramByUuid(getUuid()); Assert.assertFalse(program.isRetired()); Assert.assertEquals("false", PropertyUtils.getProperty(response, "retired").toString()); }

Target:
public void shouldUnRetireAProgram() throws Exception { Program program = service.getProgramByUuid(getUuid()); program.setRetired(true); program.setRetireReason("random reason"); service.saveProgram(program); program = service.getProgramByUuid(getUuid()); Assert.assertTrue(program.isRetired()); String json = "{\"deleted\": \"false\"}"; SimpleObject response = deserialize(handle(newPostRequest(getURI() + "/" + getUuid(), json))); program = service.getProgramByUuid(getUuid()); Assert.assertFalse(program.isRetired()); Assert.assertEquals("false", PropertyUtils.getProperty(response, "retired").toString()); }
Source:
public static int getItemBurnTime(ItemStack stack) { if (stack.isEmpty()) { return 0; } else { Item item = stack.getItem(); int base = stack.getBurnTime(); return getBurnTimes().computeIfAbsent(item, i -> net.minecraftforge.event.ForgeEventFactory.getItemBurnTime(stack, base == -1 ? getVanillaBurnTimes().getOrDefault(i, 0) : base)); } }

Target:
public static int getItemBurnTime(ItemStack stack) { if (stack.isEmpty()) { return 0; } else { Item item = stack.getItem(); int base = stack.getBurnTime(); return net.minecraftforge.event.ForgeEventFactory.getItemBurnTime(stack, base == -1 ? getBurnTimes().getOrDefault(item, 0) : base); } }
Source:
public MapReduceTask<String, String, String, Integer> invokeMapReduce(String keys[]) throws Exception{ MapReduceTask<String,String,String,Integer> task = super.invokeMapReduce(keys, true); EmbeddedCacheManager cacheManager = getCacheManagers().get(0); String sharedCache = task.getIntermediateCacheName(); assertTrue("MapReduceTask has not use shared intermediate cache as it should have but it used " + sharedCache, MapReduceTask.DEFAULT_TMP_CACHE_CONFIGURATION_NAME.equals(sharedCache)); Cache<Object, Object> sharedTmpCache = cacheManager.getCache(sharedCache); int elementsInCache = sharedTmpCache.size(); assertTrue("Shared cache " + sharedCache + " is not empty. It has " + elementsInCache + " keys/values", elementsInCache == 0); return task; }

Target:
public MapReduceTask<String, String, String, Integer> invokeMapReduce(String keys[]) throws Exception{ MapReduceTask<String,String,String,Integer> task = super.invokeMapReduce(keys, true); EmbeddedCacheManager cacheManager = getCacheManagers().get(0); String sharedCache = task.getIntermediateCacheName(); assertEquals("MapReduceTask has not use shared intermediate cache as it should have but it used " + sharedCache, MapReduceTask.DEFAULT_TMP_CACHE_CONFIGURATION_NAME, sharedCache); Cache<Object, Object> sharedTmpCache = cacheManager.getCache(sharedCache); int elementsInCache = sharedTmpCache.size(); assertEquals("Shared cache " + sharedCache + " is not empty. It has " + elementsInCache + " keys/values", elementsInCache, 0); return task; }
Source:
public NetworkTemplateListModel() { setTitle(ConstantsManager.getInstance().getConstants().templatesTitle()); setHelpTag(HelpTag.templates); setHashName("templates"); setIsAvailable(ApplicationModeHelper.isModeSupported(ApplicationMode.VirtOnly)); setComparator(new Comparator<PairQueryable<VmNetworkInterface, VmTemplate>>() { @Override public int compare(PairQueryable<VmNetworkInterface, VmTemplate> paramT1, PairQueryable<VmNetworkInterface, VmTemplate> paramT2) { int compareValue = paramT1.getSecond().getVdsGroupName().compareTo(paramT2.getSecond().getVdsGroupName()); if (compareValue != 0) { return compareValue; } return paramT1.getSecond().getName().compareTo(paramT2.getSecond().getName()); } }); setRemoveCommand(new UICommand("Remove", this)); updateActionAvailability(); }

Target:
public NetworkTemplateListModel() { setTitle(ConstantsManager.getInstance().getConstants().templatesTitle()); setHelpTag(HelpTag.templates); setHashName("templates"); setAvailableInModes(ApplicationMode.VirtOnly); setComparator(new Comparator<PairQueryable<VmNetworkInterface, VmTemplate>>() { @Override public int compare(PairQueryable<VmNetworkInterface, VmTemplate> paramT1, PairQueryable<VmNetworkInterface, VmTemplate> paramT2) { int compareValue = paramT1.getSecond().getVdsGroupName().compareTo(paramT2.getSecond().getVdsGroupName()); if (compareValue != 0) { return compareValue; } return paramT1.getSecond().getName().compareTo(paramT2.getSecond().getName()); } }); setRemoveCommand(new UICommand("Remove", this)); updateActionAvailability(); }
Source:
private boolean correctStorageDomainFormat() { storage_pool storagePool = getStoragePool(); StorageFormatType storageFormat = getStorageDomain().getStorageFormat(); StorageType storageType = getStorageDomain().getstorage_type(); boolean isBlockStorage = storageType == StorageType.ISCSI || storageType == StorageType.FCP; Set<StorageFormatType> supportedStorageFormats; if (storagePool != null) { supportedStorageFormats = getSupportedStorageFormatSet(storagePool.getcompatibility_version()); } else { Version vdsVersion = Collections.max(getVds().getSupportedClusterVersionsSet()); supportedStorageFormats = getSupportedStorageFormatSet(vdsVersion); } if (!supportedStorageFormats.contains(storageFormat)) { return false; } if (storageFormat == StorageFormatType.V1 && isBlockStorage && storagePool == null) { return false; } if (storageFormat == StorageFormatType.V2 && !isBlockStorage) { return false; } return true; }

Target:
private boolean correctStorageDomainFormat() { storage_pool storagePool = getStoragePool(); StorageFormatType storageFormat = getStorageDomain().getStorageFormat(); StorageType storageType = getStorageDomain().getstorage_type(); StorageDomainType storageDomainType = getStorageDomain().getstorage_domain_type(); boolean isBlockStorage = storageType == StorageType.ISCSI || storageType == StorageType.FCP; boolean isDataStorageDomain = storageDomainType == StorageDomainType.Data; Set<StorageFormatType> supportedStorageFormats; if (storagePool != null) { supportedStorageFormats = getSupportedStorageFormatSet(storagePool.getcompatibility_version()); } else { storage_pool vdsStoragePool = getStoragePoolDAO().get(getVds().getstorage_pool_id()); if (vdsStoragePool == null) { return false; } supportedStorageFormats = getSupportedStorageFormatSet(vdsStoragePool.getcompatibility_version()); } if (!supportedStorageFormats.contains(storageFormat)) { return false; } if (storageFormat == StorageFormatType.V1 && isBlockStorage && storagePool == null) { return false; } if (storageFormat == StorageFormatType.V2 && (!isBlockStorage || !isDataStorageDomain)) { return false; } if (storageFormat == StorageFormatType.V3 && !isDataStorageDomain) { return false; } return true; }
Source:
protected void compute(CoreSession session, List<String> ids, Map<String, Serializable> properties) { Map<String, Serializable> actualProperties = new HashMap<>(properties); String eventId = (String) actualProperties.remove(NOTIFY); Collection<DocumentRef> refs = ids.stream().map(IdRef::new).collect(Collectors.toList()); ids.forEach(id -> actualProperties.forEach((k, v) -> session.setDocumentSystemProp(new IdRef(id), k, v))); session.save(); if (eventId != null) { fireEvent(session, eventId, refs); } }

Target:
protected void compute(CoreSession session, List<String> ids, Map<String, Serializable> properties) { Map<String, Serializable> actualProperties = new HashMap<>(properties); String eventId = (String) actualProperties.remove(NOTIFY); Collection<DocumentRef> refs = ids.stream().map(IdRef::new).collect(Collectors.toList()); Collection<DocumentRef> updatedRefs = new ArrayList<>(refs.size()); for (DocumentRef ref : refs) { for (Entry<String, Serializable> entry : actualProperties.entrySet()) { try { session.setDocumentSystemProp(ref, entry.getKey(), entry.getValue()); updatedRefs.add(ref); } catch (NuxeoException e) { getLog().warn("Cannot set system property: " + entry.getKey() + " on: " + ref.toString(), e); } } } try { session.save(); if (eventId != null && !updatedRefs.isEmpty()) { fireEvent(session, eventId, updatedRefs); } } catch (PropertyException e) { getLog().warn("Cannot save session", e); } }
Source:
public Mask parseFromInput(String input, ParserContext context) throws InputParseException { if (!input.startsWith("$")) { return null; } Set<BaseBiome> biomes = new HashSet<>(); String[] biomesList = input.substring(1).split(","); BiomeRegistry biomeRegistry = worldEdit.getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); List<BaseBiome> knownBiomes = biomeRegistry.getBiomes(); for (String biomeName : biomesList) { BaseBiome biome = Biomes.findBiomeByName(knownBiomes, biomeName, biomeRegistry); if (biome == null) { throw new InputParseException("Unknown biome '" + biomeName + '\''); } biomes.add(biome); } return Masks.asMask(new BiomeMask2D(context.requireExtent(), biomes)); }

Target:
public Mask parseFromInput(String input, ParserContext context) throws InputParseException { if (!input.startsWith("$")) { return null; } Set<BaseBiome> biomes = new HashSet<>(); BiomeRegistry biomeRegistry = worldEdit.getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); List<BaseBiome> knownBiomes = biomeRegistry.getBiomes(); for (String biomeName : Splitter.on(",").split(input.substring(1))) { BaseBiome biome = Biomes.findBiomeByName(knownBiomes, biomeName, biomeRegistry); if (biome == null) { throw new InputParseException("Unknown biome '" + biomeName + '\''); } biomes.add(biome); } return Masks.asMask(new BiomeMask2D(context.requireExtent(), biomes)); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Post)) return false; Post post = (Post) o; return getId().equals(post.getId()); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Post)) { return false; } Post post = (Post) o; return getId().equals(post.getId()); }
Source:
public void run(final int iteration) { LOG.log(Level.INFO, "Iteration Started"); int numSampledDocuments = 0; int miniBatchCount = 0; Map<Long, Document> workLoadMap = trainingDataProvider.getNextTrainingData(); while (!workLoadMap.isEmpty()) { final List<Document> workLoad = new ArrayList<>(workLoadMap.values()); final int batchSize = workLoad.size(); sampler.sample(workLoad); numSampledDocuments += batchSize; miniBatchCount++; LOG.log(Level.INFO, "{0} documents have been sampled, mini-batch count is {1}", new Object[]{numSampledDocuments, miniBatchCount}); workLoadMap = trainingDataProvider.getNextTrainingData(); } LOG.log(Level.INFO, "Start computing log likelihood"); final List<int[]> wordTopicCounts = parameterWorker.pull(vocabList); final int[] wordTopicCountsSummary = wordTopicCounts.remove(numVocabs); final Map<Long, Document> totalWorkloadMap = memoryStore.getAll(); final List<Document> totalWorkLoad = new ArrayList<>(totalWorkloadMap.values()); LOG.log(Level.INFO, "App metric log: {0}", buildAppMetrics(statCalculator.computeDocLLH(totalWorkLoad), statCalculator.computeWordLLH(wordTopicCounts, wordTopicCountsSummary))); LOG.log(Level.INFO, "Iteration Ended"); }

Target:
public void run(final int iteration) { final long iterationBeginMs = System.currentTimeMillis(); resetTracers(); final int numEMBlocks = memoryStore.getNumBlocks(); int miniBatchIdx = 0; int numDocumentsSampled = 0; final List<Document> totalDocumentsSampled = new LinkedList<>(); Map<Long, Document> nextTrainingData = trainingDataProvider.getNextTrainingData(); while (!nextTrainingData.isEmpty()) { final List<Document> documents = new ArrayList<>(nextTrainingData.values()); final int numDocumentsToSample = documents.size(); sampler.sample(documents.subList(numDocumentsSampled, numDocumentsSampled + numDocumentsToSample), computeTracer, pushTracer, pullTracer); numDocumentsSampled += numDocumentsToSample; totalDocumentsSampled.addAll(nextTrainingData.values()); LOG.log(Level.INFO, "{0} documents have been sampled until mini-batch {1}", new Object[]{numDocumentsSampled, miniBatchIdx}); miniBatchIdx++; nextTrainingData = trainingDataProvider.getNextTrainingData(); } final double elapsedTimeSec = (System.currentTimeMillis() - iterationBeginMs) / 1000.0D; LOG.log(Level.INFO, "Start computing log likelihood"); final List<int[]> wordTopicCounts = parameterWorker.pull(vocabList); final int[] wordTopicCountsSummary = wordTopicCounts.remove(numVocabs); final Metrics appMetrics = buildAppMetrics(statCalculator.computeDocLLH(totalDocumentsSampled), statCalculator.computeWordLLH(wordTopicCounts, wordTopicCountsSummary)); final WorkerMetrics workerMetrics = buildMetricsMsg(iteration, appMetrics, miniBatchIdx - 1, numEMBlocks, totalDocumentsSampled.size(), elapsedTimeSec); LOG.log(Level.INFO, "WorkerMetrics {0}", workerMetrics); sendMetrics(workerMetrics); }
Source:
private void prepareTheme() { String[] themeOptionsNames = {"Default", "Dark", "Light"}; themeListPreference.setEntries(themeOptionsNames); themeListPreference.setEntryValues(themeOptionsNames); String currentTheme = getCurrentTheme(); if (currentTheme.equals("")){ themeListPreference.setSummary(themeOptionsNames[0]); themeListPreference.setValue(themeOptionsNames[0]); } else { int prefIndex = themeListPreference.findIndexOfValue(currentTheme); themeListPreference.setSummary(themeListPreference.getEntries()[prefIndex]); themeListPreference.setValue(currentTheme); } themeListPreference.setOnPreferenceChangeListener((preference, newValue) -> { String userSelectedValue = (String) newValue; int prefIndex = themeListPreference.findIndexOfValue(userSelectedValue); themeListPreference.setSummary(themeListPreference.getEntries()[prefIndex]); saveThemeValue(userSelectedValue); getActivity().recreate(); return true; }); }

Target:
private void prepareTheme() { themeListPreference.setSummary(getThemeSummary(getCurrentTheme())); themeListPreference.setOnPreferenceChangeListener((preference, newValue) -> { getActivity().recreate(); return true; }); }
Source:
public void testValidReport() throws IOException, URISyntaxException { final Report report = OBJECT_MAPPER.readValue(loadResource("testValidReport"), Report.class); assertEquals(new URI("<LINK_0>"), ((ChromeScreenshotReportSource) report.getSource()).getUri()); assertTrue(report.getSchedule() instanceof OneOffSchedule); assertEquals(1, report.getRecipients().size()); assertEquals("nobody@example.com", report.getRecipients().get(0).getAddress()); }

Target:
public void testValidReport() throws IOException { final Report expected = new Report(); expected.setId(UUID.fromString("11111111-1111-1111-1111-111111111111")); expected.setName("My Report Name"); final ChromeScreenshotReportSource expectedSource = new ChromeScreenshotReportSource(); expectedSource.setId(UUID.fromString("22222222-2222-2222-2222-222222222222")); expectedSource.setUri(URI.create("<LINK_0>")); expectedSource.setTitle("My Report Title"); expectedSource.setIgnoreCertificateErrors(false); expectedSource.setTriggeringEventName("myTriggeringEventName"); expected.setSource(expectedSource); final OneOffSchedule expectedSchedule = new OneOffSchedule(); expectedSchedule.setRunAtAndAfter(Instant.parse("2019-01-01T00:00:00Z")); expected.setSchedule(expectedSchedule); final Recipient expectedRecipient = new Recipient(); expectedRecipient.setType(RecipientType.EMAIL); expectedRecipient.setId(UUID.fromString("33333333-3333-3333-3333-333333333333")); expectedRecipient.setAddress("nobody@example.com"); expectedRecipient.setFormat(new HtmlReportFormat()); expected.setRecipients(Lists.newArrayList(expectedRecipient)); final Report actual = loadResourceAs("testValidReport", Report.class); assertEquals(expected, actual); }
Source:
public SpoutEntitySnapshot(Entity e) { if (e.isRemoved()) { throw new IllegalArgumentException("Can not take a snapshot of a removed entity"); } this.entity = new WeakReference<>(e); this.entityId = e.getId(); this.uniqueId = e.getUID(); this.location = e.getPhysics().getTransform(); this.worldName = e.getWorld().getName(); this.worldId = e.getWorld().getUID(); final NetworkComponent network = e.get(NetworkComponent.class); this.viewDistance = network.getSyncDistance(); this.observer = network.isObserver(); this.savable = e.isSavable(); if (e.getData().size() > 0) { this.dataMap = e.getData().deepCopy(); } else { this.dataMap = new ManagedHashMap(); } components = new ArrayList<>(); for (Component c : e.values()) { if (c.isDetachable()) { this.components.add(c.getClass()); } } }

Target:
public SpoutEntitySnapshot(Entity e) { if (e.isRemoved()) { throw new IllegalArgumentException("Can not take a snapshot of a removed entity"); } this.entity = new WeakReference<>(e); this.entityId = e.getId(); this.uniqueId = e.getUID(); this.location = e.getPhysics().getTransform(); this.worldName = e.getWorld().getName(); this.worldId = e.getWorld().getUID(); final NetworkComponent network = e.get(NetworkComponent.class); this.syncDistance = network.getSyncDistance(); this.observer = network.isObserver(); this.savable = e.isSavable(); if (e.getData().size() > 0) { this.dataMap = e.getData().deepCopy(); } else { this.dataMap = new ManagedHashMap(); } components = new ArrayList<>(); for (Component c : e.values()) { if (c.isDetachable()) { this.components.add(c.getClass()); } } }
Source:
public static int[] getWeekendDays(Locale locale) { if (THU_FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.THURSDAY, Calendar.FRIDAY}; } else if (FRY_SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SUNDAY}; } else if (FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY}; } else if (SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.SUNDAY}; } else if (FRY_SAT_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SATURDAY}; } else { return new int[]{Calendar.SATURDAY, Calendar.SUNDAY}; } }

Target:
private static int[] getWeekendDays(Locale locale) { if (THU_FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.THURSDAY, Calendar.FRIDAY}; } else if (FRY_SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SUNDAY}; } else if (FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY}; } else if (SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.SUNDAY}; } else if (FRY_SAT_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SATURDAY}; } else { return new int[]{Calendar.SATURDAY, Calendar.SUNDAY}; } }
Source:
private void copyResourcesToWorkerId(String workerId) throws IOException { final String testSuiteId = agent.getTestSuite().id; if (!new File(WORKERS_PATH + testSuiteId + "/upload/").exists()) { log.info("Skipping copy, since no copy file at the agent"); return; } String cpCommand = format("cp -rfv %s/%s/upload/* %s/%s/%s/", WORKERS_PATH, testSuiteId, WORKERS_PATH, testSuiteId, workerId); bash.execute(cpCommand); log.info(format("Finished copying resources file '%s' to worker", WORKERS_PATH)); }

Target:
private void copyResourcesToWorkerId(String workerId) throws IOException { final String testSuiteId = agent.getTestSuite().id; File uploadDirectory = new File(WORKERS_PATH + "/" + testSuiteId + "/upload/"); if (!uploadDirectory.exists()) { log.debug("Skip copying upload directory to workers since no upload directory was found"); return; } String cpCommand = format("cp -rfv %s/%s/upload/* %s/%s/%s/", WORKERS_PATH, testSuiteId, WORKERS_PATH, testSuiteId, workerId); bash.execute(cpCommand); log.info(format("Finished copying '+%s+' to worker", WORKERS_PATH)); }
Source:
public void launch() { List<String> commands = Lists.newLinkedList(); if (isPackageInstall()) { commands.add(addSbinPathCommand()); commands.add(sudo("service riak start")); } else { commands.add("ulimit -n 65536 || true"); commands.add(format("%s start >/dev/null 2>&1 < /dev/null &", getRiakCmd())); } ScriptHelper launchScript = newScript(LAUNCHING) .body.append(commands); if (!isRiakOnPath()) { Map<String, String> newPathVariable = ImmutableMap.of("PATH", sbinPath); log.warn("riak command not found on PATH. Altering future commands' environment variables from to {}", getShellEnvironment(), newPathVariable); launchScript.environmentVariablesReset(newPathVariable); } launchScript.failOnNonZeroResultCode().execute(); final String mainUri = String.format("http://%s:%s/admin", entity.getAttribute(Attributes.HOSTNAME), entity.getAttribute(RiakNode.RIAK_WEB_PORT)); entity.setAttribute(Attributes.MAIN_URI, URI.create(mainUri)); }

Target:
public void launch() { List<String> commands = Lists.newLinkedList(); if (isPackageInstall()) { commands.add(addSbinPathCommand()); commands.add(sudo("service riak start")); } else { commands.add("ulimit -n 65536 || true"); commands.add(format("%s start >/dev/null 2>&1 < /dev/null &", getRiakCmd())); } ScriptHelper launchScript = newScript(LAUNCHING) .body.append(commands); if (!isRiakOnPath()) { Map<String, String> newPathVariable = ImmutableMap.of("PATH", sbinPath); log.warn("riak command not found on PATH. Altering future commands' environment variables from to {}", getShellEnvironment(), newPathVariable); launchScript.environmentVariablesReset(newPathVariable); } launchScript.failOnNonZeroResultCode().execute(); String mainUri = String.format("http://%s:%s/admin", entity.getAttribute(Attributes.HOSTNAME), entity.getAttribute(RiakNode.RIAK_WEB_PORT)); entity.setAttribute(Attributes.MAIN_URI, URI.create(mainUri)); }
Source:
public static VmNetworkInterface map(NIC model, VmNetworkInterface template) { VmNetworkInterface entity = template != null ? template : new VmNetworkInterface(); if (model.isSetVm() && model.getVm().isSetId()) { entity.setVmId(new Guid(model.getVm().getId())); } if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetMac() && model.getMac().isSetAddress()) { entity.setMacAddress(model.getMac().getAddress()); } if (model.isSetNetwork() && model.getNetwork().isSetName()) { entity.setNetworkName(model.getNetwork().getName()); } if (model.isSetInterface()) { NicInterface nicType = NicInterface.fromValue(model.getInterface()); if (nicType != null) { entity.setType(map(nicType)); } } if (model.isSetActive()) { entity.setActive(model.isActive()); } if (model.isSetPortsMirroring()) { entity.setPortMirroring(model.getPortsMirroring().isSetPortMirroring() && model.getPortsMirroring().getPortMirroring().getNetwork().getName().equals(entity.getNetworkName())); } return entity; }

Target:
public static VmNetworkInterface map(NIC model, VmNetworkInterface template) { VmNetworkInterface entity = template != null ? template : new VmNetworkInterface(); if (model.isSetVm() && model.getVm().isSetId()) { entity.setVmId(new Guid(model.getVm().getId())); } if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetMac() && model.getMac().isSetAddress()) { entity.setMacAddress(model.getMac().getAddress()); } if (model.isSetNetwork() && model.getNetwork().isSetName()) { entity.setNetworkName(model.getNetwork().getName()); } if (model.isSetInterface()) { NicInterface nicType = NicInterface.fromValue(model.getInterface()); if (nicType != null) { entity.setType(map(nicType)); } } if (model.isSetActive()) { entity.setActive(model.isActive()); } if (model.isSetPortsMirroring() && model.getPortsMirroring().isSetPortMirroring()) { entity.setPortMirroring(model.getPortsMirroring().getPortMirroring().isSetNetwork()); } return entity; }
Source:
public SplitOperator(Map<String, SerializablePredicate<R>> splitFns) { this.splitFns = splitFns; for (String stream: splitFns.keySet()) { StreamletUtils.checkNotBlank(stream, "Stream id can not be empty"); } }

Target:
public SplitOperator(Map<String, SerializablePredicate<R>> splitFns) { this.splitFns = splitFns; }
Source:
public InputStream getInputStream(RepoObject repoObject) throws RepoException { try{ return s3Client.getObject(repoObject.getBucketName(), repoObject.getChecksum()).getObjectContent(); } catch (Exception e) { throw new RepoException(e); } }

Target:
public InputStream getInputStream(RepoObject repoObject) throws RepoException { try{ return s3Client.getObject(repoObject.getBucketName(), repoObject.getChecksum()).getObjectContent(); } catch (AmazonClientException e) { throw new RepoException(e); } }