auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public CapableIndexReference index( int label, int... properties ) { ktx.assertOpen(); SchemaIndexDescriptor indexDescriptor = storeReadLayer.indexGetForSchema( new LabelSchemaDescriptor( label, properties ) ); if ( ktx.hasTxStateWithChanges() ) { LabelSchemaDescriptor descriptor = new LabelSchemaDescriptor( label, properties ); ReadableDiffSets<SchemaIndexDescriptor> diffSets = ktx.txState().indexDiffSetsByLabel( label ); if ( indexDescriptor != null ) { if ( diffSets.isRemoved( indexDescriptor ) ) { return CapableIndexReference.NO_INDEX; } else { return indexGetCapability( indexDescriptor ); } } else { Iterator<SchemaIndexDescriptor> fromTxState = filter( SchemaDescriptor.equalTo( descriptor ), diffSets.apply( emptyResourceIterator() ) ); if ( fromTxState.hasNext() ) { return DefaultCapableIndexReference.fromDescriptor( fromTxState.next() ); } else { return CapableIndexReference.NO_INDEX; } } } return indexDescriptor != null ? indexGetCapability( indexDescriptor ) : CapableIndexReference.NO_INDEX; }

Target:
public CapableIndexReference index( int label, int... properties ) { ktx.assertOpen(); LabelSchemaDescriptor descriptor; try { descriptor = SchemaDescriptorFactory.forLabel( label, properties ); } catch ( IllegalArgumentException ignore ) { return CapableIndexReference.NO_INDEX; } SchemaIndexDescriptor indexDescriptor = storeReadLayer.indexGetForSchema( descriptor ); if ( ktx.hasTxStateWithChanges() ) { ReadableDiffSets<SchemaIndexDescriptor> diffSets = ktx.txState().indexDiffSetsByLabel( label ); if ( indexDescriptor != null ) { if ( diffSets.isRemoved( indexDescriptor ) ) { return CapableIndexReference.NO_INDEX; } else { return indexGetCapability( indexDescriptor ); } } else { Iterator<SchemaIndexDescriptor> fromTxState = filter( SchemaDescriptor.equalTo( descriptor ), diffSets.apply( emptyResourceIterator() ) ); if ( fromTxState.hasNext() ) { return DefaultCapableIndexReference.fromDescriptor( fromTxState.next() ); } else { return CapableIndexReference.NO_INDEX; } } } return indexDescriptor != null ? indexGetCapability( indexDescriptor ) : CapableIndexReference.NO_INDEX; }
Source:
public String getUnknownArtifactLink(String guid, BranchId branch) { String message = String.format("Invalid Link: artifact with guid:[%s] on branchUuid:[%s] does not exist", guid, branch); String internalLink = String.format("http://none/%s?guid=%s&amp;branchUuid=%s", "unknown", guid, branch); return String.format(WORDML_LINK_FORMAT, internalLink, message); }

Target:
public String getUnknownArtifactLink(String guid, BranchId branch) { String message = String.format("Invalid Link: artifact with guid:[%s] on branchUuid:[%s] does not exist", guid, branch); String internalLink = String.format("http://none/unknown?guid=%s&amp;branchUuid=%s", guid, branch); return String.format(WORDML_LINK_FORMAT, internalLink, message); }
Source:
public void close() { List<String> connections = new ArrayList<>(channels.keySet()); AtomicReference<Throwable> firstException = new AtomicReference<>(); connections.forEach(id -> Utils.closeQuietly(() -> close(id), "close channel:" + id, firstException)); Utils.closeQuietly(nioSelector, "nioSelector", firstException); Utils.closeQuietly(sensors, "sensors", firstException); Utils.closeQuietly(channelBuilder, "channelBuilder", firstException); Throwable exception = firstException.get(); if (exception instanceof RuntimeException && !(exception instanceof SecurityException)) { throw (RuntimeException) exception; } }

Target:
public void close() { List<String> connections = new ArrayList<>(channels.keySet()); AtomicReference<Throwable> firstException = new AtomicReference<>(); Utils.closeAllQuietly(firstException, "release connections", connections.stream().map(id -> (AutoCloseable) () -> close(id)).toArray(AutoCloseable[]::new)); Utils.closeQuietly(nioSelector, "nioSelector", firstException); Utils.closeQuietly(sensors, "sensors", firstException); Utils.closeQuietly(channelBuilder, "channelBuilder", firstException); Throwable exception = firstException.get(); if (exception instanceof RuntimeException && !(exception instanceof SecurityException)) { throw (RuntimeException) exception; } }
Source:
public void testGetNewInstance() { ITmfStateProvider clone = fStateProvider.getNewInstance(); assertNotSame(fStateProvider, clone); assertEquals(fStateProvider.getVersion(), clone.getVersion()); assertEquals(fStateProvider.getTrace(), clone.getTrace()); }

Target:
public void testGetNewInstance() { ITmfStateProvider clone = fStateProvider.getNewInstance(); assertNotSame("The original CounterStateProvider and its clone do not share the same reference.", fStateProvider, clone); assertEquals(fStateProvider.getVersion(), clone.getVersion()); assertEquals(fStateProvider.getTrace(), clone.getTrace()); }
Source:
public Bean<T> complete() { ImmutableBean<T> result = new ImmutableBean<>(this); if (createCallback == null) { throw BeanLogger.LOG.noCallbackSpecifiedForCustomBean(result.toString()); } return result; }

Target:
public Bean<T> complete() { if (createCallback == null) { throw BeanLogger.LOG.noCallbackSpecifiedForCustomBean("bean [" + beanClass.toString() + ", with types: " + Formats.formatTypes(attributes.types) + ", and qualifiers: " + Formats.formatAnnotations(attributes.qualifiers) + "]"); } return new ImmutableBean<>(this); }
Source:
private RawPacket doTransform(RawPacket pkt, boolean send) { RTCPIterator it = new RTCPIterator(pkt); while (it.hasNext()) { ByteArrayBuffer baf = it.next(); int pt = RTCPHeaderUtils.getPacketType(baf); if (pt > -1 && (byte) pt == RTCPRRPacket.RR || RTCPREMBPacket.isREMBPacket(baf) || RTCPTCCPacket.isTCCPacket(baf)) { it.remove(); continue; } if (!send && pt > -1) { int fmt = RTCPHeaderUtils.getReportCount(baf); if (((byte) pt == RTCPFeedbackMessageEvent.PT_PS && fmt == RTCPFeedbackMessageEvent.FMT_PLI) || ((byte) pt == RTCPFeedbackMessageEvent.PT_PS && fmt == RTCPFeedbackMessageEvent.FMT_FIR)) { long source = RTCPFBPacket.getSourceSSRC(baf); ((RTPTranslatorImpl) stream.getRTPTranslator()) .getRtcpFeedbackMessageSender() .requestKeyframe(source); it.remove(); continue; } } } return pkt.getLength() == 0 ? null : pkt; }

