auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void doPutAssets(final KuraRequestPayload reqPayload, final KuraResponsePayload respPayload, final String[] resources) { this.findAssets(); final String assetPid = resources[1]; final String channelName = resources[2]; final Asset asset = this.assets.get(assetPid); final AssetConfiguration configuration = asset.getAssetConfiguration(); final Map<String, Channel> assetConfiguredChannels = configuration.getAssetChannels(); if (assetConfiguredChannels != null) { final String userValue = (String) reqPayload.getMetric("value"); final String userType = (String) reqPayload.getMetric("type"); ChannelRecord ChannelRecord = null; boolean flag = true; try { ChannelRecord = this.createWriteRecord(channelName, userValue, userType); } catch (final IllegalArgumentException e) { flag = false; ChannelRecord.setChannelStatus( new ChannelStatus(ChannelFlag.FAILURE, message.valueTypeConversionError(), e)); ChannelRecord.setTimestamp(System.currentTimeMillis()); } List<ChannelRecord> ChannelRecords = Arrays.asList(ChannelRecord); try { if (flag) { asset.write(ChannelRecords); } } catch (final KuraException e) { respPayload.addMetric(message.errorMessage(), message.connectionException()); } this.prepareResponse(respPayload, ChannelRecords); } }

Target:
private void doPutAssets(final KuraRequestPayload reqPayload, final KuraResponsePayload respPayload, final String[] resources) { this.findAssets(); final String assetPid = resources[1]; final String channelName = resources[2]; final Asset asset = this.assets.get(assetPid); final AssetConfiguration configuration = asset.getAssetConfiguration(); final Map<String, Channel> assetConfiguredChannels = configuration.getAssetChannels(); if (assetConfiguredChannels != null) { final String userValue = (String) reqPayload.getMetric("value"); final String userType = (String) reqPayload.getMetric("type"); ChannelRecord channelRecord = null; boolean flag = true; try { channelRecord = this.createWriteRecord(channelName, userValue, userType); } catch (final IllegalArgumentException e) { flag = false; channelRecord.setChannelStatus( new ChannelStatus(ChannelFlag.FAILURE, message.valueTypeConversionError(), e)); channelRecord.setTimestamp(System.currentTimeMillis()); } List<ChannelRecord> channelRecords = Arrays.asList(channelRecord); try { if (flag) { asset.write(channelRecords); } } catch (final KuraException e) { respPayload.addMetric(message.errorMessage(), message.connectionException()); } this.prepareResponse(respPayload, channelRecords); } }
Source:
InputFile.Status status(String projectKeyWithBranch, DefaultInputFile inputFile, String hash) { FileData fileDataPerPath = projectRepositories.fileData(projectKeyWithBranch, inputFile.relativePath()); if (fileDataPerPath == null) { return InputFile.Status.ADDED; } String previousHash = fileDataPerPath.hash(); if (StringUtils.equals(hash, previousHash)) { return InputFile.Status.SAME; } if (StringUtils.isEmpty(previousHash)) { return InputFile.Status.ADDED; } if (!scmChangedFiles.verifyChanged(inputFile.path())) { return InputFile.Status.SAME; } return InputFile.Status.CHANGED; }

Target:
InputFile.Status status(String projectKeyWithBranch, DefaultInputFile inputFile, String hash) { FileData fileDataPerPath = projectRepositories.fileData(projectKeyWithBranch, inputFile.relativePath()); if (fileDataPerPath == null) { return checkChanged(ADDED, inputFile); } String previousHash = fileDataPerPath.hash(); if (StringUtils.equals(hash, previousHash)) { return SAME; } if (StringUtils.isEmpty(previousHash)) { return checkChanged(ADDED, inputFile); } return checkChanged(CHANGED, inputFile); }
Source:
public boolean onboarded() { return thingIfApi.onboarded(); }

Target:
public boolean onboarded() { return this.thingIfApi.onboarded(); }
Source:
public static ModelRef modelRef(ResolvedType resolved, ModelContext modelContext, TypeNameExtractor nameExtractor) { if (isContainerType(resolved)) { ResolvedType collectionElementType = collectionElementType(resolved); String elementTypeName = nameExtractor.typeName(fromParent(modelContext, collectionElementType)); AllowableValues allowableValues = ResolvedTypes.allowableValues(resolved); return new ModelRef(containerType(resolved), elementTypeName, allowableValues); } if (isMapType(resolved)) { String elementTypeName = nameExtractor.typeName(fromParent(modelContext, mapValueType(resolved))); return new ModelRef("Map", elementTypeName, true); } if (Void.class.equals(resolved.getErasedType()) || Void.TYPE.equals(resolved.getErasedType())) { return new ModelRef("void"); } AllowableValues allowableValues = ResolvedTypes.allowableValues(resolved); String typeName = nameExtractor.typeName(fromParent(modelContext, resolved)); return new ModelRef(typeName, null, allowableValues); }

Target:
public static ModelRef modelRef(ResolvedType resolved, ModelContext modelContext, TypeNameExtractor nameExtractor) { if (isContainerType(resolved)) { ResolvedType collectionElementType = collectionElementType(resolved); String elementTypeName = nameExtractor.typeName(fromParent(modelContext, collectionElementType)); AllowableValues allowableValues = ResolvedTypes.allowableValues(resolved); return new ModelRef(containerType(resolved), elementTypeName, allowableValues); } if (isMapType(resolved)) { String elementTypeName = nameExtractor.typeName(fromParent(modelContext, mapValueType(resolved))); return new ModelRef("Map", elementTypeName, true); } if (Void.class.equals(resolved.getErasedType()) || Void.TYPE.equals(resolved.getErasedType())) { return new ModelRef("void"); } AllowableValues allowableValues = ResolvedTypes.allowableValues(resolved); String typeName = nameExtractor.typeName(fromParent(modelContext, resolved)); return new ModelRef(typeName, allowableValues); }
Source:
private IASTName getLastInQualified(IASTName name) { if (name instanceof ICPPASTQualifiedName) { name= name.getLastName(); } return name; }

