auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void updateNodeReports(List<NodeReport> nodeReports) { for (NodeReport nr : nodeReports) { StringBuilder sb = new StringBuilder(); sb.append("rackName=").append(nr.getRackName()).append(",nodeid=").append(nr.getNodeId()).append(",numContainers=").append(nr.getNumContainers()).append(",capability=").append(nr.getCapability()).append("used=").append(nr.getUsed()).append("state=").append(nr.getNodeState()); LOG.debug("Node report: " + sb); nodeReportMap.put(nr.getNodeId().getHost(), nr); nodeToRack.put(nr.getNodeId().getHost(), nr.getRackName()); } }

Target:
public void updateNodeReports(List<NodeReport> nodeReports) { for (NodeReport nr : nodeReports) { LOG.debug("Node report: rackName={}, nodeid={}, numContainers={}, capability={}, used={}, state={}", nr.getRackName(), nr.getNodeId(), nr.getNumContainers(), nr.getCapability(), nr.getUsed(), nr.getNodeState()); nodeReportMap.put(nr.getNodeId().getHost(), nr); nodeToRack.put(nr.getNodeId().getHost(), nr.getRackName()); } }
Source:
public List<String> getSuggestedNames(String queryString, int maxResults) throws GeoEntryQueryException { Map<String, Serializable> suggestProps = new HashMap<>(); suggestProps.put(SUGGESTION_REQUEST_KEY, queryString); Query suggestionQuery = new QueryImpl(filterBuilder.attribute(Core.TITLE).text(queryString)); QueryRequest suggestionRequest = new QueryRequestImpl(suggestionQuery, suggestProps); try { QueryResponse suggestionResponse = catalogFramework.query(suggestionRequest); Map<String, List<Suggestion>> suggestionMap = (Map<String, List<Suggestion>>) suggestionResponse.getPropertyValue(SUGGESTION_RESULT_KEY); if (suggestionMap != null) { List<Suggestion> suggestions = suggestionMap .values() .stream() .flatMap(List::stream) .limit(maxResults) .collect(Collectors.toList()); } } catch (SourceUnavailableException | FederationException | UnsupportedQueryException e) { LOGGER.debug("Suggestion query failed", e); } return Collections.emptyList(); }

Target:
public List<String> getSuggestedNames(String queryString, int maxResults) throws GeoEntryQueryException { Map<String, Serializable> suggestProps = new HashMap<>(); suggestProps.put(SUGGESTION_QUERY_KEY, queryString); suggestProps.put(SUGGESTION_CONTEXT_KEY, GAZETTEER_METACARD_TAG); suggestProps.put(SUGGESTION_DICT_KEY, SUGGEST_PLACE_KEY); Query suggestionQuery = new QueryImpl(filterBuilder.attribute(Core.TITLE).text(queryString)); QueryRequest suggestionRequest = new QueryRequestImpl(suggestionQuery, suggestProps); try { QueryResponse suggestionResponse = catalogFramework.query(suggestionRequest); if (suggestionResponse.getPropertyValue(SUGGESTION_RESULT_KEY) instanceof List) { List<String> suggestions = (List<String>) suggestionResponse.getPropertyValue(SUGGESTION_RESULT_KEY); return suggestions.subList(0, Math.min(suggestions.size(), maxResults)); } } catch (SourceUnavailableException | FederationException | UnsupportedQueryException e) { throw new GeoEntryQueryException("Failed to execute suggestion query", e); } return Collections.emptyList(); }
Source:
public void shouldAllowManyLabelsAndPropertyCursor() throws Exception { int propertyCount = 10; int labelCount = 15; GraphDatabaseAPI db = dbRule.getGraphDatabaseAPI(); Node node; try ( Transaction tx = db.beginTx() ) { node = db.createNode(); for ( int i = 0; i < propertyCount; i++ ) { node.setProperty( "foo" + i, "bar" ); } for ( int i = 0; i < labelCount; i++ ) { node.addLabel( label( "label" + i ) ); } tx.success(); } Set<Integer> seenProperties = new HashSet<>(); Set<Integer> seenLabels = new HashSet<>(); try ( Transaction tx = db.beginTx() ) { DependencyResolver resolver = db.getDependencyResolver(); ThreadToStatementContextBridge bridge = resolver.resolveDependency( ThreadToStatementContextBridge.class ); KernelTransaction ktx = bridge.getKernelTransactionBoundToThisThread( true ); try ( NodeCursor nodes = ktx.cursors().allocateNodeCursor(); PropertyCursor propertyCursor = ktx.cursors().allocatePropertyCursor() ) { while ( nodes.next() ) { nodes.properties( propertyCursor ); while ( propertyCursor.next() ) { seenProperties.add( propertyCursor.propertyKey() ); } LabelSet labels = nodes.labels(); for ( int i = 0; i < labels.numberOfLabels(); i++ ) { seenLabels.add( labels.label( i ) ); } } } tx.success(); } assertEquals( propertyCount, seenProperties.size() ); assertEquals( labelCount, seenLabels.size() ); }