Target:
private RawPacket doTransform(RawPacket pkt, boolean send) { RTCPIterator it = new RTCPIterator(pkt); while (it.hasNext()) { ByteArrayBuffer baf = it.next(); int pt = RTCPHeaderUtils.getPacketType(baf); if (pt == RTCPRRPacket.RR || RTCPREMBPacket.isREMBPacket(baf) || RTCPTCCPacket.isTCCPacket(baf)) { it.remove(); continue; } if (!send && pt > -1) { int fmt = RTCPHeaderUtils.getReportCount(baf); if ((pt == RTCPFeedbackMessageEvent.PT_PS && fmt == RTCPFeedbackMessageEvent.FMT_PLI) || (pt == RTCPFeedbackMessageEvent.PT_PS && fmt == RTCPFeedbackMessageEvent.FMT_FIR)) { long source = RTCPFBPacket.getSourceSSRC(baf); ((RTPTranslatorImpl) stream.getRTPTranslator()) .getRtcpFeedbackMessageSender() .requestKeyframe(source); it.remove(); continue; } } } return pkt.getLength() == 0 ? null : pkt; }
Source:
public RowIterator get(ScannerConfiguration config) { RowIterator rowIter = txb.get(config); while ((rowIter != null) && rowIter.hasNext()) { Map.Entry<Bytes, ColumnIterator> rowEntry = rowIter.next(); ColumnIterator colIter = rowEntry.getValue(); while (colIter.hasNext()) { Map.Entry<Column, Bytes> colEntry = colIter.next(); txLog.filteredAdd( LogEntry.newSet(rowEntry.getKey(), colEntry.getKey(), colEntry.getValue()), filter); } } return rowIter; }

Target:
public RowIterator get(ScannerConfiguration config) { final RowIterator rowIter = txb.get(config); if (rowIter != null) { return new RowIterator() { @Override public boolean hasNext() { return rowIter.hasNext(); } @Override public Map.Entry<Bytes, ColumnIterator> next() { final Map.Entry<Bytes, ColumnIterator> rowEntry = rowIter.next(); if ((rowEntry != null) && (rowEntry.getValue() != null)) { final ColumnIterator colIter = rowEntry.getValue(); return new AbstractMap.SimpleEntry<Bytes, ColumnIterator>( rowEntry.getKey(), new ColumnIterator() { @Override public boolean hasNext() { return colIter.hasNext(); } @Override public Map.Entry<Column, Bytes> next() { Map.Entry<Column, Bytes> colEntry = colIter.next(); if (colEntry != null) { txLog.filteredAdd(LogEntry.newGet(rowEntry.getKey(), colEntry.getKey(), colEntry.getValue()), filter); } return colEntry; } }); } return rowEntry; } }; } return rowIter; }
Source:
public String toString() { return "RSocketConnectedEvent{" + "destination='" + this.destination + '\'' + ", data=" + Arrays.toString(this.data.asByteBuffer().array()) + ", requester=" + this.requester + '}'; }

Target:
public String toString() { return "RSocketConnectedEvent{" + "destination='" + this.destination + '\'' + ", requester=" + this.requester + '}'; }
Source:
public int addNotes(long mid, long did, String[][] fieldsArr, String[] tagsArr) { if (tagsArr != null && fieldsArr.length != tagsArr.length) { throw new IllegalArgumentException("fieldsArr and tagsArr different length"); } long startTimeMillis = SystemClock.uptimeMillis(); Map<String, Note> existingNotesMap = createNotesMap(mid, did); Log.d("test", "notesMap took: " + (SystemClock.uptimeMillis() - startTimeMillis)); List<ContentValues> newNoteValuesList = new ArrayList<>(); for (int i = 0; i < fieldsArr.length; i++) { String[] fields = fieldsArr[i]; if (fields == null) { continue; } String tags = tagsArr[i]; if (fields.length >= 1) { String key = fields[0]; if (existingNotesMap.containsKey(key)) { Note note = existingNotesMap.get(key); if (note == null) { } else if (note.equals(fields, tags)) { } else { } continue; } existingNotesMap.put(key, null); } ContentValues values = new ContentValues(); values.put(FlashCardsContract.Note.MID, mid); values.put(FlashCardsContract.Note.FLDS, joinFields(fields)); if (tags != null) { values.put(FlashCardsContract.Note.TAGS, tags); } newNoteValuesList.add(values); } if (newNoteValuesList.isEmpty()) { return 0; } ContentValues[] newNoteValues = newNoteValuesList.toArray(new ContentValues[newNoteValuesList.size()]); return getCompat().addNewNotes(did, newNoteValues); }

Target:
public int addNotes(long mid, long did, String[][] fieldsArr, String[] tagsArr) { if (tagsArr != null && fieldsArr.length != tagsArr.length) { throw new IllegalArgumentException("fieldsArr and tagsArr different length"); } Map<String, Note> existingNotesMap = createNotesMap(mid, did); List<ContentValues> newNoteValuesList = new ArrayList<>(); for (int i = 0; i < fieldsArr.length; i++) { String[] fields = fieldsArr[i]; if (fields == null) { continue; } String tags = tagsArr[i]; if (fields.length >= 1) { String key = fields[0]; if (existingNotesMap.containsKey(key)) { Note note = existingNotesMap.get(key); if (note == null) { } else if (note.equals(fields, tags)) { } else { } continue; } existingNotesMap.put(key, null); } ContentValues values = new ContentValues(); values.put(FlashCardsContract.Note.MID, mid); values.put(FlashCardsContract.Note.FLDS, joinFields(fields)); if (tags != null) { values.put(FlashCardsContract.Note.TAGS, tags); } newNoteValuesList.add(values); } if (newNoteValuesList.isEmpty()) { return 0; } ContentValues[] newNoteValues = newNoteValuesList.toArray(new ContentValues[newNoteValuesList.size()]); return getCompat().addNewNotes(did, newNoteValues); }
Source:
public Optional<PaxosValue> getGreatestLearnedValue() { Set<PaxosValue> result = rpcClient .getLearnedValuesSince(paxosUseCase, ImmutableMap.of(client, lastKnownSequence)) .get(client); Optional<PaxosValue> greatestIfExists = result.stream() .reduce((fst, snd) -> fst.getRound() > snd.getRound() ? fst : snd); greatestIfExists.ifPresent(paxosValue -> updateLastKnownSequence(paxosValue.getRound())); return greatestIfExists; }