Target:
private IASTName getLastInQualified(IASTName name) { return name.getLastName(); }
Source:
public GenericPartitioningSpiller( List<Type> types, PartitionFunction partitionFunction, SpillContext spillContext, AggregatedMemoryContext memoryContext, SingleStreamSpillerFactory spillerFactory) { requireNonNull(spillContext, "spillContext is null"); this.types = requireNonNull(types, "types is null"); this.partitionFunction = requireNonNull(partitionFunction, "partitionFunction is null"); requireNonNull(memoryContext, "memoryContext is null"); closer.register(memoryContext::close); Supplier<LocalMemoryContext> childMemoryContextSupplier = synchronizedMemoryContext(memoryContext)::newLocalMemoryContext; int partitionCount = partitionFunction.getPartitionCount(); this.spillers = new SingleStreamSpiller[partitionCount]; this.pageBuilders = new PageBuilder[partitionCount]; for (int partition = 0; partition < partitionCount; partition++) { pageBuilders[partition] = new PageBuilder(types); spillers[partition] = closer.register(spillerFactory.create(types, spillContext, childMemoryContextSupplier.get())); } }

Target:
public GenericPartitioningSpiller( List<Type> types, PartitionFunction partitionFunction, SpillContext spillContext, AggregatedMemoryContext memoryContext, SingleStreamSpillerFactory spillerFactory) { requireNonNull(spillContext, "spillContext is null"); this.types = ImmutableList.copyOf(requireNonNull(types, "types is null")); this.partitionFunction = requireNonNull(partitionFunction, "partitionFunction is null"); this.spillerFactory = requireNonNull(spillerFactory, "spillerFactory is null"); this.spillContext = closer.register(requireNonNull(spillContext, "spillContext is null")); requireNonNull(memoryContext, "memoryContext is null"); closer.register(memoryContext::close); this.memoryContext = synchronizedMemoryContext(memoryContext); int partitionCount = partitionFunction.getPartitionCount(); this.pageBuilders = new PageBuilder[partitionCount]; this.spillers = new Optional[partitionCount]; for (int partition = 0; partition < partitionCount; partition++) { pageBuilders[partition] = new PageBuilder(types); spillers[partition] = Optional.empty(); } }
Source:
public Card getCard() { _checkDay(); if (!mHaveQueues) { reset(); mNextCard = null; } Card card; if (mNextCard != null) { card = mNextCard; mNextCard = null; } else { card = _getCard(); } if (card != null) { mCol.log(card); mReps += 1; card.startTimer(); } backgroundNextCard(); return card; }

Target:
public Card getCard() { _checkDay(); if (!mHaveQueues) { reset(); } Card card = loadNextCard(false); mNextCard = null; if (card != null) { mCol.log(card); mReps += 1; decrementCounts(card); card.startTimer(); } CollectionTask.launchCollectionTask(CollectionTask.TASK_TYPE_PRE_LOAD_CARD); return card; }
Source:
public Long getPaymentWorksFieldMappingId() { return paymentWorksFieldMappingId; }

Target:
public long getPaymentWorksFieldMappingId() { return paymentWorksFieldMappingId; }
Source:
public void run() { progressMonitor.setIndeterminate(true); progressMonitor.setProgress(0); Case currentCase = Case.getCurrentCase(); String imageWriterPath = ""; if (imageWriterSettings != null) { imageWriterPath = imageWriterSettings.getPath(); } List<String> errorMessages = new ArrayList<>(); List<Content> newDataSources = new ArrayList<>(); try { currentCase.getSleuthkitCase().acquireSingleUserCaseWriteLock(); synchronized (tskAddImageProcessLock) { if (!tskAddImageProcessStopped) { tskAddImageProcess = currentCase.getSleuthkitCase().makeAddImageProcess(timeZone, true, ignoreFatOrphanFiles, imageWriterPath); } else { return; } } Thread progressUpdateThread = new Thread(new ProgressUpdater(progressMonitor, tskAddImageProcess)); progressUpdateThread.start(); runAddImageProcess(errorMessages); commitOrRevertAddImageProcess(currentCase, errorMessages, newDataSources); progressMonitor.setProgress(100); } finally { currentCase.getSleuthkitCase().releaseSingleUserCaseWriteLock(); DataSourceProcessorCallback.DataSourceProcessorResult result; if (criticalErrorOccurred) { result = DataSourceProcessorResult.CRITICAL_ERRORS; } else if (!errorMessages.isEmpty()) { result = DataSourceProcessorResult.NONCRITICAL_ERRORS; } else { result = DataSourceProcessorResult.NO_ERRORS; } callback.done(result, errorMessages, newDataSources); } }

Target:
public void run() { progressMonitor.setIndeterminate(true); progressMonitor.setProgress(0); Case currentCase = Case.getCurrentCase(); String imageWriterPath = ""; if (imageWriterSettings != null) { imageWriterPath = imageWriterSettings.getPath(); } List<String> errorMessages = new ArrayList<>(); List<Content> newDataSources = new ArrayList<>(); try { currentCase.getSleuthkitCase().acquireSingleUserCaseWriteLock(); synchronized (tskAddImageProcessLock) { if (!tskAddImageProcessStopped) { tskAddImageProcess = currentCase.getSleuthkitCase().makeAddImageProcess(timeZone, true, ignoreFatOrphanFiles, imageWriterPath); } else { return; } } Thread progressUpdateThread = new Thread(new ProgressUpdater(progressMonitor, tskAddImageProcess)); progressUpdateThread.start(); runAddImageProcess(errorMessages); progressUpdateThread.interrupt(); commitOrRevertAddImageProcess(currentCase, errorMessages, newDataSources); progressMonitor.setProgress(100); } finally { currentCase.getSleuthkitCase().releaseSingleUserCaseWriteLock(); DataSourceProcessorCallback.DataSourceProcessorResult result; if (criticalErrorOccurred) { result = DataSourceProcessorResult.CRITICAL_ERRORS; } else if (!errorMessages.isEmpty()) { result = DataSourceProcessorResult.NONCRITICAL_ERRORS; } else { result = DataSourceProcessorResult.NO_ERRORS; } callback.done(result, errorMessages, newDataSources); } }
Source:
public void startDetection(String container, MessageProcessor<LogMessage> containerLogProcessor) { if (needStartOOMDetector()) { if (cgroupMount == null) { LOG.warn("System doesn't support OOM events"); return; } try { final long memory = dockerConnector.inspectContainer(container).getConfig().getMemory(); final OOMDetector oomDetector = new OOMDetector(container, containerLogProcessor, memory); oomDetectors.put(container, oomDetector); oomDetector.start(); } catch (IOException e) { LOG.error(e.getLocalizedMessage(), e); } } }