Target:
public void shouldAllowManyLabelsAndPropertyCursor() throws Exception { int propertyCount = 10; int labelCount = 15; GraphDatabaseAPI db = dbRule.getGraphDatabaseAPI(); Node node; try ( Transaction tx = db.beginTx() ) { node = db.createNode(); for ( int i = 0; i < propertyCount; i++ ) { node.setProperty( "foo" + i, "bar" ); } for ( int i = 0; i < labelCount; i++ ) { node.addLabel( label( "label" + i ) ); } tx.success(); } Set<Integer> seenProperties = new HashSet<>(); Set<Integer> seenLabels = new HashSet<>(); try ( Transaction tx = db.beginTx() ) { DependencyResolver resolver = db.getDependencyResolver(); ThreadToStatementContextBridge bridge = resolver.resolveDependency( ThreadToStatementContextBridge.class ); KernelTransaction ktx = bridge.getKernelTransactionBoundToThisThread( true ); try ( NodeCursor nodes = ktx.cursors().allocateNodeCursor(); PropertyCursor propertyCursor = ktx.cursors().allocatePropertyCursor() ) { ktx.dataRead().singleNode( node.getId(), nodes ); while ( nodes.next() ) { nodes.properties( propertyCursor ); while ( propertyCursor.next() ) { seenProperties.add( propertyCursor.propertyKey() ); } LabelSet labels = nodes.labels(); for ( int i = 0; i < labels.numberOfLabels(); i++ ) { seenLabels.add( labels.label( i ) ); } } } tx.success(); } assertEquals( propertyCount, seenProperties.size() ); assertEquals( labelCount, seenLabels.size() ); }
Source:
public WorldRendererImpl(Context context, GLBufferPool bufferPool) { this.context = context; this.worldProvider = context.get(WorldProvider.class); this.backdropProvider = context.get(BackdropProvider.class); this.renderingConfig = context.get(Config.class).getRendering(); this.shaderManager = context.get(ShaderManager.class); vrProvider = OpenVRProvider.getInstance(); if (renderingConfig.isVrSupport()) { context.put(OpenVRProvider.class, vrProvider); if (vrProvider.init()) { playerCamera = new OpenVRStereoCamera(vrProvider); vrProvider.getState().setGroundPlaneYOffset(-0.80f - context.get(Config.class).getPlayer().getEyeHeight()); currentRenderingStage = RenderingStage.LEFT_EYE; } else { playerCamera = new PerspectiveCamera(renderingConfig.getCameraSettings()); currentRenderingStage = RenderingStage.MONO; } } else { playerCamera = new PerspectiveCamera(renderingConfig.getCameraSettings()); currentRenderingStage = RenderingStage.MONO; } LocalPlayerSystem localPlayerSystem = context.get(LocalPlayerSystem.class); localPlayerSystem.setPlayerCamera(playerCamera); renderableWorld = new RenderableWorldImpl(worldProvider, context.get(ChunkProvider.class), bufferPool, playerCamera); renderQueues = renderableWorld.getRenderQueues(); initRenderingSupport(); }

Target:
public WorldRendererImpl(Context context, GLBufferPool bufferPool) { this.context = context; this.worldProvider = context.get(WorldProvider.class); this.backdropProvider = context.get(BackdropProvider.class); this.renderingConfig = context.get(Config.class).getRendering(); this.shaderManager = context.get(ShaderManager.class); vrProvider = OpenVRProvider.getInstance(); if (renderingConfig.isVrSupport()) { context.put(OpenVRProvider.class, vrProvider); if (vrProvider.init()) { playerCamera = new OpenVRStereoCamera(vrProvider, worldProvider, renderingConfig); vrProvider.getState().setGroundPlaneYOffset( GROUND_PLANE_HEIGHT_DISPARITY - context.get(Config.class).getPlayer().getEyeHeight()); currentRenderingStage = RenderingStage.LEFT_EYE; } else { playerCamera = new PerspectiveCamera(worldProvider, renderingConfig); currentRenderingStage = RenderingStage.MONO; } } else { playerCamera = new PerspectiveCamera(worldProvider, renderingConfig); currentRenderingStage = RenderingStage.MONO; } LocalPlayerSystem localPlayerSystem = context.get(LocalPlayerSystem.class); localPlayerSystem.setPlayerCamera(playerCamera); renderableWorld = new RenderableWorldImpl(worldProvider, context.get(ChunkProvider.class), bufferPool, playerCamera); renderQueues = renderableWorld.getRenderQueues(); initRenderingSupport(); }
Source:
protected static byte[] doGetActualCek(byte[] theCek, String algoJwt) { int size = AesCbcContentEncryptionAlgorithm.getFullCekKeySize(algoJwt) / 2; byte[] actualCek = new byte[size]; System.arraycopy(theCek, 0, actualCek, 0, size); return actualCek; }

Target:
protected static byte[] doGetActualCek(byte[] theCek, String algoJwt) { int inputKeySize = AesCbcContentEncryptionAlgorithm.getFullCekKeySize(algoJwt); if (theCek.length != inputKeySize) { LOG.warning("Length input key [" + theCek.length + "] invalid for algorithm " + algoJwt + " [" + inputKeySize + "]"); throw new JweException(Error.INVALID_CONTENT_KEY); } int secondaryKeySize = inputKeySize / 2; byte[] encKey = new byte[secondaryKeySize]; System.arraycopy(theCek, secondaryKeySize, encKey, 0, secondaryKeySize); return encKey; }
Source:
private void generateGcodeMenuItemActionPerformed( java.awt.event.ActionEvent evg ) { String jobname = getJobName(); List<String> warnings = new LinkedList<String>(); final Map<LaserProfile, List<LaserProperty>> cuttingSettings = this.getPropertyMapForCurrentJob(); if (cuttingSettings == null) { return; } ProgressListener pl = new ProgressListener() { public void progressChanged(Object o, int i) { MainView.this.progressBar.setValue(i); MainView.this.progressBar.repaint(); } public void taskChanged(Object o, String string) { MainView.this.progressBar.setString(string); } }; try { MainView.this.visicutModel1 .saveJob(jobname, pl, cuttingSettings, warnings); } catch (IllegalJobException e1) { } catch( Exception e3 ) { } }

Target:
private void generateGcodeMenuItemActionPerformed( java.awt.event.ActionEvent evg ) { String jobname = getJobName(); List<String> warnings = new LinkedList<String>(); final Map<LaserProfile, List<LaserProperty>> cuttingSettings = this.getPropertyMapForCurrentJob(); if (cuttingSettings == null) { return; } ProgressListener pl = new ProgressListener() { public void progressChanged(Object o, int i) { MainView.this.progressBar.setValue(i); MainView.this.progressBar.repaint(); } public void taskChanged(Object o, String string) { MainView.this.progressBar.setString(string); } }; try { JFileChooser fileChooser = new JFileChooser(); int userreturn = fileChooser.showOpenDialog(this); if( userreturn == JFileChooser.APPROVE_OPTION) { File selectedFile = fileChooser.getSelectedFile(); System.out.println( "selected " + selectedFile.getAbsolutePath() ); MainView.this.visicutModel1 .saveJob(jobname, selectedFile, pl, cuttingSettings, warnings); } } catch (IllegalJobException e1) { } catch( Exception e3 ) { } }
Source:
protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() { from("direct:start") .to("log:edu.si.ctingest?level=DEBUG&showHeaders=true") .to("extractor:extract?location=target/TestCameraTrapData") .to("log:edu.si.ctingest?level=DEBUG&showHeaders=true") .to("mock:result"); } }; }