Target:
public Optional<PaxosValue> getGreatestLearnedValue() { Set<PaxosValue> result = rpcClient .getLearnedValuesSince(paxosUseCase, ImmutableMap.of(client, lastKnownSequence.get())) .get(client); Optional<PaxosValue> greatestIfExists = result.stream().max(Comparator.comparingLong(PaxosValue::getRound)); greatestIfExists.ifPresent(paxosValue -> updateLastKnownSequence(paxosValue.getRound())); return greatestIfExists; }
Source:
public void usedByBatch() { final MetadataService metadataService = gd.getMetadataService(); final Collection<String> uris = metadataService.findUris(project, identifier("attr.person.department"), identifier("attr.person.role")); assertThat(metadataService.usedBy(project, new HashSet<>(uris), false).size(), is(2)); }

Target:
public void usedByBatch() { final MetadataService metadataService = gd.getMetadataService(); final Map<String, String> uris = metadataService.identifiersToUris(project, asList("attr.person.department", "attr.person.role")); final Collection<Usage> usages = metadataService.usedBy(project, uris.values(), false); assertThat(usages, hasSize(2)); final Iterator<Usage> usageIterator = usages.iterator(); final Usage usage1 = usageIterator.next(); assertTrue(uris.containsValue(usage1.getUri())); assertThat(usage1.getUsedBy(), hasSize(2)); final Usage usage2 = usageIterator.next(); assertTrue(uris.containsValue(usage2.getUri())); assertThat(usage2.getUsedBy(), hasSize(5)); }
Source:
public boolean isSSLAuthenticationDisabled() { return disableSSLAuthentication; }

Target:
public boolean isSSLAuthenticationDisabled() { return isSSLAuthenticationDisabled; }
Source:
private void restartModules(Collection<Module> modules, ServletContext servletContext) { for (Module module : modules) { if (moduleFactoryWrapper.isModuleStarted(module)) { moduleFactoryWrapper.stopModuleSkipRefresh(module, servletContext); } } boolean needsRefresh = false; for (Module module : moduleFactoryWrapper.getModulesInStartupOrder(modules)) { if (moduleFactoryWrapper.isModuleStopped(module)) { needsRefresh = moduleFactoryWrapper.startModuleSkipRefresh(module, servletContext) || needsRefresh; } } if (needsRefresh) { moduleFactoryWrapper.refreshWebApplicationContext(servletContext); } }

Target:
private void restartModules(Collection<Module> modules, ServletContext servletContext) { stopModules(modules, servletContext, false); startModules(modules, servletContext); }
Source:
public String getDescription(AbstractOperation op) { if (op instanceof CompositeOperation) { final CompositeOperation compositeOperation = (CompositeOperation) op; if (compositeOperation.getMainOperation() != null) { return getDescription(compositeOperation.getMainOperation()); } } final OperationCustomLabelProvider customLabelProvider = getLabelProvider(); final String decorate = decorate(customLabelProvider, op); customLabelProvider.dispose(); return decorate; }

Target:
public String getDescription(AbstractOperation op) { if (op instanceof CompositeOperation) { final CompositeOperation compositeOperation = (CompositeOperation) op; if (compositeOperation.getMainOperation() != null) { return getDescription(compositeOperation.getMainOperation()); } } final OperationCustomLabelProvider customLabelProvider = getLabelProvider(); String decorate; try { decorate = decorate(customLabelProvider, op); return decorate; } finally { customLabelProvider.dispose(); } }
Source:
private static JavaRDD<ReportEntry> generateReportEntries(JavaSparkContext sparkContext, JavaRDD<DocumentText> processedEntities, JavaRDD<Fault> processedFaults) { Preconditions.checkNotNull(sparkContext, "sparkContext has not been set"); ReportEntry processedEnttiesCounter = ReportEntryFactory.createCounterReportEntry(COUNTER_PROCESSED_TOTAL, processedEntities.count()); ReportEntry processedFaultsCounter = ReportEntryFactory.createCounterReportEntry(COUNTER_PROCESSED_FAULT, processedFaults.count()); return sparkContext.parallelize(Lists.newArrayList(processedEnttiesCounter, processedFaultsCounter)); }

Target:
private static JavaRDD<ReportEntry> generateReportEntries(JavaSparkContext sparkContext, JavaRDD<DocumentText> processedEntities, JavaRDD<Fault> processedFaults) { ReportEntry processedEntitiesCounter = ReportEntryFactory.createCounterReportEntry(COUNTER_PROCESSED_TOTAL, processedEntities.count()); ReportEntry processedFaultsCounter = ReportEntryFactory.createCounterReportEntry(COUNTER_PROCESSED_FAULT, processedFaults.count()); return sparkContext.parallelize(Lists.newArrayList(processedEntitiesCounter, processedFaultsCounter)); }
Source:
@Override public PickupStatus getPickupStatus() { PickupStatus customPickupStatus = this.customPickupStatus; return customPickupStatus != null ? customPickupStatus : getShooter() instanceof Monster ? PickupStatus.DISALLOWED : PickupStatus.ALLOWED; }

Target:
public PickupStatus getPickupStatus() { PickupStatus customPickupStatus = this.customPickupStatus; return customPickupStatus != null ? customPickupStatus : getShooter() instanceof Monster ? PickupStatus.DISALLOWED : PickupStatus.ALLOWED; }
Source:
private void restartIfNeeded() { if (isStarted()) { this.initialDelay = period; stop(); start(); } }

Target:
private void restartIfNeeded() { if (isStarted()) { stop(); start(); } }
Source:
public IModel retexture(ImmutableMap<String, String> textures) { List<ResourceLocation> locations = new ArrayList<>(); List<IModel> models = new ArrayList<>(); ImmutableList.Builder<Pair<IModel, IModelState>> builder = ImmutableList.builder(); for (Variant variant : this.variants) { ResourceLocation loc = variant.getModelLocation(); locations.add(loc); IModel model; if (loc.equals(MISSING)) { model = ModelLoaderRegistry.getMissingModel(); } else { try { model = ModelLoaderRegistry.getModel(loc); } catch (Exception e) { throw new RuntimeException(e); } } model = variant.process(model); for (ResourceLocation location : model.getDependencies()) { ModelLoaderRegistry.getModelOrMissing(location); } model = model.retexture(textures); models.add(model); builder.add(Pair.of(model, variant.getState())); } if (models.isEmpty()) { IModel missing = ModelLoaderRegistry.getMissingModel(); models.add(missing); builder.add(Pair.of(missing, TRSRTransformation.identity())); } return new SimpleModel(locations, models, variants, new MultiModelState(builder.build())); }