Target:
public void startDetection(String container, MessageProcessor<LogMessage> containerLogProcessor) { if (needStartOOMDetector(container)) { if (cgroupMount == null) { LOG.warn("System doesn't support OOM events"); return; } try { final long memory = dockerConnector.inspectContainer(container).getConfig().getMemory(); OOMDetector oomDetector = new OOMDetector(container, containerLogProcessor, memory); oomDetectors.putIfAbsent(container, oomDetector); oomDetector = oomDetectors.get(container); oomDetector.start(); } catch (IOException e) { LOG.error(e.getLocalizedMessage(), e); } } }
Source:
public Response fault() { return Response.status(ParametersHelper.getIntegerParameter(httpHeaders, uriInfo, "code", 0, 0)).entity( fault(ParametersHelper.getParameter(httpHeaders, uriInfo, "reason"), ParametersHelper.getParameter(httpHeaders, uriInfo, "detail"))).build(); }

Target:
public Response fault() { int code = ParametersHelper.getIntegerParameter(httpHeaders, uriInfo, "code", 0, 0); String reason = ParametersHelper.getParameter(httpHeaders, uriInfo, "reason"); String detail = ParametersHelper.getParameter(httpHeaders, uriInfo, "detail"); return Response.status(code).entity(fault(reason, detail)).build(); }
Source:
public void push() throws Exception { HTTP2Client http2Client = new HTTP2Client(); http2Client.start(); SocketAddress serverAddress = new InetSocketAddress("localhost", 8080); CompletableFuture<Session> sessionCF = http2Client.connect(serverAddress, new Session.Listener.Adapter()); Session session = sessionCF.get(); HttpFields requestHeaders = HttpFields.build() .add(HttpHeader.USER_AGENT, "Jetty HTTP2Client {version}"); MetaData.Request request = new MetaData.Request("GET", HttpURI.from("http://localhost:8080/path"), HttpVersion.HTTP_2, requestHeaders); HeadersFrame headersFrame = new HeadersFrame(request, null, true); CompletableFuture<Stream> streamCF = session.newStream(headersFrame, new Stream.Listener.Adapter() { @Override public Stream.Listener onPush(Stream pushedStream, PushPromiseFrame frame) { MetaData.Request pushedRequest = frame.getMetaData(); HttpURI pushedURI = pushedRequest.getURI(); HttpFields pushedRequestHeaders = pushedRequest.getFields(); Stream primaryStream = pushedStream.getSession().getStream(frame.getStreamId()); return new Stream.Listener.Adapter() { @Override public void onHeaders(Stream stream, HeadersFrame frame) { MetaData metaData = frame.getMetaData(); if (metaData.isResponse()) { HttpFields pushedResponseHeaders = metaData.getFields(); } } @Override public void onData(Stream stream, DataFrame frame, Callback callback) { ByteBuffer buffer = frame.getData(); callback.succeeded(); } }; } }); }

Target:
public void push() throws Exception { HTTP2Client http2Client = new HTTP2Client(); http2Client.start(); SocketAddress serverAddress = new InetSocketAddress("localhost", 8080); CompletableFuture<Session> sessionCF = http2Client.connect(serverAddress, new Session.Listener.Adapter()); Session session = sessionCF.get(); HttpFields requestHeaders = HttpFields.build() .put(HttpHeader.USER_AGENT, "Jetty HTTP2Client {version}"); MetaData.Request request = new MetaData.Request("GET", HttpURI.from("http://localhost:8080/path"), HttpVersion.HTTP_2, requestHeaders); HeadersFrame headersFrame = new HeadersFrame(request, null, true); CompletableFuture<Stream> streamCF = session.newStream(headersFrame, new Stream.Listener.Adapter() { @Override public Stream.Listener onPush(Stream pushedStream, PushPromiseFrame frame) { MetaData.Request pushedRequest = frame.getMetaData(); HttpURI pushedURI = pushedRequest.getURI(); HttpFields pushedRequestHeaders = pushedRequest.getFields(); Stream primaryStream = pushedStream.getSession().getStream(frame.getStreamId()); return new Stream.Listener.Adapter() { @Override public void onHeaders(Stream stream, HeadersFrame frame) { MetaData metaData = frame.getMetaData(); if (metaData.isResponse()) { HttpFields pushedResponseHeaders = metaData.getFields(); } } @Override public void onData(Stream stream, DataFrame frame, Callback callback) { ByteBuffer buffer = frame.getData(); callback.succeeded(); } }; } }); }
Source:
public void generatedInterfaceHasInterfaceMethods() { Set<String> generatedMethods = TestingUtils.extractMethods(AutoDelegate_GenericsTester.class); Set<String> originalMethods = extractNonStaticMethods(GenericsTester.class); assertThat(generatedMethods, hasItems(originalMethods.toArray(new String[0]))); }

Target:
public void generatedInterfaceHasInterfaceMethods() { Set<String> generatedMethods = TestingUtils.extractMethods(AutoDelegate_GenericsTester.class); Set<String> originalMethods = TestingUtils.extractNonStaticMethods(GenericsTester.class); assertThat(generatedMethods).containsAll(originalMethods); }
Source:
private SingularityDeploy checkImmediateRunDeploy(SingularityRequest request, SingularityDeploy deploy, SingularityRunNowRequest runNowRequest, List<SingularityTaskId> activeTasks, List<SingularityPendingTaskId> pendingTasks) { if (!request.isScheduled() && !request.isOneOff()) { throw badRequest("Can not request an immediate run of a non-scheduled / always running request (%s)", request); } boolean canRunImmediately = (request.isScheduled() && activeTasks.isEmpty()) || (request.isOneOff() && ! request.getInstances().isPresent()) || (request.isOneOff() && request.getInstances().get() > activeTasks.size() + pendingTasks.size()); if (canRunImmediately) { return deploy.toBuilder() .setRunImmediately(Optional.of(fillRunNowRequest(Optional.of(runNowRequest)))) .build(); } else { return deploy.toBuilder() .setRunImmediately(Optional.absent()) .build(); } }