Target:
protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() { from("direct:start") .to("log:edu.si.ctingest?level=DEBUG&showAll=true&multiline=true&maxChars=100000") .to("extractor:extract?location={{target.dir}}{{file.separator}}TestCameraTrapData") .to("log:edu.si.ctingest?level=DEBUG&showHeaders=true") .to("mock:result"); } }; }
Source:
public Object evaluateLiteralExpression(String rawExpression, String className, List<String> genericClasses) { Object expressionResult = compileAndExecute(rawExpression, Collections.emptyMap()); Class<Object> requiredClass = loadClass(className, classLoader); if (expressionResult != null && !requiredClass.isAssignableFrom(expressionResult.getClass())) { throw new IllegalArgumentException("Cannot assign a '" + expressionResult.getClass().getCanonicalName() + "' to '" + requiredClass.getCanonicalName()); } return expressionResult; }

Target:
public Object evaluateLiteralExpression(String rawExpression, String className, List<String> genericClasses) { Object expressionResult = compileAndExecute(rawExpression, Collections.emptyMap()); Class<Object> requiredClass = loadClass(className, classLoader); if (expressionResult != null && !requiredClass.isAssignableFrom(expressionResult.getClass())) { throw new IllegalArgumentException("Cannot assign a '" + expressionResult.getClass().getCanonicalName() + "' to '" + requiredClass.getCanonicalName() + "'"); } return expressionResult; }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { RepositorySearchWizard wizard = new RepositorySearchWizard( util.getConfiguredRepositories(), false); WizardDialog dialog = new WizardDialog(getShell(event), wizard); if (dialog.open() == Window.OK) { for (String dir : wizard.getDirectories()) { File repositoryDir = FileUtils.canonicalize(new File(dir)); addRepository(repositoryDir); } } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { RepositorySearchWizard wizard = new RepositorySearchWizard( util.getConfiguredRepositories(), true); WizardDialog dialog = new WizardDialog(getShell(event), wizard); if (dialog.open() == Window.OK) { for (String dir : wizard.getDirectories()) { File repositoryDir = FileUtils.canonicalize(new File(dir)); addRepository(repositoryDir); } } return null; }
Source:
public void testKnownInvalidConstructors() { try { @SuppressWarnings("unused") QuantityType dt5 = new QuantityType("2°"); fail(); } catch (Exception e) { } try { @SuppressWarnings("unused") QuantityType dt0 = new QuantityType("52°31′27″"); fail(); } catch (Exception e) { } }

Target:
public void testKnownInvalidConstructors() throws Exception { new QuantityType<>("123 Hello World"); }
Source:
private static boolean isLambdaParameter(DetailAST ast) { DetailAST parent; for (parent = ast.getParent(); parent != null; parent = parent.getParent()) { if (parent.getType() == TokenTypes.LAMBDA) { break; } } final boolean returnValue; if (parent == null) { returnValue = false; } else if (ast.getType() == TokenTypes.PARAMETER_DEF) { returnValue = true; } else { final DetailAST lambdaParameters = parent.findFirstToken(TokenTypes.PARAMETERS); if (lambdaParameters == null) { returnValue = parent.getFirstChild().getText().equals(ast.getText()); } else { returnValue = TokenUtils.findFirstTokenByPredicate(lambdaParameters, paramDef -> { final DetailAST param = paramDef.findFirstToken(TokenTypes.IDENT); return param != null && param.getText().equals(ast.getText()); }).isPresent(); } } return returnValue; }

Target:
private static boolean isLambdaParameter(DetailAST ast) { DetailAST parent; for (parent = ast.getParent(); parent != null; parent = parent.getParent()) { if (parent.getType() == TokenTypes.LAMBDA) { break; } } final boolean isLambdaParameter; if (parent == null) { isLambdaParameter = false; } else if (ast.getType() == TokenTypes.PARAMETER_DEF) { isLambdaParameter = true; } else { final DetailAST lambdaParameters = parent.findFirstToken(TokenTypes.PARAMETERS); if (lambdaParameters == null) { isLambdaParameter = parent.getFirstChild().getText().equals(ast.getText()); } else { isLambdaParameter = TokenUtils.findFirstTokenByPredicate(lambdaParameters, paramDef -> { final DetailAST param = paramDef.findFirstToken(TokenTypes.IDENT); return param != null && param.getText().equals(ast.getText()); }).isPresent(); } } return isLambdaParameter; }
Source:
public void handle(HttpExchange t) throws IOException { if (RemoteUtil.deny(t)) { throw new IOException("Access denied"); } String id = RemoteUtil.getId("thumb/", t); LOGGER.trace("web thumb req " + id); if (id.contains("logo")) { RemoteUtil.sendLogo(t); return; } RootFolder root = parent.getRoot(RemoteUtil.userName(t), t); if (root == null) { LOGGER.debug("weird root in thumb req"); throw new IOException("Unknown root"); } final DLNAResource r = root.getDLNAResource(id, root.getDefaultRenderer()); if (r == null) { LOGGER.debug("media unknown"); throw new IOException("Bad id"); } InputStream in; if (!configuration.isShowCodeThumbs() && !r.isCodeValid(r)) { in = r.getGenericThumbnailInputStream(null); } else { r.checkThumbnail(); in = r.getThumbnailInputStream(); } in = ImagesUtil.convertImage(in, ImageFormat.JPEG); Headers hdr = t.getResponseHeaders(); hdr.add("Content-Type", HTTPResource.JPEG_TYPEMIME); hdr.add("Accept-Ranges", "bytes"); hdr.add("Connection", "keep-alive"); t.sendResponseHeaders(200, in.available()); OutputStream os = t.getResponseBody(); LOGGER.trace("input is output is {}", in, os); RemoteUtil.dump(in, os); }

Target:
public void handle(HttpExchange t) throws IOException { if (RemoteUtil.deny(t)) { throw new IOException("Access denied"); } String id = RemoteUtil.getId("thumb/", t); LOGGER.trace("web thumb req " + id); if (id.contains("logo")) { RemoteUtil.sendLogo(t); return; } RootFolder root = parent.getRoot(RemoteUtil.userName(t), t); if (root == null) { LOGGER.debug("weird root in thumb req"); throw new IOException("Unknown root"); } final DLNAResource r = root.getDLNAResource(id, root.getDefaultRenderer()); if (r == null) { LOGGER.debug("media unknown"); throw new IOException("Bad id"); } DLNAThumbnailInputStream in; if (!configuration.isShowCodeThumbs() && !r.isCodeValid(r)) { in = r.getGenericThumbnailInputStream(null); } else { r.checkThumbnail(); in = r.fetchThumbnailInputStream(); } if (r instanceof RealFile && FullyPlayed.isFullyPlayedThumbnail(((RealFile) r).getFile())) { in = FullyPlayed.addFullyPlayedOverlay(in); } Headers hdr = t.getResponseHeaders(); hdr.add("Content-Type", ImageFormat.PNG.equals(in.getFormat()) ? HTTPResource.PNG_TYPEMIME : HTTPResource.JPEG_TYPEMIME); hdr.add("Accept-Ranges", "bytes"); hdr.add("Connection", "keep-alive"); t.sendResponseHeaders(200, in.getSize()); OutputStream os = t.getResponseBody(); LOGGER.trace("Web thumbnail: Input is output is {}", in, os); RemoteUtil.dump(in, os); }
Source:
public List<Client> find(final Clients clients, final WebContext context, final String clientNames) { final List<Client> result = new ArrayList<>(); for (final Client client : clients.findAllClients()) { if (client instanceof IndirectClient) { final IndirectClient indirectClient = (IndirectClient) client; indirectClient.init(); if (indirectClient.getCallbackUrlResolver().matches(indirectClient.getName(), context)) { result.add(indirectClient); } } } if (result.size() == 0 && CommonHelper.isNotBlank(clientNames)) { result.add(clients.findClient(clientNames)); } return result; }

Target:
public List<Client> find(final Clients clients, final WebContext context, final String clientNames) { final List<Client> result = new ArrayList<>(); for (final Client client : clients.findAllClients()) { if (client instanceof IndirectClient) { final IndirectClient indirectClient = (IndirectClient) client; indirectClient.init(); if (indirectClient.getCallbackUrlResolver().matches(indirectClient.getName(), context)) { result.add(indirectClient); } } } if (result.isEmpty() && CommonHelper.isNotBlank(clientNames)) { result.add(clients.findClient(clientNames)); } return result; }
Source:
public Map<String, Integer> getDevices() throws CoreException { if (sdkLocation == null) { sdkLocation = WPCore.getSDKLocation(); if (sdkLocation == null) { return null; } } File deployCmd = getDeployCommand(); StringBuilder cmdLine = new StringBuilder(); cmdLine.append(deployCmd.getAbsolutePath()); cmdLine.append(" /EnumerateDevices"); ExternalProcessUtility processUtility = new ExternalProcessUtility(); DeviceListParser parser = new DeviceListParser(); processUtility.execSync(cmdLine.toString(), null, parser, parser, monitor, null, null); return parser.parseDevices(); }

Target:
public Map<String, Integer> getDevices() throws CoreException { if (sdkLocation == null) { sdkLocation = WPCore.getSDKLocation(); if (sdkLocation == null) { return null; } } File deployCmd = getDeployCommand(); StringBuilder cmdLine = new StringBuilder(); cmdLine.append(addQuotes(deployCmd.getAbsolutePath())); cmdLine.append(" /EnumerateDevices"); ExternalProcessUtility processUtility = new ExternalProcessUtility(); DeviceListParser parser = new DeviceListParser(); processUtility.execSync(cmdLine.toString(), null, parser, parser, monitor, null, null); return parser.parseDevices(); }
Source:
public void shouldRunIndexPopulationJobAtShutdown() throws Throwable { IndexPopulator populator = mock( IndexPopulator.class ); SchemaIndexProvider provider = mock( SchemaIndexProvider.class ); when( provider.getProviderDescriptor() ).thenReturn( InMemoryIndexProviderFactory.PROVIDER_DESCRIPTOR ); when( provider.getPopulator( anyLong(), any( IndexDescriptor.class ), any( IndexConfiguration.class ), any( IndexSamplingConfig.class ) ) ).thenReturn( populator ); BatchInserter inserter = newBatchInserterWithSchemaIndexProvider( singleInstanceSchemaIndexProviderFactory( InMemoryIndexProviderFactory.KEY, provider ) ); inserter.createDeferredSchemaIndex( label( "Hacker" ) ).on( "handle" ).create(); long nodeId = inserter.createNode( map( "handle", "Jakewins" ), label( "Hacker" ) ); inserter.shutdown(); verify( provider ).init(); verify( provider ).start(); verify( provider ).getPopulator( anyLong(), any( IndexDescriptor.class ), any( IndexConfiguration.class ), any( IndexSamplingConfig.class ) ); verify( populator ).create(); verify( populator ).add( singletonList( IndexEntryUpdate.add( nodeId, any(), "Jakewins" ) ) ); verify( populator ).verifyDeferredConstraints( any( PropertyAccessor.class ) ); verify( populator ).close( true ); verify( provider ).stop(); verify( provider ).shutdown(); verifyNoMoreInteractions( populator ); }

Target:
public void shouldRunIndexPopulationJobAtShutdown() throws Throwable { IndexPopulator populator = mock( IndexPopulator.class ); SchemaIndexProvider provider = mock( SchemaIndexProvider.class ); when( provider.getProviderDescriptor() ).thenReturn( InMemoryIndexProviderFactory.PROVIDER_DESCRIPTOR ); when( provider.getPopulator( anyLong(), any( IndexDescriptor.class ), any( IndexConfiguration.class ), any( IndexSamplingConfig.class ) ) ).thenReturn( populator ); BatchInserter inserter = newBatchInserterWithSchemaIndexProvider( singleInstanceSchemaIndexProviderFactory( InMemoryIndexProviderFactory.KEY, provider ) ); inserter.createDeferredSchemaIndex( label( "Hacker" ) ).on( "handle" ).create(); long nodeId = inserter.createNode( map( "handle", "Jakewins" ), label( "Hacker" ) ); inserter.shutdown(); verify( provider ).init(); verify( provider ).start(); verify( provider ).getPopulator( anyLong(), any( IndexDescriptor.class ), any( IndexConfiguration.class ), any( IndexSamplingConfig.class ) ); verify( populator ).create(); verify( populator ).add( singletonList( IndexEntryUpdate.add( nodeId, internalIndex, "Jakewins" ) ) ); verify( populator ).verifyDeferredConstraints( any( PropertyAccessor.class ) ); verify( populator ).close( true ); verify( provider ).stop(); verify( provider ).shutdown(); verifyNoMoreInteractions( populator ); }
Source:
private void deleteBeforeRebuild(Connection conn) throws SQLException, IOException { if (MetaDataUtil.isViewIndex(pIndexTable.getPhysicalName().getString())) { throw new IllegalArgumentException(String.format( " %s is a view index table. Delete all before rebuild is not supported for view indexes", indexTable)); } if (isLocalIndexBuild) { throw new IllegalArgumentException(String.format( " %s is a local index. Delete all before rebuild is not supported for local indexes", indexTable)); } else { Admin admin = null; ConnectionQueryServices queryServices = conn.unwrap(PhoenixConnection.class).getQueryServices(); try { admin = queryServices.getAdmin(); TableName tableName = TableName.valueOf(qIndexTable); admin.disableTable(tableName); admin.truncateTable(tableName, false); } finally { if (admin != null) { admin.close(); } } } }

Target:
private void deleteBeforeRebuild(Connection conn) throws SQLException, IOException { if (MetaDataUtil.isViewIndex(pIndexTable.getPhysicalName().getString())) { throw new IllegalArgumentException(String.format( "%s is a view index. delete-all-and-rebuild is not supported for view indexes", indexTable)); } if (isLocalIndexBuild) { throw new IllegalArgumentException(String.format( "%s is a local index. delete-all-and-rebuild is not supported for local indexes", indexTable)); } else { ConnectionQueryServices queryServices = conn.unwrap(PhoenixConnection.class).getQueryServices(); try (Admin admin = queryServices.getAdmin()){ TableName tableName = TableName.valueOf(qIndexTable); admin.disableTable(tableName); admin.truncateTable(tableName, true); } } }
Source:
public void initialize() { GatewayConfig configuration = getConfigAs(GatewayConfig.class); if (Strings.isNullOrEmpty(configuration.host)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Host must be specified in the configuration!"); return; } if (Strings.isNullOrEmpty(configuration.code)) { if(Strings.isNullOrEmpty(configuration.username) || Strings.isNullOrEmpty(configuration.userkey)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Security code must be provided in the configuration when initializing for first time!"); return; } } else { configuration = getUsernameAndKey(configuration); } if(Strings.isNullOrEmpty(configuration.username) || Strings.isNullOrEmpty(configuration.userkey)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Obtaining username and key failed!"); return; } this.gatewayURI = "coaps://" + configuration.host + ":" + configuration.port + "/" + DEVICES; this.gatewayInfoURI = "coaps://" + configuration.host + ":" + configuration.port + "/" + GATEWAY + "/" + GATEWAY_DETAILS; try { URI uri = new URI(gatewayURI); deviceClient = new TradfriCoapClient(uri); } catch (URISyntaxException e) { logger.debug("Illegal gateway URI `{}`: {}", gatewayURI, e.getMessage()); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); return; } DtlsConnectorConfig.Builder builder = new DtlsConnectorConfig.Builder(new InetSocketAddress(0)); builder.setPskStore(new StaticPskStore(configuration.username, configuration.userkey.getBytes())); dtlsConnector = new DTLSConnector(builder.build()); endPoint = new CoapEndpoint(dtlsConnector, NetworkConfig.getStandard()); endPoint.setExecutor(Executors.newSingleThreadScheduledExecutor(new Utils.DaemonThreadFactory())); deviceClient.setEndpoint(endPoint); updateStatus(ThingStatus.UNKNOWN); scanJob = scheduler.scheduleWithFixedDelay(() -> { startScan(); }, 0, 1, TimeUnit.MINUTES); }

Target:
public void initialize() { TradfriGatewayConfig configuration = getConfigAs(TradfriGatewayConfig.class); if (isNullOrEmpty(configuration.host)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Host must be specified in the configuration!"); return; } if (isNullOrEmpty(configuration.code)) { if (isNullOrEmpty(configuration.identity) || isNullOrEmpty(configuration.preSharedKey)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Either security code or identity and pre-shared key must be provided in the configuration!"); return; } else { setupCoapClient(); } } else { if (isOldFirmware()) { logger.warn("Gateway with old firmware - please consider upgrading to the latest version."); Configuration editedConfig = editConfiguration(); editedConfig.put(TradfriBindingConstants.GATEWAY_CONFIG_IDENTITY, ""); editedConfig.put(TradfriBindingConstants.GATEWAY_CONFIG_PRE_SHARED_KEY, configuration.code); updateConfiguration(editedConfig); setupCoapClient(); } else { scheduler.execute(this::obtainIdentityAndPreSharedKey); } } }
Source:
public void junit_rule_error_collector() { errorCollector.checkThat("123", equalTo("123")); }