Target:
public IModel retexture(ImmutableMap<String, String> textures) { List<ResourceLocation> locations = new ArrayList<>(); List<IModel> models = new ArrayList<>(); ImmutableList.Builder<Pair<IModel, IModelState>> builder = ImmutableList.builder(); for (Variant variant : this.variants) { ResourceLocation loc = variant.getModelLocation(); locations.add(loc); IModel model; if (loc.equals(MISSING)) { model = ModelLoaderRegistry.getMissingModel(); } else { try { model = ModelLoaderRegistry.getModel(loc); } catch (Exception e) { Throwables.throwIfUnchecked(e); throw new RuntimeException(e); } } model = variant.process(model); for (ResourceLocation location : model.getDependencies()) { ModelLoaderRegistry.getModelOrMissing(location); } model = model.retexture(textures); models.add(model); builder.add(Pair.of(model, variant.getState())); } if (models.isEmpty()) { IModel missing = ModelLoaderRegistry.getMissingModel(); models.add(missing); builder.add(Pair.of(missing, TRSRTransformation.identity())); } return new SimpleModel(locations, models, variants, new MultiModelState(builder.build())); }
Source:
public void accept(OutputFrame outputFrame) { OutputFrame.OutputType outputType = outputFrame.getType(); String utf8String = outputFrame.getUtf8String(); utf8String = utf8String.replaceAll(FrameConsumerResultCallback.LINE_BREAK_AT_END_REGEX, ""); Map<String, String> originalMdc = MDC.getCopyOfContextMap(); MDC.setContextMap(mdc); try { switch (outputType) { case END: break; case STDOUT: logger.info("{}{}", prefix.isEmpty() ? "" : (prefix + ": "), utf8String); break; case STDERR: logger.error("{}{}", prefix.isEmpty() ? "" : (prefix + ": "), utf8String); break; default: throw new IllegalArgumentException("Unexpected outputType " + outputType); } } finally { if (originalMdc == null) { MDC.clear(); } else { MDC.setContextMap(originalMdc); } } }

Target:
public void accept(OutputFrame outputFrame) { OutputFrame.OutputType outputType = outputFrame.getType(); String utf8String = outputFrame.getUtf8String(); utf8String = utf8String.replaceAll(FrameConsumerResultCallback.LINE_BREAK_AT_END_REGEX, ""); Map<String, String> originalMdc = MDC.getCopyOfContextMap(); MDC.setContextMap(mdc); try { switch (outputType) { case END: break; case STDOUT: if (separateOutputStreams) { logger.info("{}{}", prefix.isEmpty() ? "" : (prefix + ": "), utf8String); } else { logger.info("{}{}: {}", prefix, outputType, utf8String); } break; case STDERR: if (separateOutputStreams) { logger.error("{}{}", prefix.isEmpty() ? "" : (prefix + ": "), utf8String); } else { logger.info("{}{}: {}", prefix, outputType, utf8String); } break; default: throw new IllegalArgumentException("Unexpected outputType " + outputType); } } finally { if (originalMdc == null) { MDC.clear(); } else { MDC.setContextMap(originalMdc); } } }
Source:
public static void writeObjectToConfig(Object o, Configuration config, String key) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(o); byte[] bytes = baos.toByteArray(); config.setBytes(key, bytes); oos.close(); }

Target:
public static void writeObjectToConfig(Object o, Configuration config, String key) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(o); byte[] bytes = baos.toByteArray(); config.setBytes(key, bytes); }
Source:
private DataSource getDatasource() { BasicDataSource dataSource = new BasicDataSource(); dataSource.setUsername(config.getDatabaseUser()); dataSource.setPassword(config.getDatabasePassword()); dataSource.setUrl(config.getDatabaseConnectURI()); if (config.isValidationQuery()) { dataSource.setValidationQuery("SELECT 1"); dataSource.setTestOnBorrow(true); } return dataSource; }

Target:
private DataSource getDatasource() { BasicDataSource dataSource = new BasicDataSource(); dataSource.setUsername(config.getDatabaseUser()); dataSource.setPassword(config.getDatabasePassword()); dataSource.setUrl(config.getDatabaseConnectURI()); if (config.isValidationQuery()) { dataSource.setValidationQuery(config.getValidationQuery()); dataSource.setTestOnBorrow(true); } return dataSource; }
Source:
public <A extends Arg> BuildRule createBuildRule( TargetGraph targetGraph, BuildRuleParams params, BuildRuleResolver resolver, A args) throws NoSuchBuildTargetException { SourcePathResolver pathResolver = new SourcePathResolver(resolver); BuildTarget abiJarTarget = params.getBuildTarget().withAppendedFlavors(CalculateAbi.FLAVOR); ImmutableSortedSet<BuildRule> exportedDeps = resolver.getAllRules(args.exportedDeps.get()); DefaultJavaLibrary defaultJavaLibrary = resolver.addToIndex( new DefaultJavaLibrary( params.appendExtraDeps( BuildRules.getExportedRules( Iterables.concat( params.getDeclaredDeps().get(), exportedDeps, resolver.getAllRules(args.providedDeps.get())))), pathResolver, args.srcs.get(), validateResources( pathResolver, params.getProjectFilesystem(), args.resources.get()), Optional.<Path>absent(), Optional.<SourcePath>absent(), ImmutableList.<String>of(), exportedDeps, resolver.getAllRules(args.providedDeps.get()), new BuildTargetSourcePath(abiJarTarget), false, ImmutableSet.<Path>of(), new KotlincToJarStepFactory( kotlinBuckConfig.getKotlinCompiler().get(), args.extraKotlincArguments.or(ImmutableList.<String>of())), Optional.<Path>absent(), Optional.<String>absent(), ImmutableSortedSet.<BuildTarget>of(), ImmutableSet.<Pattern>of())); resolver.addToIndex( CalculateAbi.of( abiJarTarget, pathResolver, params, new BuildTargetSourcePath(defaultJavaLibrary.getBuildTarget()))); return defaultJavaLibrary; }