Target:
private SingularityDeploy checkImmediateRunDeploy(SingularityRequest request, SingularityDeploy deploy, SingularityRunNowRequest runNowRequest, List<SingularityTaskId> activeTasks, List<SingularityPendingTaskId> pendingTasks) { if (!request.isScheduled() && !request.isOneOff()) { throw badRequest("Can not request an immediate run of a non-scheduled / always running request (%s)", request); } return deploy.toBuilder() .setRunImmediately(Optional.of(fillRunNowRequest(Optional.of(runNowRequest)))) .build(); }
Source:
private Node alloc(byte[] labelBytes) { byte[] input = new byte[seedBytes.length+labelBytes.length]; System.arraycopy(seedBytes, 0, input, 0, seedBytes.length); System.arraycopy(labelBytes, 0, input, seedBytes.length, labelBytes.length); String hexString; if ( true ) { long[] x = MurmurHash3.hash128(input); char[] chars = new char[32]; longAsHexLC(x[0], chars, 0); longAsHexLC(x[1], chars, 16); hexString = new String(chars); } else { byte[] bytes = Hashing.murmur3_128(104729).hashBytes(input).asBytes(); hexString = Bytes.asHexLC(bytes); } return NodeFactory.createBlankNode(hexString); }

Target:
private Node alloc(byte[] labelBytes) { byte[] input = new byte[seedBytes.length+labelBytes.length]; System.arraycopy(seedBytes, 0, input, 0, seedBytes.length); System.arraycopy(labelBytes, 0, input, seedBytes.length, labelBytes.length); String hexString; if ( true ) { long[] x = MurmurHash3.hash128x64(input); char[] chars = new char[32]; longAsHexLC(x[0], chars, 0); longAsHexLC(x[1], chars, 16); hexString = new String(chars); } else { byte[] bytes = Hashing.murmur3_128(MurmurHash3.DEFAULT_SEED).hashBytes(input).asBytes(); hexString = Bytes.asHexLC(bytes); } return NodeFactory.createBlankNode(hexString); }
Source:
public String getMessage(MessageSourceResolvable resolvable, Locale locale) { if((resolvable.getCodes()[0]) == (activeMessageSource.getMessage(resolvable, locale))){ return (resolvable.getCodes()[(resolvable.getCodes().length) - 1]); } else{ return activeMessageSource.getMessage(resolvable, locale); } }

Target:
public String getMessage(MessageSourceResolvable resolvable, Locale locale) { if((resolvable.getCodes()[0]).equals((activeMessageSource.getMessage(resolvable, locale)))){ return (resolvable.getCodes()[(resolvable.getCodes().length) - 1]); } else{ return activeMessageSource.getMessage(resolvable, locale); } }
Source:
public void detectCancelEvent_noMoreReverts_detected() { FilterTextField field = getFirstPanelField(); AtomicInteger toggle = new AtomicInteger(0); field.setOnCancel(toggle::getAndIncrement); assertTrue(toggle.get() % 2 == 0); type("mile").push(KeyCode.TAB); push(KeyCode.ENTER); clearField(); type("test"); waitAndAssertEquals("test", field::getText); push(KeyCode.ESCAPE); waitAndAssertEquals(0, () -> toggle.get() % 2); push(KeyCode.ESCAPE); waitAndAssertEquals(1, () -> toggle.get() % 2); clearField(); }

Target:
public void detectCancelEvent_noMoreReverts_detected() { FilterTextField field = getFirstPanelField(); AtomicInteger toggle = new AtomicInteger(0); field.setOnCancel(toggle::getAndIncrement); assertTrue(toggle.get() % 2 == 0); type("mile").push(KeyCode.TAB); push(KeyCode.ENTER); clearField(); type("test"); waitAndAssertEquals("test", field::getText); push(KeyCode.ESCAPE); waitAndAssertEquals(0, () -> toggle.get() % 2); push(KeyCode.ESCAPE); waitAndAssertEquals(1, () -> toggle.get() % 2); }
Source:
public String getProvides() { return (String) context.get(ExtensionProperties.PROVIDES); }

Target:
public List<String> getProvides() { List<String> providers = new ArrayList<>(); for (String provider : ((String) context.get(ExtensionProperties.PROVIDES)).split(",")) { providers.add(provider.trim()); } return providers; }
Source:
public QueryBuilder make(EsHint hint, String fieldName, Object value) { String[] indexFields = hint.getIndexFieldNames(); String[] fields = indexFields.length > 0 ? indexFields : new String[] { fieldName }; MoreLikeThisQueryBuilder moreLikeThisBuilder = QueryBuilders.moreLikeThisQuery(fields, null, getItems(value)); if (hint.analyzer != null) { moreLikeThisBuilder.analyzer(hint.analyzer); } moreLikeThisBuilder.minDocFreq(MORE_LIKE_THIS_MIN_DOC_FREQ); moreLikeThisBuilder.minTermFreq(MORE_LIKE_THIS_MIN_TERM_FREQ); moreLikeThisBuilder.maxQueryTerms(MORE_LIKE_THIS_MAX_QUERY_TERMS); return moreLikeThisBuilder; }

Target:
public QueryBuilder make(EsHint hint, String fieldName, Object value) { String[] indexFields = hint.getIndexFieldNames(); String[] fields = indexFields.length > 0 ? indexFields : new String[] { fieldName }; return QueryBuilders.moreLikeThisQuery(fields, null, getItems(value)) .analyzer(hint.analyzer) .minDocFreq(MORE_LIKE_THIS_MIN_DOC_FREQ) .minTermFreq(MORE_LIKE_THIS_MIN_TERM_FREQ) .maxQueryTerms(MORE_LIKE_THIS_MAX_QUERY_TERMS); }
Source:
private File createTempReactorProject(Server server) throws MojoFailureException, MojoExecutionException { File tempFolder = new File(server.getServerDirectory(), "temp-project"); if (!tempFolder.exists()) { tempFolder.mkdir(); } Model tempModel = createModel(); Set<Project> watchedModules = server.getWatchedProjects(); for(Project module: watchedModules){ Path newLink = Paths.get(new File(tempFolder, module.getArtifactId()).getAbsolutePath()); Path existingfile = Paths.get(module.getPath()); try { Files.createSymbolicLink(newLink, existingfile); tempModel.addModule(module.getArtifactId()); } catch (IOException e) { throw new RuntimeException("Couldn't create link", e); } catch (UnsupportedOperationException e) { throw new RuntimeException("Couldn't create link due to unsupported file system", e); } } try { Writer writer = new FileWriter(new File(tempFolder, "pom.xml")); new MavenXpp3Writer().write(writer, tempModel); } catch (IOException e) { throw new RuntimeException("Failed to write pom.xml", e); } return tempFolder; }