Target:
public void junit_rule_error_collector() { errorCollector.checkThat("123", org.hamcrest.CoreMatchers.equalTo("123")); }
Source:
public Set<ConnectorPlanOptimizer> getLogicalPlanOptimizers() { return ImmutableSet.of(filterPushdownOptimizer); }

Target:
public Set<ConnectorPlanOptimizer> getLogicalPlanOptimizers() { return planOptimizers; }
Source:
private String processTransformation(String transformation, String response) { String transformedResponse = response; if (transformation == null) { return transformedResponse; } try { String[] parts = splitTransformationConfig(transformation); String transformationType = parts[0]; String transformationFunction = parts[1]; TransformationService transformationService = TransformationHelper .getTransformationService(SmarthomaticActivator.getContext(), transformationType); if (transformationService != null) { transformedResponse = transformationService.transform(transformationFunction, response); } else { transformedResponse = response; logger.warn("couldn't transform response because transformationService of type '{}' is unavailable", transformationType); } } catch (TransformationException te) { logger.error("transformation throws exception [transformation=" + transformation + ", response=" + response + "]", te); transformedResponse = response; } logger.debug("transformed response is '{}'", transformedResponse); return transformedResponse; }

Target:
private String processTransformation(String transformation, String response) { String transformedResponse = response; if (transformation == null) { return transformedResponse; } try { String[] parts = splitTransformationConfig(transformation); String transformationType = parts[0]; String transformationFunction = parts[1]; TransformationService transformationService = TransformationHelper .getTransformationService(SmarthomaticActivator.getContext(), transformationType); if (transformationService != null) { transformedResponse = transformationService.transform(transformationFunction, response); } else { transformedResponse = response; logger.warn("couldn't transform response because transformationService of type '{}' is unavailable", transformationType); } } catch (TransformationException te) { logger.error("transformation throws exception [transformation= {}, response= {}]", transformation, response); logger.error("received transformation exception", te); transformedResponse = response; } logger.debug("transformed response is '{}'", transformedResponse); return transformedResponse; }
Source:
private WritableMap serializeEventData() { WritableArray barcodesList = Arguments.createArray(); for (int i = 0; i < mBarcodes.size(); i++) { Barcode barcode = mBarcodes.valueAt(i); WritableMap serializedBarcode = Arguments.createMap(); serializedBarcode.putString("data", barcode.displayValue); serializedBarcode.putString("rawValue", barcode.rawValue); serializedBarcode.putString("type", BarcodeFormatUtils.get(barcode.format)); barcodesList.pushMap(serializedBarcode); } WritableMap event = Arguments.createMap(); event.putString("type", "barcode"); event.putArray("barcodes", barcodesList); event.putInt("target", getViewTag()); return event; }