Target:
public <A extends Arg> BuildRule createBuildRule( TargetGraph targetGraph, BuildRuleParams params, BuildRuleResolver resolver, A args) throws NoSuchBuildTargetException { SourcePathResolver pathResolver = new SourcePathResolver(resolver); BuildTarget abiJarTarget = params.getBuildTarget().withAppendedFlavors(CalculateAbi.FLAVOR); ImmutableSortedSet<BuildRule> exportedDeps = resolver.getAllRules(args.exportedDeps.get()); DefaultJavaLibrary defaultJavaLibrary = resolver.addToIndex( new DefaultJavaLibrary( params.appendExtraDeps( BuildRules.getExportedRules( Iterables.concat( params.getDeclaredDeps().get(), exportedDeps, resolver.getAllRules(args.providedDeps.get())))), pathResolver, args.srcs.get(), validateResources( pathResolver, params.getProjectFilesystem(), args.resources.get()), Optional.<Path>absent(), Optional.<SourcePath>absent(), ImmutableList.<String>of(), exportedDeps, resolver.getAllRules(args.providedDeps.get()), new BuildTargetSourcePath(abiJarTarget), false, ImmutableSet.<Path>of(), new KotlincToJarStepFactory( kotlinBuckConfig.getKotlinCompiler().get(), args.extraKotlincArguments.get()), Optional.<Path>absent(), Optional.<String>absent(), ImmutableSortedSet.<BuildTarget>of(), ImmutableSet.<Pattern>of())); resolver.addToIndex( CalculateAbi.of( abiJarTarget, pathResolver, params, new BuildTargetSourcePath(defaultJavaLibrary.getBuildTarget()))); return defaultJavaLibrary; }
Source:
public TestLayoutBuilder() { sequencerServers = new ArrayList<>(); layoutServers = new ArrayList<>(); unresponsiveServers = new ArrayList<>(); segments = new ArrayList<>(); clusterId = UUID.fromString("00000000-0000-0000-0000-000000000000"); }

Target:
public TestLayoutBuilder() { sequencerServers = new ArrayList<>(); layoutServers = new ArrayList<>(); unresponsiveServers = new ArrayList<>(); segments = new ArrayList<>(); clusterId = Layout.INVALID_CLUSTER_ID; }
Source:
private void connectToQueue() throws IOException { ConnectionFactory factory = this.getConnectionFactory(); factory.setHost(this.properties.getProperty("queue.host")); factory.setPort(Integer.parseInt(this.properties.getProperty("queue.port"))); factory.setUsername(this.properties.getProperty("queue.username")); factory.setPassword(this.properties.getProperty("queue.password")); factory.setVirtualHost(this.properties.getProperty("queue.vhost")); factory.setAutomaticRecoveryEnabled(true); Connection connection = factory.newConnection(); Channel channel = connection.createChannel(); String exchangeName = this.properties.getProperty("queue.exchangeName"); String[] bindKeys = this.properties.getProperty("queue.bindKey").split(","); channel.exchangeDeclare(exchangeName, "topic", true); String queueName = channel.queueDeclare().getQueue(); for (String bindKey : bindKeys) { bindKey = bindKey.trim(); channel.queueBind(queueName, exchangeName, bindKey); LOG.info("[*] Subscribed on topic exchange '" + exchangeName + "' using binding key '" + bindKey + "'"); } LOG.info("[*] Waiting for messages..."); channel.basicQos(2); channel.basicConsume(queueName, true, this.getWorkerConsumer(channel, worker)); }

Target:
private void connectToQueue() throws IOException { ConnectionFactory factory = this.getConnectionFactory(); factory.setHost(this.properties.getProperty("queue.host")); factory.setPort(Integer.parseInt(this.properties.getProperty("queue.port"))); factory.setUsername(this.properties.getProperty("queue.username")); factory.setPassword(this.properties.getProperty("queue.password")); factory.setVirtualHost(this.properties.getProperty("queue.vhost")); factory.setAutomaticRecoveryEnabled(true); Connection connection = factory.newConnection(); Channel channel = connection.createChannel(); String exchangeName = this.properties.getProperty("queue.exchangeName"); List<String> bindKeys = Arrays.asList(this.properties.getProperty("queue.bindKey").split(",")); channel.exchangeDeclare(exchangeName, "topic", true); String queueName = channel.queueDeclare().getQueue(); for (String bindKey : bindKeys) { channel.queueBind(queueName, exchangeName, bindKey); LOG.info("[*] Subscribed on topic exchange '" + exchangeName + "' using binding key '" + bindKey + "'"); } LOG.info("[*] Waiting for messages..."); channel.basicQos(2); channel.basicConsume(queueName, true, this.getWorkerConsumer(channel, worker)); }
Source:
public ExponentiallyWeightedInterpolationQuantileMethod(double lambda) { this.lambda = lambda; }

Target:
public ExponentiallyWeightedInterpolationQuantileMethod(double lambda) { ArgChecker.inRangeExclusive(lambda, 0.0d, 1.0d, "exponential weight"); this.lambda = lambda; }
Source:
public Float getFinishedPercentage() { int totalSpectra = spectra.size(); return totalSpectra == 0 ? null : (float) (processedSpectra / totalSpectra); }

Target:
public Float getFinishedPercentage() { return null; }
Source:
private StatusAdapter getSingleSelection() { IStructuredSelection selection = statusListViewer.getStructuredSelection(); if (selection.size() == 1) { return (StatusAdapter) selection.getFirstElement(); } return null; }

Target:
private StatusAdapter getSingleSelection() { return (StatusAdapter) statusListViewer.getStructuredSelection().getFirstElement(); }
Source:
private String svg() throws Exception { return new XSLT( new StreamSource( IOUtils.toInputStream( this.build.info( this.uriInfo().getBaseUri(), this.stand ) ) ), new StreamSource( IOUtils.toInputStream( String.format( IOUtils.toString( servletContext() .getResourceAsStream("/xsl/button.xsl") ) , this.rule ) ) ) ).xml(); }

Target:
private String svg() throws Exception { return new XSLT( new StreamSource( IOUtils.toInputStream( this.build.info( this.uriInfo().getBaseUri(), this.stand ) ) ), new StreamSource( IOUtils.toInputStream( String.format( IOUtils.toString( this.getClass().getResourceAsStream( "button.xsl" ) ), this.rule ) ) ) ).xml(); }
Source:
public String encode(String data) { String encodedData = ""; for (int i = 0; i < data.length(); i++) { char c = data.charAt(i); if (i != 0 && c == data.charAt(i - 1)) continue; int amt = 1; for (int j = i + 1; j < data.length() && c == data.charAt(j); j++) { amt++; } if (amt == 1) encodedData += c; else encodedData += amt + Character.toString(c); } return encodedData; }