Target:
private File createTempReactorProject(Server server) throws MojoFailureException, MojoExecutionException { File tempFolder = new File(server.getServerDirectory(), "temp-project"); if (!tempFolder.exists()) { tempFolder.mkdir(); } Model tempModel = createModel(); Set<Project> watchedModules = server.getWatchedProjects(); for(Project module: watchedModules){ Path newLink = Paths.get(new File(tempFolder, module.getArtifactId()).getAbsolutePath()); Path existingfile = Paths.get(module.getPath()); try { Files.createSymbolicLink(newLink, existingfile); } catch (IOException e) { copyModuleToTempServer(module.getPath(), newLink.toString()); } finally { tempModel.addModule(module.getArtifactId()); } } try { Writer writer = new FileWriter(new File(tempFolder, "pom.xml")); new MavenXpp3Writer().write(writer, tempModel); } catch (IOException e) { throw new RuntimeException("Failed to write pom.xml", e); } return tempFolder; }
Source:
public Properties getCacheProperties() { Properties props = new Properties(); props.setProperty("cachMode", this.cacheMode.name()); synchronized(connectionMonitor) { props.setProperty("channelCacheSize", Integer.toString(this.channelCacheSize)); if (this.cacheMode.equals(CacheMode.CONNECTION)) { props.setProperty("connectionCacheSize", Integer.toString(this.connectionCacheSize)); props.setProperty("openConnections", Integer.toString(this.openConnections.size())); props.setProperty("idleConnections", Integer.toString(this.idleConnections.size())); int n = 0; for (Entry<ChannelCachingConnectionProxy, LinkedList<ChannelProxy>> entry : this.openConnectionTransactionalChannels.entrySet()) { int port = entry.getKey().getLocalPort(); if (port == 0) { port = ++n; } props.put("idleChannelsTx:" + port, Integer.valueOf(entry.getValue().size())); } for (Entry<ChannelCachingConnectionProxy, LinkedList<ChannelProxy>> entry : this.openConnectionNonTransactionalChannels.entrySet()) { int port = entry.getKey().getLocalPort(); if (port == 0) { port = ++n; } props.put("idleChannelsNotTx:" + port, Integer.valueOf(entry.getValue().size())); } } else { props.setProperty("localPort", Integer.toString(this.connection == null ? 0 : this.connection.getLocalPort())); props.setProperty("idleChannelsTx", Integer.toString(cachedChannelsTransactional.size())); props.setProperty("idleChannelsNotTx", Integer.toString(cachedChannelsNonTransactional.size())); } } return props; }

Target:
public Properties getCacheProperties() { Properties props = new Properties(); props.setProperty("cacheMode", this.cacheMode.name()); synchronized(connectionMonitor) { props.setProperty("channelCacheSize", Integer.toString(this.channelCacheSize)); if (this.cacheMode.equals(CacheMode.CONNECTION)) { props.setProperty("connectionCacheSize", Integer.toString(this.connectionCacheSize)); props.setProperty("openConnections", Integer.toString(this.openConnections.size())); props.setProperty("idleConnections", Integer.toString(this.idleConnections.size())); int n = 0; for (Entry<ChannelCachingConnectionProxy, LinkedList<ChannelProxy>> entry : this.openConnectionTransactionalChannels.entrySet()) { int port = entry.getKey().getLocalPort(); if (port == 0) { port = ++n; } props.put("idleChannelsTx:" + port, entry.getValue().size()); } for (Entry<ChannelCachingConnectionProxy, LinkedList<ChannelProxy>> entry : this.openConnectionNonTransactionalChannels.entrySet()) { int port = entry.getKey().getLocalPort(); if (port == 0) { port = ++n; } props.put("idleChannelsNotTx:" + port, entry.getValue().size()); } } else { props.setProperty("localPort", Integer.toString(this.connection == null ? 0 : this.connection.getLocalPort())); props.setProperty("idleChannelsTx", Integer.toString(this.cachedChannelsTransactional.size())); props.setProperty("idleChannelsNotTx", Integer.toString(this.cachedChannelsNonTransactional.size())); } } return props; }
Source:
private void logPromotionCommitFailure(PartitionReplica destination, Collection<MigrationInfo> migrations, Throwable t) { boolean memberLeft = t instanceof MemberLeftException || t.getCause() instanceof TargetNotMemberException || t.getCause() instanceof HazelcastInstanceNotActiveException; int migrationsSize = migrations.size(); if (memberLeft) { if (node.getThisAddress().equals(destination.address())) { logger.fine("Promotion commit failed for " + migrationsSize + " migrations" + " since this node is shutting down."); return; } if (logger.isFinestEnabled()) { logger.warning("Promotion commit failed for " + migrations + " since destination " + destination + " left the cluster"); } else { logger.warning("Promotion commit failed for " + (migrationsSize == 1 ? migrations.iterator().next() : migrationsSize + " migrations") + " since destination " + destination + " left the cluster"); } return; } if (logger.isFinestEnabled()) { logger.severe("Promotion commit to " + destination + " failed for " + migrations, t); } else { logger.severe("Promotion commit to " + destination + " failed for " + (migrationsSize == 1 ? migrations.iterator().next() : migrationsSize + " migrations"), t); } }