Target:
private WritableMap serializeEventData() { WritableArray barcodesList = Arguments.createArray(); for (int i = 0; i < mBarcodes.size(); i++) { Barcode barcode = mBarcodes.valueAt(i); WritableMap serializedBarcode = Arguments.createMap(); serializedBarcode.putString("data", barcode.displayValue); serializedBarcode.putString("rawData", barcode.rawValue); serializedBarcode.putString("type", BarcodeFormatUtils.get(barcode.format)); barcodesList.pushMap(serializedBarcode); } WritableMap event = Arguments.createMap(); event.putString("type", "barcode"); event.putArray("barcodes", barcodesList); event.putInt("target", getViewTag()); return event; }
Source:
public TeamInviteToken inviteMember(Long teamId, String username) { User user = userService.getUserByUsername(username).orElseThrow(() -> new UsernameNotFoundException(username)); Team team = getTeamById(teamId); List<TeamInviteToken> currentTeamInvites = teamInviteTokenRepository.findByUserUsername(username).stream() .filter(token -> token.getTeam().equals(team)).collect(Collectors.toList()); if (!team.getMembers().contains(user) && currentTeamInvites.isEmpty()) { String token = UUID.randomUUID().toString(); TeamInviteToken inviteToken = new TeamInviteToken(token, user, team); teamInviteTokenRepository.save(inviteToken); try { mailService.sendTeamInviteMail(user, team.getTeamName(), team.getCaptain()); } catch (MessagingException e) { e.printStackTrace(); } return inviteToken; } else { throw new IllegalArgumentException("User is already a member of this team or already invited"); } }