Target:
public String encode(String data) { StringBuilder encodedDataBuilder = new StringBuilder(); if (data.length() == 0) { return data; } int previousCharCount = 1; char previousChar = data.charAt(0); for (int i = 1; i < data.length(); i++) { char currentChar = data.charAt(i); if (previousChar == currentChar) { previousCharCount++; } if (previousChar != currentChar || i == data.length() - 1) { addChars(encodedDataBuilder, previousChar, previousCharCount); if (previousChar != currentChar && i == data.length() - 1) { addChars(encodedDataBuilder, currentChar, 1); } previousChar = currentChar; previousCharCount = 1; } } return encodedDataBuilder.toString(); }
Source:
public String read(String key) { String data = dataManager.read(key); return (data != null) ? encode(cryptoBox.decrypt(iv, decode(data))) : data; }

Target:
public String read(String key) { String data = dataManager.read(key); return (data == null) ? null : encode(cryptoBox.decrypt(iv, decode(data))); }
Source:
public SpringServiceImpl withTracing(String appInsightInstrumentationKey) { this.addPostRunDependent( context -> manager().inner().getMonitoringSettings() .updatePatchAsync(resourceGroupName(), name(), new MonitoringSettingProperties() .withAppInsightsInstrumentationKey(appInsightInstrumentationKey) .withTraceEnabled(true)) .then(context.voidMono()) ); return this; }

Target:
public SpringServiceImpl withTracing(String appInsightInstrumentationKey) { monitoringSettingTask = context -> manager().inner().getMonitoringSettings() .updatePatchAsync(resourceGroupName(), name(), new MonitoringSettingProperties() .withAppInsightsInstrumentationKey(appInsightInstrumentationKey) .withTraceEnabled(true)) .then(context.voidMono()); return this; }
Source:
public IAtsCountry getCountry(IAtsProgram atsProgram) { IAtsCountry country = null; ArtifactReadable artifact = ((ArtifactReadable) atsProgram.getStoreObject()); if (artifact != null) { country = atsServer.getConfigItemFactory().getCountry(artifact); } return country; }

Target:
public IAtsCountry getCountry(IAtsProgram atsProgram) { IAtsCountry country = null; ArtifactReadable artifact = ((ArtifactReadable) atsProgram.getStoreObject()); if (artifact != null) { ArtifactReadable countryArt = artifact.getRelated(AtsRelationTypes.CountryToProgram_Country).getAtMostOneOrNull(); if (countryArt != null) { country = atsServer.getConfigItemFactory().getCountry(countryArt); } } return country; }
Source:
private Guid getVmToAttach(NGuid poolId) { if (vmToAttach == null) { Guid vmGuid = Guid.Empty; vmGuid = getPrestartedVmToAttach(poolId); if (vmGuid == null || Guid.Empty.equals(vmGuid)) { vmGuid = getNonPrestartedVmToAttach(poolId); } vmToAttach = vmGuid; } return vmToAttach; }

Target:
private Guid getVmToAttach(NGuid poolId) { if (vmToAttach == null) { Guid vmGuid = getPrestartedVmToAttach(poolId); if (vmGuid == null || Guid.Empty.equals(vmGuid)) { vmGuid = getNonPrestartedVmToAttach(poolId); } vmToAttach = vmGuid; } return vmToAttach; }
Source:
public String toString() { StringBuilder b = new StringBuilder(); b.append("Commit(id:" + commitMetadata.getCommitId()); b.append(", snapshots:" + snapshots.size()); b.append(", " + diff.toString()); b.append(")"); return b.toString(); }

Target:
public String toString() { StringBuilder b = new StringBuilder(); b.append("Commit(id:" + commitMetadata.getId()); b.append(", snapshots:" + snapshots.size()); b.append(", " + diff.toString()); b.append(")"); return b.toString(); }
Source:
public ControllerPermission(String name, String actions) { super(name, actions); }

Target:
public ControllerPermission(String name, String actions) { super(validatePermissionName(name), validatePermissionActions(actions)); }
Source:
private static long logEvent(JSONObject event, final boolean offline) { DatabaseHelper dbHelper = DatabaseHelper.getDatabaseHelper(context); long eventId = dbHelper.addEvent(event.toString()); if (dbHelper.getEventCount() >= Constants.EVENT_MAX_COUNT) { dbHelper.removeEvents(dbHelper.getNthEventId(Constants.EVENT_REMOVE_BATCH_SIZE)); } if (dbHelper.getEventCount() >= Constants.EVENT_UPLOAD_THRESHOLD && !offline) { updateServer(); } else { updateServerLater(Constants.EVENT_UPLOAD_PERIOD_MILLIS); } return eventId; }

Target:
private static synchronized long logEvent(JSONObject event, final boolean offline) { DatabaseHelper dbHelper = DatabaseHelper.getDatabaseHelper(context); long eventId = dbHelper.addEvent(event.toString()); if (dbHelper.getEventCount() >= Constants.EVENT_MAX_COUNT) { dbHelper.removeEvents(dbHelper.getNthEventId(Constants.EVENT_REMOVE_BATCH_SIZE)); } if(offline) { return eventId; } if (dbHelper.getEventCount() >= Constants.EVENT_UPLOAD_THRESHOLD) { updateServer(); } else { updateServerLater(Constants.EVENT_UPLOAD_PERIOD_MILLIS); } return eventId; }
Source:
protected StreamTask( Environment environment, @Nullable TimerService timerService, Thread.UncaughtExceptionHandler uncaughtExceptionHandler, StreamTaskActionExecutor actionExecutor, TaskMailbox mailbox) throws Exception { super(environment); this.configuration = new StreamConfig(getTaskConfiguration()); this.recordWriter = createRecordWriterDelegate(configuration, environment); this.actionExecutor = Preconditions.checkNotNull(actionExecutor); this.mailboxProcessor = new MailboxProcessor(this::processInput, mailbox, actionExecutor); this.mailboxProcessor.initMetric(environment.getMetricGroup()); this.asyncExceptionHandler = new StreamTaskAsyncExceptionHandler(environment); this.asyncOperationsThreadPool = Executors.newCachedThreadPool( new ExecutorThreadFactory("AsyncOperations", uncaughtExceptionHandler)); this.stateBackend = createStateBackend(); this.subtaskCheckpointCoordinator = new SubtaskCheckpointCoordinatorImpl( stateBackend.createCheckpointStorage(getEnvironment().getJobID()), getName(), actionExecutor, getCancelables(), getAsyncOperationsThreadPool(), getEnvironment(), this, false); if (timerService == null) { ThreadFactory timerThreadFactory = new DispatcherThreadFactory(TRIGGER_THREAD_GROUP, "Time Trigger for " + getName()); this.timerService = new SystemProcessingTimeService(this::handleTimerException, timerThreadFactory); } else { this.timerService = timerService; } this.ioExecutor = Executors.newSingleThreadExecutor(new ExecutorThreadFactory("state-io")); }