Target:
private void logPromotionCommitFailure(PartitionReplica destination, Collection<MigrationInfo> migrations, Throwable t) { boolean memberLeft = t instanceof MemberLeftException || t.getCause() instanceof TargetNotMemberException || t.getCause() instanceof HazelcastInstanceNotActiveException; int migrationsSize = migrations.size(); if (memberLeft) { if (destination.isIdentical(node.getLocalMember())) { logger.fine("Promotion commit failed for " + migrationsSize + " migrations" + " since this node is shutting down."); return; } if (logger.isFinestEnabled()) { logger.warning("Promotion commit failed for " + migrations + " since destination " + destination + " left the cluster"); } else { logger.warning("Promotion commit failed for " + (migrationsSize == 1 ? migrations.iterator().next() : migrationsSize + " migrations") + " since destination " + destination + " left the cluster"); } return; } if (logger.isFinestEnabled()) { logger.severe("Promotion commit to " + destination + " failed for " + migrations, t); } else { logger.severe("Promotion commit to " + destination + " failed for " + (migrationsSize == 1 ? migrations.iterator().next() : migrationsSize + " migrations"), t); } }
Source:
public void updateConsumerApplication(OAuthConsumerAppDTO consumerAppDTO) throws IdentityOAuthAdminException { String userName = CarbonContext.getThreadLocalCarbonContext().getUsername(); String tenantAwareUsername = MultitenantUtils.getTenantAwareUsername(userName); int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); OAuthAppDAO dao = new OAuthAppDAO(); OAuthAppDO oauthappdo = new OAuthAppDO(); oauthappdo.setUserName(tenantAwareUsername); oauthappdo.setTenantId(tenantId); oauthappdo.setUserDomain(UserCoreUtil.extractDomainFromName(userName)); oauthappdo.setOauthConsumerKey(consumerAppDTO.getOauthConsumerKey()); oauthappdo.setOauthConsumerSecret(consumerAppDTO.getOauthConsumerSecret()); oauthappdo.setCallbackUrl(consumerAppDTO.getCallbackUrl()); oauthappdo.setApplicationName(consumerAppDTO.getApplicationName()); if (OAuthConstants.OAuthVersions.VERSION_2.equals(consumerAppDTO.getOAuthVersion())) { List<String> allowedGrants = new ArrayList<>(Arrays.asList(getAllowedGrantTypes())); String[] requestGrants = consumerAppDTO.getGrantTypes().split("\\s"); for (String requestedGrant : requestGrants) { if ("".equals(requestedGrant.trim())) { continue; } if (!allowedGrants.contains(requestedGrant)) { throw new IdentityOAuthAdminException(requestedGrant + " not allowed"); } } oauthappdo.setGrantTypes(consumerAppDTO.getGrantTypes()); } dao.updateConsumerApplication(oauthappdo); if (OAuthServerConfiguration.getInstance().isCacheEnabled()) { appInfoCache.addToCache(oauthappdo.getOauthConsumerKey(), oauthappdo); } }

Target:
public void updateConsumerApplication(OAuthConsumerAppDTO consumerAppDTO) throws IdentityOAuthAdminException { String userName = CarbonContext.getThreadLocalCarbonContext().getUsername(); String tenantAwareUsername = MultitenantUtils.getTenantAwareUsername(userName); int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); OAuthAppDAO dao = new OAuthAppDAO(); OAuthAppDO oauthappdo = new OAuthAppDO(); oauthappdo.setUserName(UserCoreUtil.removeDomainFromName(tenantAwareUsername)); oauthappdo.setTenantId(tenantId); oauthappdo.setUserDomain(IdentityUtil.extractDomainFromName(userName)); oauthappdo.setOauthConsumerKey(consumerAppDTO.getOauthConsumerKey()); oauthappdo.setOauthConsumerSecret(consumerAppDTO.getOauthConsumerSecret()); oauthappdo.setCallbackUrl(consumerAppDTO.getCallbackUrl()); oauthappdo.setApplicationName(consumerAppDTO.getApplicationName()); if (OAuthConstants.OAuthVersions.VERSION_2.equals(consumerAppDTO.getOAuthVersion())) { List<String> allowedGrants = new ArrayList<>(Arrays.asList(getAllowedGrantTypes())); String[] requestGrants = consumerAppDTO.getGrantTypes().split("\\s"); for (String requestedGrant : requestGrants) { if ("".equals(requestedGrant.trim())) { continue; } if (!allowedGrants.contains(requestedGrant)) { throw new IdentityOAuthAdminException(requestedGrant + " not allowed"); } } oauthappdo.setGrantTypes(consumerAppDTO.getGrantTypes()); } dao.updateConsumerApplication(oauthappdo); if (OAuthServerConfiguration.getInstance().isCacheEnabled()) { appInfoCache.addToCache(oauthappdo.getOauthConsumerKey(), oauthappdo); } }
Source:
public PhysicalOperation visitStatisticsWriterNode(StatisticsWriterNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); StatisticAggregationsDescriptor<Integer> descriptor = node.getDescriptor().map(symbol -> source.getLayout().get(symbol)); OperatorFactory operatorFactory = new StatisticsWriterOperatorFactory( context.getNextOperatorId(), node.getId(), computedStatistics -> metadata.finishAnalysis(session, ((StatisticsWriterNode.WriteStatisticsHandle) node.getTarget()).getHandle(), computedStatistics), node.isRowCountEnabled(), descriptor); Map<Symbol, Integer> layout = ImmutableMap.of(getOnlyElement(node.getOutputSymbols()), 0); return new PhysicalOperation(operatorFactory, layout, context, source); }

Target:
public PhysicalOperation visitStatisticsWriterNode(StatisticsWriterNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); StatisticAggregationsDescriptor<Integer> descriptor = node.getDescriptor().map(symbol -> source.getLayout().get(symbol)); OperatorFactory operatorFactory = new StatisticsWriterOperatorFactory( context.getNextOperatorId(), node.getId(), computedStatistics -> metadata.finishStatisticsCollection(session, ((StatisticsWriterNode.WriteStatisticsHandle) node.getTarget()).getHandle(), computedStatistics), node.isRowCountEnabled(), descriptor); return new PhysicalOperation(operatorFactory, makeLayout(node), context, source); }
Source:
public void testNameValidation() throws IOException { String diskStoreName = "diskStoreName"; CommandStringBuilder csb = new CommandStringBuilder(CliStrings.ALTER_DISK_STORE); csb.addOption(CliStrings.ALTER_DISK_STORE__DISKSTORENAME, diskStoreName); csb.addOption(CliStrings.ALTER_DISK_STORE__REGIONNAME, "regionName"); csb.addOption(CliStrings.ALTER_DISK_STORE__DISKDIRS, tempDir.getRoot().toString()); csb.addOption(CliStrings.ALTER_DISK_STORE__CONCURRENCY__LEVEL, "5"); String commandString = csb.toString(); gfsh.executeAndAssertThat(command, commandString).statusIsError() .containsOutput( "The init file " + tempDir.getRoot().toString() + File.separator + "BACKUP" + diskStoreName + DiskInitFile.IF_FILE_EXT + " does not exist."); }

Target:
public void testNameValidation() { String diskStoreName = "diskStoreName"; CommandStringBuilder csb = new CommandStringBuilder(CliStrings.ALTER_DISK_STORE); csb.addOption(CliStrings.ALTER_DISK_STORE__DISKSTORENAME, diskStoreName); csb.addOption(CliStrings.ALTER_DISK_STORE__REGIONNAME, "regionName"); csb.addOption(CliStrings.ALTER_DISK_STORE__DISKDIRS, tempDir.getRoot().toString()); csb.addOption(CliStrings.ALTER_DISK_STORE__CONCURRENCY__LEVEL, "5"); String commandString = csb.toString(); gfsh.executeAndAssertThat(command, commandString).statusIsError() .containsOutput( "The init file " + tempDir.getRoot().toString() + File.separator + "BACKUP" + diskStoreName + DiskInitFile.IF_FILE_EXT + " does not exist."); }
Source:
public void finish() { if (fXAggregator != null) { fSeries.stream().map(s -> s.getXConsumer()).forEach(checkNotNull(fXAggregator)::accept); } if (fYAggregator != null) { fSeries.stream().map(s -> s.getYConsumer()).forEach(checkNotNull(fYAggregator)::accept); } }