Target:
public TeamInviteToken inviteMember(Long teamId, String username) { User user = userService.getUserByUsername(username).orElseThrow(() -> new UsernameNotFoundException(username)); Team team = getTeamById(teamId); Optional<TeamInviteToken> optionalInvite = teamInviteTokenRepository.findByUserUsername(username).stream(). filter(token -> token.getTeam().equals(team)).findFirst(); if (!team.getMembers().contains(user) && !optionalInvite.isPresent()) { String token = UUID.randomUUID().toString(); TeamInviteToken inviteToken = new TeamInviteToken(token, user, team); teamInviteTokenRepository.save(inviteToken); try { mailService.sendTeamInviteMail(user, team.getTeamName(), team.getCaptain()); } catch (MessagingException e) { e.printStackTrace(); } return inviteToken; } else { throw new IllegalArgumentException("User is already a member of this team or already invited"); } }
Source:
public static synchronized void addToCache(AttestationValue value){ if (!attestationValues.containsKey(value.getHostName())) attestationValues.putIfAbsent(value.getHostName(), value); }

Target:
public void addToCache(AttestationValue value) { attestationValues.putIfAbsent(value.getHostName(), value); }
Source:
String extractDate(final String value) { return value.substring(0, 10); }

Target:
String extractDate(final String value) { return value.substring(0, DATE_LENGTH); }
Source:
BufferedLogChannel getCurrentLogForLedgerForAddEntry(long ledgerId, int entrySize, boolean rollLog) throws IOException { Lock lock = getLock(ledgerId); lock.lock(); try { BufferedLogChannelWithDirInfo logChannelWithDirInfo = getCurrentLogWithDirInfoForLedger(ledgerId); BufferedLogChannel logChannel = null; if (logChannelWithDirInfo != null) { logChannel = logChannelWithDirInfo.getLogChannel(); } boolean reachEntryLogLimit = rollLog ? reachEntryLogLimit(logChannel, entrySize) : readEntryLogHardLimit(logChannel, entrySize); boolean diskFull = (logChannel == null) ? false : logChannelWithDirInfo.isLedgerDirFull(); boolean allDisksFull = !ledgerDirsManager.hasWritableLedgerDirs(); if ((diskFull && (!allDisksFull)) || reachEntryLogLimit || (logChannel == null)) { if (logChannel != null) { logChannel.flushAndForceWriteIfRegularFlush(false); } createNewLog(ledgerId, ": diskFull = " + diskFull + ", allDisksFull = " + allDisksFull + ", reachEntryLogLimit = " + reachEntryLogLimit); } return getCurrentLogForLedger(ledgerId); } finally { lock.unlock(); } }