Target:
protected StreamTask( Environment environment, @Nullable TimerService timerService, Thread.UncaughtExceptionHandler uncaughtExceptionHandler, StreamTaskActionExecutor actionExecutor, TaskMailbox mailbox) throws Exception { super(environment); this.configuration = new StreamConfig(getTaskConfiguration()); this.recordWriter = createRecordWriterDelegate(configuration, environment); this.actionExecutor = Preconditions.checkNotNull(actionExecutor); this.mailboxProcessor = new MailboxProcessor(this::processInput, mailbox, actionExecutor); this.mailboxProcessor.initMetric(environment.getMetricGroup()); this.asyncExceptionHandler = new StreamTaskAsyncExceptionHandler(environment); this.asyncOperationsThreadPool = Executors.newCachedThreadPool( new ExecutorThreadFactory("AsyncOperations", uncaughtExceptionHandler)); this.stateBackend = createStateBackend(); this.subtaskCheckpointCoordinator = new SubtaskCheckpointCoordinatorImpl( stateBackend.createCheckpointStorage(getEnvironment().getJobID()), getName(), actionExecutor, getCancelables(), getAsyncOperationsThreadPool(), getEnvironment(), this, configuration.isUnalignedCheckpointsEnabled(), this::prepareInputSnapshot); if (timerService == null) { ThreadFactory timerThreadFactory = new DispatcherThreadFactory(TRIGGER_THREAD_GROUP, "Time Trigger for " + getName()); this.timerService = new SystemProcessingTimeService(this::handleTimerException, timerThreadFactory); } else { this.timerService = timerService; } this.channelIOExecutor = Executors.newSingleThreadExecutor(new ExecutorThreadFactory("channel-state-unspilling")); }
Source:
private Map<String, Object> executeGraphQLQuery(String sessionId, Query query) throws ServiceException, RestServerException { if (sessionId == null || query == null) return null; SchedulingApiClientGwt client = new SchedulingApiClientGwt(SchedulerConfig.get().getSchedulingApiUrl(), httpClient, threadPool); return client.execute(sessionId, query); }

Target:
private Map<String, Object> executeGraphQLQuery(String sessionId, Query query) throws ServiceException, RestServerException { if (sessionId == null || query == null) return null; return graphQLClient.execute(sessionId, query); }
Source:
public void testAlternateBloomFilterExpiration(){ multiBloomFilter.initializeAllBloomFilters(); try { Thread.sleep(multiBloomFilter.getBloomFilterLifeSpanSeconds() * 1000 + 1); assertThat(multiBloomFilter.hasExpired(DateTime.now(DateTimeZone.UTC), 0), is(true)); assertThat(multiBloomFilter.hasExpired(DateTime.now(DateTimeZone.UTC), 1), is(false)); multiBloomFilter.resetAllBloomExpiredFilters(DateTime.now(DateTimeZone.UTC)); assertThat(multiBloomFilter.hasExpired(DateTime.now(DateTimeZone.UTC), 0), is(false)); assertThat(multiBloomFilter.hasExpired(DateTime.now(DateTimeZone.UTC), 1), is(false)); Thread.sleep(multiBloomFilter.getBloomFilterOffsetSeconds() * 1000 + 1); assertThat(multiBloomFilter.hasExpired(DateTime.now(DateTimeZone.UTC), 0), is(false)); assertThat(multiBloomFilter.hasExpired(DateTime.now(DateTimeZone.UTC), 1), is(true)); multiBloomFilter.resetAllBloomExpiredFilters(DateTime.now(DateTimeZone.UTC)); assertThat(multiBloomFilter.hasExpired(DateTime.now(DateTimeZone.UTC), 0), is(false)); assertThat(multiBloomFilter.hasExpired(DateTime.now(DateTimeZone.UTC), 1), is(false)); } catch (InterruptedException e) { e.printStackTrace(); } }

Target:
public void testAlternateBloomFilterExpiration(){ final DateTime dt = DateTime.now(DateTimeZone.UTC); multiBloomFilter.initializeAllBloomFilters(dt); final DateTime dtCycleOne = dt.plusMillis(multiBloomFilter.getBloomFilterLifeSpanSeconds() * 1000 + 1); assertThat(multiBloomFilter.hasExpired(dtCycleOne, 0), is(true)); assertThat(multiBloomFilter.hasExpired(dtCycleOne, 1), is(false)); multiBloomFilter.resetAllBloomExpiredFilters(dtCycleOne); assertThat(multiBloomFilter.hasExpired(dtCycleOne, 0), is(false)); assertThat(multiBloomFilter.hasExpired(dtCycleOne, 1), is(false)); final DateTime dtCycleOneAndHalf = dtCycleOne.plusMillis(multiBloomFilter.getBloomFilterOffsetSeconds() * 1000 + 1); assertThat(multiBloomFilter.hasExpired(dtCycleOneAndHalf, 0), is(false)); assertThat(multiBloomFilter.hasExpired(dtCycleOneAndHalf, 1), is(true)); multiBloomFilter.resetAllBloomExpiredFilters(dtCycleOneAndHalf); assertThat(multiBloomFilter.hasExpired(dtCycleOneAndHalf, 0), is(false)); assertThat(multiBloomFilter.hasExpired(dtCycleOneAndHalf, 1), is(false)); }
Source:
private Map<String, List<SingularityTaskId>> getInactiveTaskIdsByRequest() { final List<SingularityTaskId> taskIds = new ArrayList<>(taskManager.getAllTaskIds()); taskIds.removeAll(taskManager.getActiveTaskIds()); taskIds.removeAll(taskManager.getLBCleanupTasks()); List<SingularityPendingDeploy> pendingDeploys = deployManager.getPendingDeploys(); return taskIds.stream() .filter((taskId) -> !isPartOfPendingDeploy(pendingDeploys, taskId) && !couldReturnWithRecoveredAgent(taskId)) .sorted(SingularityTaskId.STARTED_AT_COMPARATOR_DESC) .collect(Collectors.groupingBy(SingularityTaskId::getRequestId)); }