Target:
public void finish() { IConsumerAggregator aggregator = fXAggregator; if (aggregator != null) { fSeries.stream().map(s -> s.getXConsumer()).forEach(aggregator::accept); } aggregator = fYAggregator; if (aggregator != null) { fSeries.stream().map(s -> s.getYConsumer()).forEach(aggregator::accept); } }
Source:
protected void autonomousMain() throws AutonomousModeOverException, InterruptedException { done.set(false); Elevator.lowering.set(true); Elevator.raising.set(false); waitUntil(Elevator.bottomLimitSwitch); Rollers.open.set(true); Rollers.direction.set(false); Rollers.running.set(true); waitUntil(BooleanMixing.invert(crateInPosition)); waitForTime(timeout); Rollers.running.set(false); done.set(true); }

Target:
protected void autonomousMain() throws AutonomousModeOverException, InterruptedException { try { done.set(false); Elevator.lowering.set(true); Elevator.raising.set(false); waitUntil(Elevator.bottomLimitSwitch); Rollers.open.set(true); Rollers.direction.set(false); Rollers.running.set(true); waitUntil(BooleanMixing.invert(crateInPosition)); waitForTime(timeout); Rollers.running.set(false); } finally { done.set(true); } }
Source:
private List<MongoCredential> buildCredentials(Iterable<String> userPasses) { ImmutableList.Builder<MongoCredential> builder = ImmutableList.builder(); for (String userPassCollection : userPasses) { int lastIndex = userPassCollection.lastIndexOf('@'); checkArgument(lastIndex > 0, "Invalid Credential format. Requires user:password@collection"); String userPass = userPassCollection.substring(0, lastIndex); String collection = userPassCollection.substring(lastIndex + 1); int firstIndex = userPass.indexOf(':'); checkArgument(firstIndex > 0, "Invalid Credential format. Requires user:password@collection"); String user = userPass.substring(0, firstIndex); String password = userPass.substring(firstIndex + 1); builder.add(createCredential(user, collection, password.toCharArray())); } return builder.build(); }

Target:
private List<MongoCredential> buildCredentials(Iterable<String> userPasses) { ImmutableList.Builder<MongoCredential> builder = ImmutableList.builder(); for (String userPass : userPasses) { int atPos = userPass.lastIndexOf('@'); checkArgument(atPos > 0, "Invalid credential format. Required user:password@collection"); String userAndPassword = userPass.substring(0, atPos); String collection = userPass.substring(atPos + 1); int colonPos = userAndPassword.indexOf(':'); checkArgument(colonPos > 0, "Invalid credential format. Required user:password@collection"); String user = userAndPassword.substring(0, colonPos); String password = userAndPassword.substring(colonPos + 1); builder.add(createCredential(user, collection, password.toCharArray())); } return builder.build(); }
Source:
public static void runExample(String title) { try { XResultData rd = new XResultData(); rd.log("This is just a normal log message"); rd.logWarning("This is a warning"); rd.logError("This is an error"); rd.log("\n\nExample of hyperlinked hrid: " + getHyperlink(UserManager.getUser())); rd.log("Example of hyperlinked artifact different hyperlink string: " + getHyperlink("Different string", UserManager.getUser())); rd.log("Example of hyperlinked hrid on another branch: " + getHyperlink(UserManager.getUser().getGuid(), UserManager.getUser().getGuid(), BranchManager.getCommonBranch().getId())); rd.addRaw(AHTML.newline()); rd.addRaw("Example of hyperlink that opens external browser " + getHyperlinkUrlExternal("Google", "<LINK_0>") + AHTML.newline()); rd.addRaw("Example of hyperlink that opens internal browser " + getHyperlinkUrlInternal("Google", "<LINK_0>") + AHTML.newline()); rd.log("\n\nHere is a nice table"); rd.addRaw(AHTML.beginMultiColumnTable(95, 1)); rd.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "Title", "Status"})); for (int x = 0; x < 3; x++) { rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {"Type " + x, "Title " + x, x + ""})); } rd.addRaw(AHTML.addRowMultiColumnTable(new String[] { "Error / Warning in table ", "Error: this is error", "Warning: this is warning"})); rd.addRaw(AHTML.endMultiColumnTable()); report(rd, "This is my report title"); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }

Target:
public static void runExample(String title) { try { XResultData rd = new XResultData(); rd.log("This is just a normal log message"); rd.logWarning("This is a warning"); rd.logError("This is an error"); rd.log("\n\nExample of hyperlinked guid: " + getHyperlink(UserManager.getUser())); rd.log("Example of hyperlinked artifact different hyperlink string: " + getHyperlink("Different string", UserManager.getUser())); rd.log("Example of hyperlinked guid on another branch: " + getHyperlink(UserManager.getUser().getGuid(), UserManager.getUser().getGuid(), BranchManager.getCommonBranch().getId())); rd.addRaw(AHTML.newline()); rd.addRaw("Example of hyperlink that opens external browser " + getHyperlinkUrlExternal("Google", "<LINK_0>") + AHTML.newline()); rd.addRaw("Example of hyperlink that opens internal browser " + getHyperlinkUrlInternal("Google", "<LINK_0>") + AHTML.newline()); rd.log("\n\nHere is a nice table"); rd.addRaw(AHTML.beginMultiColumnTable(95, 1)); rd.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "Title", "Status"})); for (int x = 0; x < 3; x++) { rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {"Type " + x, "Title " + x, x + ""})); } rd.addRaw(AHTML.addRowMultiColumnTable(new String[] { "Error / Warning in table ", "Error: this is error", "Warning: this is warning"})); rd.addRaw(AHTML.endMultiColumnTable()); report(rd, "This is my report title"); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }
Source:
public EntryTypeViewModel(JabRefPreferences preferences, BasePanel basePanel, DialogService dialogService) { this.basePanel = basePanel; this.prefs = preferences; this.dialogService = dialogService; fetchers.addAll(WebFetchers.getIdBasedFetchers(preferences.getImportFormatPreferences())); selectedItemProperty.setValue(getLastSelectedFetcher()); Predicate<String> notEmpty = input -> (input != null) && !input.trim().isEmpty(); idFieldValidator = new FunctionBasedValidator<>(idText, notEmpty, ValidationMessage.error(Localization.lang("Required field \"%0\" is empty.", Localization.lang("ID")))); }