Target:
BufferedLogChannel getCurrentLogForLedgerForAddEntry(long ledgerId, int entrySize, boolean rollLog) throws IOException { Lock lock = getLock(ledgerId); lock.lock(); try { BufferedLogChannelWithDirInfo logChannelWithDirInfo = getCurrentLogWithDirInfoForLedger(ledgerId); BufferedLogChannel logChannel = null; if (logChannelWithDirInfo != null) { logChannel = logChannelWithDirInfo.getLogChannel(); } boolean reachEntryLogLimit = rollLog ? reachEntryLogLimit(logChannel, entrySize) : readEntryLogHardLimit(logChannel, entrySize); boolean diskFull = (logChannel == null) ? false : logChannelWithDirInfo.isLedgerDirFull(); boolean allDisksFull = !ledgerDirsManager.hasWritableLedgerDirs(); if ((diskFull && (!allDisksFull)) || reachEntryLogLimit || (logChannel == null)) { if (logChannel != null) { logChannel.flushAndForceWriteIfRegularFlush(false); } createNewLog(ledgerId, ": diskFull = " + diskFull + ", allDisksFull = " + allDisksFull + ", reachEntryLogLimit = " + reachEntryLogLimit + ", logChannel = " + logChannel); } return getCurrentLogForLedger(ledgerId); } finally { lock.unlock(); } }
Source:
public static VitalMultiMap toMetric(VitalMultiMap vitalMap) { for (int dateIndex = 0; dateIndex < vitalMap.getDateListChronological().size(); dateIndex++) { String tempC = vitalMap.get("temperature", vitalMap.getDate(dateIndex)); if (tempC != null) { vitalMap.put("temperature", vitalMap.getDate(dateIndex), getCelcius(tempC)); vitalMap.put("temperatureC", vitalMap.getDate(dateIndex), tempC); } String feetS = vitalMap.get("heightFeet", vitalMap.getDate(dateIndex)); String inchesS = vitalMap.get("heightInches", vitalMap.getDate(dateIndex)); if (feetS != null && inchesS != null) { Integer meters = getMeters(feetS, inchesS); Integer cm = getCentimetres(feetS, inchesS); vitalMap.put("heightMeters", vitalMap.getDate(dateIndex), meters); vitalMap.put("heightCm", vitalMap.getDate(dateIndex), String.format("%02d", cm)); } String lbs = vitalMap.get("weight", vitalMap.getDate(dateIndex)); if (lbs != null) { vitalMap.put("weightKgs", vitalMap.getDate(dateIndex), getKgs(lbs)); } } return vitalMap; }

Target:
public static VitalMultiMap toMetric(VitalMultiMap vitalMap) { for (int dateIndex = 0; dateIndex < vitalMap.getDateListChronological().size(); dateIndex++) { String tempC = vitalMap.get("temperature", vitalMap.getDate(dateIndex)); if (tempC != null) { vitalMap.put("temperatureCelsius", vitalMap.getDate(dateIndex), getCelcius(tempC)); } String feetS = vitalMap.get("heightFeet", vitalMap.getDate(dateIndex)); String inchesS = vitalMap.get("heightInches", vitalMap.getDate(dateIndex)); if (feetS != null && inchesS != null) { Integer meters = getMeters(feetS, inchesS); Integer cm = getCentimetres(feetS, inchesS); vitalMap.put("heightMeters", vitalMap.getDate(dateIndex), meters); vitalMap.put("heightCm", vitalMap.getDate(dateIndex), String.format("%02d", cm)); } String lbs = vitalMap.get("weight", vitalMap.getDate(dateIndex)); if (lbs != null) { vitalMap.put("weightKgs", vitalMap.getDate(dateIndex), getKgs(lbs)); } } return vitalMap; }
Source:
protected void createContents(Composite parent) { text = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Font monospace = new Font(text.getDisplay(), new FontData("Courier New", text.getFont().getFontData()[0].getHeight(), SWT.NORMAL)); text.setFont(monospace); text.addDisposeListener(e -> { monospace.dispose(); }); textObservable = new TextObservableValue(text, null, SWT.FocusOut); textObservable.addChangeListener(new IChangeListener() { @Override public void handleChange(ChangeEvent event) { if (text.getText().equals(expression.getBody())) { return; } Expression oldEx = new Expression(); oldEx.setLanguage(expression.getLanguage()); oldEx.setBody(expression.getBody()); expression.setBody(text.getText()); ValueDiff<Expression> diff = Diffs.createValueDiff(oldEx, expression); fireValueChange(diff); } }); }

Target:
protected void createContents(Composite parent) { text = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); text.setFont(JFaceResources.getTextFont()); textObservable = new TextObservableValue(text, null, SWT.FocusOut); textObservable.addChangeListener(new IChangeListener() { @Override public void handleChange(ChangeEvent event) { if (text.getText().equals(expression.getBody())) { return; } Expression oldEx = new Expression(); oldEx.setLanguage(expression.getLanguage()); oldEx.setBody(expression.getBody()); expression.setBody(text.getText()); ValueDiff<Expression> diff = Diffs.createValueDiff(oldEx, expression); fireValueChange(diff); } }); }
Source:
public MaxwellRedisProducer(MaxwellContext context) { super(context); this.channel = context.getConfig().redisKey; this.interpolateChannel = channel.contains("%{"); this.redisType = context.getConfig().redisType; if (jedisPool == null) { jedisPool = new JedisPool( createdRedisPoolConfig(), context.getConfig().redisHost, context.getConfig().redisPort, Protocol.DEFAULT_TIMEOUT, context.getConfig().redisAuth, context.getConfig().redisDatabase); } }

Target:
public MaxwellRedisProducer(MaxwellContext context) { super(context); this.channel = context.getConfig().redisKey; this.interpolateChannel = channel.contains("%{"); this.redisType = context.getConfig().redisType; jedisPool = new JedisPool( createRedisPoolConfig(), context.getConfig().redisHost, context.getConfig().redisPort, Protocol.DEFAULT_TIMEOUT, context.getConfig().redisAuth, context.getConfig().redisDatabase); }
Source:
public void testDisableCluster() throws Exception { ConfigAccessor configAccessor = new ConfigAccessor(_gZkClient); ClusterConfig clusterConfig = configAccessor.getClusterConfig(CLUSTER_NAME); clusterConfig.setMaxPartitionsPerInstance(10); configAccessor.setClusterConfig(CLUSTER_NAME, clusterConfig); int i = 0; for (String stateModel : TestStateModels) { String db = "Test-DB-" + i++; int replica = 3; createResourceWithDelayedRebalance(CLUSTER_NAME, db, stateModel, _PARTITIONS, replica, replica, -1); _testDBs.add(db); } Thread.sleep(100L); Assert.assertTrue(_clusterVerifier.verifyByPolling()); MaintenanceSignal maintenanceSignal = _dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance()); Assert.assertNull(maintenanceSignal); for (i = 2; i < NUM_NODE; i++) { _participants.get(i).syncStop(); } boolean result = TestHelper.verify(() -> { MaintenanceSignal ms = _dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance()); return ms != null && ms.getReason() != null; }, TestHelper.WAIT_DURATION); }