Target:
private Map<String, List<SingularityTaskId>> getInactiveTaskIdsByRequest() { final Set<SingularityTaskId> taskIds = new HashSet<>(taskManager.getAllTaskIds()); taskIds.removeAll(taskManager.getActiveTaskIds()); taskIds.removeAll(taskManager.getLBCleanupTasks()); List<SingularityPendingDeploy> pendingDeploys = deployManager.getPendingDeploys(); return taskIds.stream() .filter((taskId) -> !isPartOfPendingDeploy(pendingDeploys, taskId) && !couldReturnWithRecoveredAgent(taskId)) .sorted(SingularityTaskId.STARTED_AT_COMPARATOR_DESC) .collect(Collectors.groupingBy(SingularityTaskId::getRequestId)); }
Source:
private static boolean noSpacingBetween(SyntaxToken firstToken, SyntaxToken secondToken) { return firstToken.column() + firstToken.text().length() == secondToken.column(); }

Target:
private static boolean noSpacingBetween(SyntaxToken firstToken, SyntaxToken secondToken) { return firstToken.line() == secondToken.line() && firstToken.column() + firstToken.text().length() == secondToken.column(); }
Source:
protected void executeCommand() { setVds(null); if (getVds() == null) { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it doesn't exist anymore.", getVdsName(), getVdsId()); getReturnValue().setSucceeded(false); return; } VdsValidator validator = new VdsValidator(getVds()); boolean shouldBeFenced = validator.shouldVdsBeFenced(); if (shouldBeFenced) { getParameters().setParentCommand(VdcActionType.VdsNotRespondingTreatment); ExecutionContext ec = (ExecutionContext) ObjectUtils.clone(this.getExecutionContext()); if (ec != null) { ec.setJob(this.getExecutionContext().getJob()); } super.executeCommand(); if (ec != null) { this.setExecutionContext(ec); } } else { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore.", getVdsName(), getVdsId()); } getReturnValue().setSucceeded(shouldBeFenced); }

Target:
protected void executeCommand() { setVds(null); if (getVds() == null) { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it doesn't exist anymore.", getVdsName(), getVdsId()); getReturnValue().setSucceeded(false); return; } VdsValidator validator = new VdsValidator(getVds()); boolean shouldBeFenced = validator.shouldVdsBeFenced(); if (shouldBeFenced) { getParameters().setParentCommand(VdcActionType.VdsNotRespondingTreatment); ExecutionContext ec = (ExecutionContext) ObjectUtils.clone(this.getExecutionContext()); if (ec != null) { ec.setJob(this.getExecutionContext().getJob()); super.executeCommand(); this.setExecutionContext(ec); } else { super.executeCommand(); } } else { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore.", getVdsName(), getVdsId()); } getReturnValue().setSucceeded(shouldBeFenced); }
Source:
private void checkVdsMemoryThreshold(VdsStatistics stat) { Integer minAvailableThreshold = Config.GetValue(ConfigValues.LogPhysicalMemoryThresholdInMB); Integer maxUsedPercentageThreshold = Config.GetValue(ConfigValues.LogMaxPhysicalMemoryUsedThresholdInPercentage); AuditLogType valueToLog = stat.getmem_available() < minAvailableThreshold ? AuditLogType.VDS_LOW_MEM : AuditLogType.VDS_HIGH_MEM_USE; if (stat.getmem_available() < minAvailableThreshold || stat.getusage_mem_percent() > maxUsedPercentageThreshold) { AuditLogableBase logable = new AuditLogableBase(stat.getId()); logable.AddCustomValue("HostName", _vds.getvds_name()); logable.AddCustomValue("AvailableMemory", stat.getmem_available().toString()); logable.AddCustomValue("UsedMemory", stat.getusage_mem_percent().toString()); logable.AddCustomValue("Threshold", stat.getmem_available() < minAvailableThreshold ? minAvailableThreshold.toString() : maxUsedPercentageThreshold.toString()); auditLog(logable, valueToLog); } }

Target:
private void checkVdsMemoryThreshold(VdsStatistics stat) { Integer minAvailableThreshold = Config.GetValue(ConfigValues.LogPhysicalMemoryThresholdInMB); Integer maxUsedPercentageThreshold = Config.GetValue(ConfigValues.LogMaxPhysicalMemoryUsedThresholdInPercentage); if (stat.getmem_available() == null) { return; } AuditLogType valueToLog = stat.getmem_available() < minAvailableThreshold ? AuditLogType.VDS_LOW_MEM : AuditLogType.VDS_HIGH_MEM_USE; if (stat.getmem_available() < minAvailableThreshold || stat.getusage_mem_percent() > maxUsedPercentageThreshold) { AuditLogableBase logable = new AuditLogableBase(stat.getId()); logable.AddCustomValue("HostName", _vds.getvds_name()); logable.AddCustomValue("AvailableMemory", stat.getmem_available().toString()); logable.AddCustomValue("UsedMemory", stat.getusage_mem_percent().toString()); logable.AddCustomValue("Threshold", stat.getmem_available() < minAvailableThreshold ? minAvailableThreshold.toString() : maxUsedPercentageThreshold.toString()); auditLog(logable, valueToLog); } }
Source:
public BlobSoftRef(String space, BaseEntityRef.OnDelete deleteHandler, boolean supportsURL) { super(space); this.deleteHandler = deleteHandler; this.supportsURL = supportsURL; }

Target:
public BlobSoftRef(String space, BaseEntityRef.OnDelete deleteHandler, boolean supportsURL) { super(space); if (BaseEntityRef.OnDelete.REJECT == deleteHandler) { throw new IllegalArgumentException("BlobSoftRef references do not accept REJECT as deleteHandler."); } this.deleteHandler = deleteHandler; this.supportsURL = supportsURL; }
Source:
boolean deregisterCompactorGauges(String storeId) { String prefix = storeId + SEPERATOR; return registry.remove(MetricRegistry.name(BlobStoreCompactor.class, prefix + "CompactionInProgress")); }

Target:
private boolean deregisterCompactorGauges(String storeId) { String prefix = storeId + SEPERATOR; return registry.remove(MetricRegistry.name(BlobStoreCompactor.class, prefix + "CompactionInProgress")); }