Target:
public EntryTypeViewModel(JabRefPreferences preferences, BasePanel basePanel, DialogService dialogService) { this.basePanel = basePanel; this.prefs = preferences; this.dialogService = dialogService; fetchers.addAll(WebFetchers.getIdBasedFetchers(preferences.getImportFormatPreferences())); selectedItemProperty.setValue(getLastSelectedFetcher()); idFieldValidator = new FunctionBasedValidator<>(idText, StringUtil::isNotBlank, ValidationMessage.error(Localization.lang("Required field \"%0\" is empty.", Localization.lang("ID")))); }
Source:
public void accept(Event<SetPasswordRequest> setPasswordRequestEvent) { SetPasswordRequest request = setPasswordRequestEvent.getData(); LOGGER.info("SetPasswordHandler accepting request {}", request); try { Stack stack = stackService.getStackById(request.getResourceId()); MDCBuilder.buildMdcContext(stack); FreeIpaClient freeIpaClient = freeIpaClientFactory.getFreeIpaClientForStack(stack); if (FreeIpaCapabilities.hasSetPasswordHashSupport(freeIpaClient.getConfig())) { WorkloadCredential workloadCredential = umsCredentialProvider.getCredentials(request.getUserCrn(), MDCUtils.getRequestId()); LOGGER.info("IPA has password hash support. Credentials information from UMS will be used."); workloadCredentialService.setWorkloadCredential(freeIpaClient, request.getUsername(), workloadCredential); if (workloadCredential.getHashedPassword().isBlank()) { LOGGER.info("IPA has password hash support but user does not have a password set in UMS; using the provided password directly."); freeIpaClient.userSetPasswordWithExpiration( request.getUsername(), request.getPassword(), request.getExpirationInstant()); } } else { LOGGER.info("IPA does not have password hash support; using the provided password directly."); freeIpaClient.userSetPasswordWithExpiration( request.getUsername(), request.getPassword(), request.getExpirationInstant()); } SetPasswordResult result = new SetPasswordResult(request); request.getResult().onNext(result); } catch (Exception e) { request.getResult().onError(e); } }

Target:
public void accept(Event<SetPasswordRequest> setPasswordRequestEvent) { SetPasswordRequest request = setPasswordRequestEvent.getData(); LOGGER.info("SetPasswordHandler accepting request {}", request); try { Stack stack = stackService.getStackById(request.getResourceId()); MDCBuilder.buildMdcContext(stack); FreeIpaClient freeIpaClient = freeIpaClientFactory.getFreeIpaClientForStack(stack); if (FreeIpaCapabilities.hasSetPasswordHashSupport(freeIpaClient.getConfig())) { WorkloadCredential workloadCredential = umsCredentialProvider.getCredentials(request.getUserCrn(), MDCUtils.getRequestId()); LOGGER.info("IPA has password hash support. Credentials information from UMS will be used."); workloadCredentialService.setWorkloadCredential(freeIpaClient, request.getUsername(), workloadCredential); if (StringUtils.isBlank(workloadCredential.getHashedPassword())) { LOGGER.info("IPA has password hash support but user does not have a password set in UMS; using the provided password directly."); freeIpaClient.userSetPasswordWithExpiration( request.getUsername(), request.getPassword(), request.getExpirationInstant()); } } else { LOGGER.info("IPA does not have password hash support; using the provided password directly."); freeIpaClient.userSetPasswordWithExpiration( request.getUsername(), request.getPassword(), request.getExpirationInstant()); } SetPasswordResult result = new SetPasswordResult(request); request.getResult().onNext(result); } catch (Exception e) { request.getResult().onError(e); } }
Source:
public void removeJobInfo(JobInfo info) { Job job = info.getJob(); jobs.remove(job); runnableMonitors.remove(job); Object[] listenersArray = listeners.getListeners(); for (Object element : listenersArray) { IJobProgressManagerListener listener = (IJobProgressManagerListener) element; if (!isCurrentDisplaying(info.getJob(), listener.showsDebug())) { listener.removeJob(info); } } }

Target:
public void removeJobInfo(JobInfo info) { Job job = info.getJob(); jobs.remove(job); runnableMonitors.remove(job); for (Object element : listeners.getListeners()) { IJobProgressManagerListener listener = (IJobProgressManagerListener) element; if (!isCurrentDisplaying(info.getJob(), listener.showsDebug())) { listener.removeJob(info); } } }
Source:
public void modify(Path path, byte[] data, Consumer<Long> progressConsumer) { FileWrapper file = getPath(path); ProgressConsumer<Long> pc = l -> progressConsumer.accept(l); file.overwriteFileJS(AsyncReader.build(data), 0, data.length, userContext.network, userContext.crypto, pc).join(); }

Target:
public void modify(Path path, byte[] data, Consumer<Long> progressConsumer) { FileWrapper file = getPath(path); file.overwriteFileJS(AsyncReader.build(data), 0, data.length, userContext.network, userContext.crypto, l -> progressConsumer.accept(l)).join(); }
Source:
private void initDateBox() { dateBox = new DateBox(); dateBox.getDatePicker().addStyleName("dateBoxPopup"); dateBox.setWidth(dateRequired ? "90px" : "0px"); dateBox.setFormat(new DateBox.DefaultFormat(DateTimeFormat.getFormat("dd-MMM-yyyy"))); dateBox.addValueChangeHandler(new ValueChangeHandler<Date>() { @Override public void onValueChange(ValueChangeEvent<Date> event) { selectedDate = event.getValue(); setSelectedDate(); } }); }

Target:
private void initDateBox() { dateBox = new DateBox(); dateBox.getDatePicker().addStyleName("dateBoxPopup"); dateBox.setStyleName(dateRequired ? "dateBoxWidth" : "dateBoxShrink"); dateBox.setFormat(new DateBox.DefaultFormat(dateFormat)); dateBox.addValueChangeHandler(new ValueChangeHandler<Date>() { @Override public void onValueChange(ValueChangeEvent<Date> event) { selectedDate = event.getValue(); setSelectedDate(); } }); }