Target:
public void testDisableCluster() throws Exception { ConfigAccessor configAccessor = new ConfigAccessor(_gZkClient); ClusterConfig clusterConfig = configAccessor.getClusterConfig(CLUSTER_NAME); clusterConfig.setMaxPartitionsPerInstance(10); configAccessor.setClusterConfig(CLUSTER_NAME, clusterConfig); int i = 0; for (String stateModel : TestStateModels) { String db = "Test-DB-" + i++; int replica = 3; createResourceWithDelayedRebalance(CLUSTER_NAME, db, stateModel, _PARTITIONS, replica, replica, -1); _testDBs.add(db); } Assert.assertTrue(_clusterVerifier.verifyByPolling()); MaintenanceSignal maintenanceSignal = _dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance()); Assert.assertNull(maintenanceSignal); for (i = 2; i < NUM_NODE; i++) { _participants.get(i).syncStop(); } boolean result = TestHelper.verify(() -> { MaintenanceSignal ms = _dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance()); return ms != null && ms.getReason() != null; }, TestHelper.WAIT_DURATION); Assert.assertTrue(result); }
Source:
public Timestep maxTimestep() { ArrayList<ArgSpec> timestepTerms = new ArrayList<ArgSpec>(); selectTerms(new UnaryPredicate() { public boolean evaluate(Object term) { return ((ArgSpec) term).getTimestep() != null; } }, timestepTerms); Timestep result = null; for (ArgSpec spec : timestepTerms) { Timestep timestep = spec.getTimestep(); if (result == null || timestep.compareTo(result) > 0) { result = timestep; } } return result; }

Target:
public Timestep maxTimestep() { ArgSpecMaxReduceTimestep reducer = new ArgSpecMaxReduceTimestep(); applyToTerms(reducer); return reducer.result; }
Source:
public Optional<BibEntry> performSearchById(String identifier) throws FetcherException { if (StringUtil.isBlank(identifier)) { return Optional.empty(); } identifier = NEWLINE_SPACE_PATTERN.matcher(identifier).replaceAll(""); IsbnViaEbookDeFetcher isbnViaEbookDeFetcher = new IsbnViaEbookDeFetcher(importFormatPreferences); Optional<BibEntry> bibEntry = isbnViaEbookDeFetcher.performSearchById(identifier); if (!bibEntry.isPresent()) { LOGGER.debug("No entry found at ebook.de; trying ottobib"); IsbnViaOttoBibFetcher isbnViaOttoBibFetcher = new IsbnViaOttoBibFetcher(importFormatPreferences); bibEntry = isbnViaOttoBibFetcher.performSearchById(identifier); } if (!bibEntry.isPresent()) { FXDialog noEntryFoundDialog = new FXDialog(AlertType.ERROR); noEntryFoundDialog.setContentText("No entry found for ISBN: " + identifier + "."); noEntryFoundDialog.show(); } return bibEntry; }

Target:
public Optional<BibEntry> performSearchById(String identifier) throws FetcherException { if (StringUtil.isBlank(identifier)) { return Optional.empty(); } identifier = NEWLINE_SPACE_PATTERN.matcher(identifier).replaceAll(""); IsbnViaEbookDeFetcher isbnViaEbookDeFetcher = new IsbnViaEbookDeFetcher(importFormatPreferences); Optional<BibEntry> bibEntry = isbnViaEbookDeFetcher.performSearchById(identifier); if (!bibEntry.isPresent()) { LOGGER.debug("No entry found at ebook.de; trying ottobib"); IsbnViaOttoBibFetcher isbnViaOttoBibFetcher = new IsbnViaOttoBibFetcher(importFormatPreferences); bibEntry = isbnViaOttoBibFetcher.performSearchById(identifier); } return bibEntry; }
Source:
public ValidationResult isOperationAllowedOnDisk(VdcActionType actionType) { List<DiskContentType> allowedTypes = allowedCommandsOnTypes.get(actionType); if (allowedTypes == null) { throw new IllegalArgumentException( String.format("Cannot validate operation on disk for action of type %s as it is not an allowed commands for the disk content type.", actionType)); } if (!allowedTypes.contains(disk.getContentType())) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_CONTENT_TYPE_NOT_SUPPORTED_FOR_OPERATION, String.format("$diskContentType %s", disk.getContentType())); } return ValidationResult.VALID; }

Target:
public ValidationResult isOperationAllowedOnDisk(VdcActionType actionType) { List<DiskContentType> allowedTypes = allowedCommandsOnTypes.get(actionType); if (allowedTypes == null) { throw new IllegalArgumentException( String.format("Cannot validate operation on disk for action of type %s as it is not an allowed command for the disk content type.", actionType)); } if (!allowedTypes.contains(disk.getContentType())) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_CONTENT_TYPE_NOT_SUPPORTED_FOR_OPERATION, String.format("$diskContentType %s", disk.getContentType())); } return ValidationResult.VALID; }
Source:
protected void afterConfigureProperties() { getZendesk(); }

Target:
protected void afterConfigureProperties() { }
Source:
private ContentEquivalenceUpdateTask publisherUpdateTask(final Publisher... publishers) { return new ContentEquivalenceUpdateTask( (SelectedContentLister) contentLister, contentResolver, getNewDefaultExecutor(), progressStore(), equivUpdater, ignored ).forPublishers(publishers); }

Target:
private ContentEquivalenceUpdateTask publisherUpdateTask(final Publisher... publishers) { return new ContentEquivalenceUpdateTask( contentLister, contentResolver, getNewDefaultExecutor(), progressStore(), equivUpdater, ignored ).forPublishers(publishers); }
Source:
private void emitThreadAllocationMetrics(ServiceEmitter emitter) { final ServiceMetricEvent.Builder builder = builder(); MonitorUtils.addDimensionsToBuilder(builder, dimensions); Optional<Long> delta = collector.calculateDelta(); delta.ifPresent((value) -> emitter.emit(builder.build("jvm/heapAlloc/bytes", value))); }

Target:
private void emitThreadAllocationMetrics(ServiceEmitter emitter) { final ServiceMetricEvent.Builder builder = builder(); MonitorUtils.addDimensionsToBuilder(builder, dimensions); if (collector != null) { long delta = collector.calculateDelta(); emitter.emit(builder.build("jvm/heapAlloc/bytes", delta)); } }