auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected AbstractObjectConfigurationProvider(ObjectMapper mapper) { this.mapper = mapper; this.logger = LoggerFactory.getLogger(getClass()); }

Target:
protected AbstractObjectConfigurationProvider(ObjectMapper mapper) { if (mapper == null) { this.mapper = new ObjectMapper(); } else { this.mapper = mapper; } this.logger = LoggerFactory.getLogger(getClass()); }
Source:
public void testListScalingPoliciesFail() throws IOException, InterruptedException { MockWebServer server = mockOpenStackServer(); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404).setBody(stringFromResource("/autoscale_policy_list_response.json")))); try { AutoscaleApi autoscaleApi = api(server.getUrl("/").toString(), "rackspace-autoscale", overrides); PolicyApi api = autoscaleApi.getPolicyApiForZoneAndGroup("DFW", "groupId1"); FluentIterable<ScalingPolicyResponse> scalingPolicyResponse = api.list(); assertAuthentication(server); assertRequest(server.takeRequest(), "GET", "/v1.0/888888/groups/groupId1/policies"); assertEquals(scalingPolicyResponse.size(), 0); } finally { server.shutdown(); } }

Target:
public void testListScalingPoliciesFail() throws IOException, InterruptedException { MockWebServer server = mockOpenStackServer(); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404).setBody(stringFromResource("/autoscale_policy_list_response.json")))); try { AutoscaleApi autoscaleApi = api(server.getUrl("/").toString(), "rackspace-autoscale", overrides); PolicyApi api = autoscaleApi.getPolicyApiForZoneAndGroup("DFW", "groupId1"); FluentIterable<ScalingPolicyResponse> scalingPolicyResponse = api.list(); assertAuthentication(server); assertRequest(server.takeRequest(), "GET", "/v1.0/888888/groups/groupId1/policies"); assertTrue(scalingPolicyResponse.isEmpty(), "Expected no policy response, but was: " + scalingPolicyResponse); } finally { server.shutdown(); } }
Source:
public FormEntryPage clickOnForm(String formName) { onView(withText(formName)).perform(click()); return new FormEntryPage(formName, rule); }

Target:
public FormEntryPage clickOnForm(String formName) { clickOnFormButton(formName); return new FormEntryPage(formName, rule); }
Source:
public void run() { Object selection = getStructuredSelection().getFirstElement(); if (selection instanceof IBuildPlan) { final IBuildPlan plan = (IBuildPlan) selection; askParametersAndAbortBuild(plan); } }

Target:
public void run() { Object selection = getStructuredSelection().getFirstElement(); if (selection instanceof IBuildPlan) { final IBuildPlan plan = (IBuildPlan) selection; abortBuild(plan); } }
Source:
public void testValidContainerIdWhenContainerIdIsValidInTheThirdAttempt() { final ServerTemplate template = mock(ServerTemplate.class); final ContainerSpec containerSpec = mock(ContainerSpec.class); when(template.getContainerSpec("org.jbpm:Evaluation:1.0")).thenReturn(containerSpec); when(template.getContainerSpec("org.jbpm:Evaluation:1.0-2")).thenReturn(containerSpec); when(template.getContainerSpec("org.jbpm:Evaluation:1.0-3")).thenReturn(null); doReturn(template).when(specManagementService).getServerTemplate(TEMPLATE_ID); final String containerId = specManagementServiceCDI.validContainerId(TEMPLATE_ID, "org.jbpm:Evaluation:1.0"); assertEquals(containerId, "org.jbpm:Evaluation:1.0-3"); }

Target:
public void testValidContainerIdWhenContainerIdIsValidInTheThirdAttempt() { final ServerTemplate template = mock(ServerTemplate.class); final ContainerSpec containerSpec = mock(ContainerSpec.class); when(template.getContainerSpec(EVALUATION_GAV_1_0)).thenReturn(containerSpec); when(template.getContainerSpec(EVALUATION_GAV_1_0_2)).thenReturn(containerSpec); when(template.getContainerSpec(EVALUATION_GAV_1_0_3)).thenReturn(null); doReturn(template).when(specManagementService).getServerTemplate(TEMPLATE_ID); final String containerId = specManagementServiceCDI.validContainerId(TEMPLATE_ID, EVALUATION_GAV_1_0); assertEquals(containerId, EVALUATION_GAV_1_0_3); }
Source:
public void writeTo(final Object data, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { try { String xslName = "/" + type.getSimpleName() + "AsPdf.xsl"; templateStream = type.getResourceAsStream(xslName); if (templateStream != null) { StreamSource transformSource = new StreamSource(templateStream); Method factoryMethod = null; for (Method currentMethod : objectFactory.getClass().getDeclaredMethods()) { Class<?>[] parameterTypes = currentMethod.getParameterTypes(); if (parameterTypes.length == 1 && parameterTypes[0] == type) { factoryMethod = currentMethod; break; } } JAXBElement<?> element = (JAXBElement<?>) factoryMethod.invoke(objectFactory, data); if (data != null) { Source source = new JAXBSource(jaxbContext, element); Transformer xslfoTransformer = transfact.newTransformer(transformSource); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, entityStream); Result res = new SAXResult(fop.getDefaultHandler()); xslfoTransformer.transform(source, res); } else { log.error("No profile data is available for the selected volume"); } } else { log.error("Error while generating PDF.Null InputStream"); } } catch (Exception e) { log.error("Error while generating PDF.", e); } finally { if (templateStream != null) { templateStream.close(); } } }

Target:
public void writeTo(final Object data, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { try { String xslName = "/" + type.getSimpleName() + "AsPdf.xsl"; InputStream templateStream = type.getResourceAsStream(xslName); if (templateStream != null) { StreamSource transformSource = new StreamSource(templateStream); Method factoryMethod = null; for (Method currentMethod : objectFactory.getClass().getDeclaredMethods()) { Class<?>[] parameterTypes = currentMethod.getParameterTypes(); if (parameterTypes.length == 1 && parameterTypes[0] == type) { factoryMethod = currentMethod; break; } } if (data != null && factoryMethod != null) { JAXBElement<?> element = (JAXBElement<?>) factoryMethod.invoke(objectFactory, data); Source source = new JAXBSource(jaxbContext, element); Transformer xslfoTransformer = transfact.newTransformer(transformSource); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, entityStream); Result res = new SAXResult(fop.getDefaultHandler()); xslfoTransformer.transform(source, res); } else { log.error("No profile data is available for the selected volume"); } } else { log.error("Error while generating PDF.Null InputStream"); } } catch (Exception e) { log.error("Error while generating PDF.", e); } finally { if (templateStream != null) { templateStream.close(); } } }
Source:
@Override public void onMatch(RelOptRuleCall call) { final Project project = call.rel(0); final RelMetadataQuery mq = call.getMetadataQuery(); final RelOptPredicateList predicates = mq.getPulledUpPredicates(project.getInput()); final List<RexNode> expList = Lists.newArrayList(project.getProjects()); if (reduceExpressions(project, expList, predicates, false, matchNullability)) { assert !project.getProjects().equals(expList); call.transformTo( call.builder() .push(project.getInput()) .project(expList, project.getRowType().getFieldNames()) .build()); call.getPlanner().setImportance(project, 0.0); } }

Target:
@Override public void onMatch(RelOptRuleCall call) { final Project project = call.rel(0); final RelMetadataQuery mq = call.getMetadataQuery(); final RelOptPredicateList predicates = mq.getPulledUpPredicates(project.getInput()); final List<RexNode> expList = Lists.newArrayList(project.getProjects()); if (reduceExpressions(project, expList, predicates, false, matchNullability)) { assert !project.getProjects().equals(expList) : "Reduced expressions should be different from original expressions"; call.transformTo( call.builder() .push(project.getInput()) .project(expList, project.getRowType().getFieldNames()) .build()); call.getPlanner().setImportance(project, 0.0); } }
Source:
public void testTimeout() throws DatabaseFactoryException, ClassNotFoundException, InterruptedException, RecoveryException, RetryLimitExceededException, SQLException { final int socketTimeout = 60; final int loginTimeout = 30; final Properties properties = new Properties() { { setProperty(JDBC, config.jdbc); setProperty(USERNAME, config.username); setProperty(PASSWORD, config.password); setProperty(ENGINE, config.engine); setProperty(SCHEMA_POLICY, "create"); setProperty(SOCKET_TIMEOUT, Integer.toString(socketTimeout)); setProperty(LOGIN_TIMEOUT, Integer.toString(loginTimeout)); } }; final DatabaseEngine de = DatabaseFactory.getConnection(properties); final int connectionTimeoutInMs = de.getConnection().getNetworkTimeout(); assertEquals("timeout in db connection ok?", 0, connectionTimeoutInMs); }

Target:
public void testTimeout() throws DatabaseFactoryException, ClassNotFoundException, InterruptedException, RecoveryException, RetryLimitExceededException, SQLException { final int socketTimeout = 60; final int loginTimeout = 30; final Properties properties = new Properties() { { setProperty(JDBC, config.jdbc); setProperty(USERNAME, config.username); setProperty(PASSWORD, config.password); setProperty(ENGINE, config.engine); setProperty(SCHEMA_POLICY, "create"); setProperty(SOCKET_TIMEOUT, Integer.toString(socketTimeout)); setProperty(LOGIN_TIMEOUT, Integer.toString(loginTimeout)); } }; final DatabaseEngine de = DatabaseFactory.getConnection(properties); final int connectionTimeoutInMs = de.getConnection().getNetworkTimeout(); assertEquals("Is the timeout of the DB connection disabled as expected?", 0, connectionTimeoutInMs); }
Source:
public Fragment getItem(int position) { switch (position) { case 0: return new HomeFragment(); case 1: return new MinervaFragment(); case 4: return new ComingSoonFragment(); default: return new ActivitiesFragment(); } }

Target:
public Fragment getItem(int position) { switch (position) { case 0: return new HomeFragment(); case 1: return new MinervaFragment(); case 3: return new ActivitiesFragment(); default: return new ComingSoonFragment(); } }
Source:
public void testBinarySpatialTypeDWithin() throws Exception { JAXBElement filter = builder .beginBinarySpatialType("DWITHIN") .setProperty("name") .setValue("value") .setDistance(10.5) .endTerminalType() .getResult(); assertTrue(filter.getDeclaredType().equals(FilterType.class)); forNode(filter) .verifyTerminalNode("/Filter/DWithin", "name", "value") .verifyTerminalNode("/Filter/DWithin", 10.5); }

Target:
public void testBinarySpatialTypeDWithin() throws Exception { JAXBElement filter = builder .beginBinarySpatialType("DWITHIN") .setProperty("name") .setValue("value") .setDistance(10.5) .endTerminalType() .getResult(); assertThat(filter.getDeclaredType(), is(FilterType.class)); forNode(filter) .verifyTerminalNode("/Filter/DWithin", "name", "value") .verifyTerminalNode("/Filter/DWithin", 10.5); }
Source:
public void go() throws IOException, InterruptedException { boolean alive = true; while (isRunning() && alive) { CircularElement<E> element = this.dispatcher.take(SortStage.SORT); if (element != EOF_MARKER && element != SPILLING_MARKER) { if (element.getBuffer().size() == 0) { element.getBuffer().reset(); this.dispatcher.send(SortStage.READ, element); continue; } LOG.debug("Sorting buffer {}.", element.getId()); this.sorter.sort(element.getBuffer()); LOG.debug("Sorted buffer {}.", element.getId()); } else if (element == EOF_MARKER) { LOG.debug("Sorting thread done."); alive = false; } this.dispatcher.send(SortStage.SPILL, element); } }

Target:
public void go() throws InterruptedException { boolean alive = true; while (isRunning() && alive) { final CircularElement<E> element = this.dispatcher.take(SortStage.SORT); if (element != EOF_MARKER && element != SPILLING_MARKER) { if (element.getBuffer().size() == 0) { element.getBuffer().reset(); this.dispatcher.send(SortStage.READ, element); continue; } LOG.debug("Sorting buffer {}.", element.getId()); this.sorter.sort(element.getBuffer()); LOG.debug("Sorted buffer {}.", element.getId()); } else if (element == EOF_MARKER) { LOG.debug("Sorting thread done."); alive = false; } this.dispatcher.send(SortStage.SPILL, element); } }
Source:
protected Checker createChecker(Configuration checkConfig, boolean printSeverity) throws Exception { final DefaultConfiguration dc = createCheckerConfig(checkConfig); final Checker c = new Checker(); final Locale locale = Locale.ENGLISH; c.setLocaleCountry(locale.getCountry()); c.setLocaleLanguage(locale.getLanguage()); c.setModuleClassLoader(Thread.currentThread().getContextClassLoader()); c.configure(dc); c.addListener(new BriefLogger(stream, printSeverity)); return c; }

Target:
protected Checker createChecker(Configuration checkConfig, boolean printSeverity) throws Exception { final DefaultConfiguration dc = createCheckerConfig(checkConfig); final Checker checker = new Checker(); final Locale locale = Locale.ENGLISH; checker.setLocaleCountry(locale.getCountry()); checker.setLocaleLanguage(locale.getLanguage()); checker.setModuleClassLoader(Thread.currentThread().getContextClassLoader()); checker.configure(dc); checker.addListener(new BriefLogger(stream, printSeverity)); return checker; }
Source:
public void configure() throws Exception { onException(Exception.class) .redeliveryDelay("{{error.retryDelay}}") .maximumRedeliveries("{{error.maxRedeliveries}}") .backOffMultiplier(2) .retryAttemptedLogLevel(LoggingLevel.WARN); from("direct-vm:replication") .routeId("CdrReplicationRoute") .log(LoggingLevel.INFO, "Calling replication route for ${headers[org.fcrepo.jms.identifier]}") .to("direct:file.replication"); from("direct:file.replication") .bean(replicationProcessor); }

Target:
public void configure() throws Exception { onException(Exception.class) .redeliveryDelay("{{error.retryDelay}}") .maximumRedeliveries("{{error.maxRedeliveries}}") .backOffMultiplier(2) .retryAttemptedLogLevel(LoggingLevel.WARN); from("direct-vm:replication") .routeId("CdrReplicationRoute") .log(LoggingLevel.INFO, "Calling replication route for ${headers[org.fcrepo.jms.identifier]}") .log(LoggingLevel.INFO, "Replication completed for ${headers[org.fcrepo.jms.identifier]}") .to("direct:file.replication"); from("direct:file.replication") .bean(replicationProcessor); }
Source:
private void setupHostNetworkQosDao(){ when(getDbFacadeMockInstance().getHostNetworkQosDao()).thenReturn(hostNetworkQosDao); when(hostNetworkQosDao.get(networkMocked.getQosId())).thenReturn(hostNetworkQos); }

Target:
private void setupHostNetworkQosDao() { when(getDbFacadeMockInstance().getHostNetworkQosDao()).thenReturn(hostNetworkQosDao); when(networkMocked.getQosId()).thenReturn(qosId); when(hostNetworkQosDao.get(networkMocked.getQosId())).thenReturn(hostNetworkQos); }
Source:
public void zeroMissingIndexes() { List<Map<String, Object>> result = jdbcTemplate.queryForList(missingIndexesQuery); assertThat(result.size()).isZero(); }

Target:
public void zeroMissingIndexes() { List<Map<String, Object>> result = jdbcTemplate.queryForList(missingIndexesQuery); String statements = result.stream() .flatMap(m -> m.entrySet() .stream() .filter(e -> e.getKey().equals("ddl")) .map(e -> e.getValue().toString())) .collect(Collectors.joining(";\n")); assertThat(result.size()) .withFailMessage("Found missing indexes. Crete them using these statements:\n\n%s", statements) .isZero(); }
Source:
public void testEventExpirationValue() throws Exception { String drl1 = "package org.drools.pkg1\n" + "import org.drools.compiler.StockTick\n" + "declare StockTick\n" + " @role(event)\n" + "end\n" + "rule X\n" + "when\n" + " StockTick()\n" + "then\n" + "end\n"; String drl2 = "package org.drools.pkg2\n" + "import org.drools.compiler.StockTick\n" + "declare StockTick\n" + " @role(event)\n" + "end\n" + "rule X\n" + "when\n" + " StockTick()\n" + "then\n" + "end\n"; KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newByteArrayResource(drl1.getBytes()), ResourceType.DRL); kbuilder.add(ResourceFactory.newByteArrayResource(drl2.getBytes()), ResourceType.DRL); assertFalse(kbuilder.getErrors().toString(), kbuilder.hasErrors()); KieBaseConfiguration kconf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); kconf.setOption( EventProcessingOption.STREAM ); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase( kconf ); kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() ); List<ObjectTypeNode> otns = ( (KnowledgeBaseImpl) kbase ).getRete().getObjectTypeNodes(); ObjectType stot = new ClassObjectType( StockTick.class ); for (ObjectTypeNode otn : otns) { if (otn.getObjectType().isAssignableFrom( stot )) { assertEquals( Long.MAX_VALUE, otn.getExpirationOffset() ); } } }

Target:
public void testEventExpirationValue() throws Exception { String drl1 = "package org.drools.pkg1\n" + "import org.drools.compiler.StockTick\n" + "declare StockTick\n" + " @role(event)\n" + "end\n" + "rule X\n" + "when\n" + " StockTick()\n" + "then\n" + "end\n"; String drl2 = "package org.drools.pkg2\n" + "import org.drools.compiler.StockTick\n" + "declare StockTick\n" + " @role(event)\n" + "end\n" + "rule X\n" + "when\n" + " StockTick()\n" + "then\n" + "end\n"; KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newByteArrayResource(drl1.getBytes()), ResourceType.DRL); kbuilder.add(ResourceFactory.newByteArrayResource(drl2.getBytes()), ResourceType.DRL); assertFalse(kbuilder.getErrors().toString(), kbuilder.hasErrors()); KieBaseConfiguration kconf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); kconf.setOption( EventProcessingOption.STREAM ); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase( kconf ); kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() ); List<ObjectTypeNode> otns = ( (KnowledgeBaseImpl) kbase ).getRete().getObjectTypeNodes(); ObjectType stot = new ClassObjectType( StockTick.class ); for (ObjectTypeNode otn : otns) { if (otn.getObjectType().isAssignableFrom( stot )) { assertEquals( NEVER_EXPIRES, otn.getExpirationOffset() ); } } }
Source:
protected boolean isRequiredField() { return requiredOption.getValue() || strict; }

Target:
protected boolean isRequiredField() { final boolean result = requiredOption.getValue() || strict; return result; }
Source:
public VmBackupInfo(Map<String, Object> innerMap) { super(innerMap); disks = (Map<String, Object>) innerMap.get(VdsProperties.vm_disks); Object tempObj = innerMap.get(VdsProperties.CHECKPOINT); if (tempObj != null) { checkpoint = (String) innerMap.get(VdsProperties.CHECKPOINT); } }

Target:
public VmBackupInfo(Map<String, Object> innerMap) { super(innerMap); disks = (Map<String, Object>) innerMap.get(VdsProperties.vm_disks); Object tempObj = innerMap.get(VdsProperties.CHECKPOINT); if (tempObj != null) { checkpoint = (String) tempObj; } }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; org.drools.constraint.parser.JavaToken javaToken = (org.drools.constraint.parser.JavaToken) o; if (kind != javaToken.kind) return false; if (!text.equals(javaToken.text)) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } org.drools.constraint.parser.JavaToken javaToken = (org.drools.constraint.parser.JavaToken) o; if (kind != javaToken.kind) { return false; } if (!text.equals(javaToken.text)) { return false; } return true; }
Source:
protected ImageDescriptor decorateImage(ImageDescriptor input, Object element) { ImageDescriptor res = super.decorateImage(input, element); IResource resource = Adapters.adapt(element, IResource.class); if (resource != null && res != null && (resource.getType() != IResource.PROJECT || ((IProject) resource).isOpen())) { ImageDescriptor overlay = null; switch (getHighestProblemSeverity(resource)) { case IMarker.SEVERITY_ERROR: overlay = PlatformUI.getWorkbench().getSharedImages() .getImageDescriptor(ISharedImages.IMG_DEC_FIELD_ERROR); break; case IMarker.SEVERITY_WARNING: overlay = PlatformUI.getWorkbench().getSharedImages() .getImageDescriptor(ISharedImages.IMG_DEC_FIELD_WARNING); break; } if (overlay != null) { Image baseImage = res.createImage(); res = new DecorationOverlayIcon(baseImage, overlay, IDecoration.BOTTOM_LEFT); } } return res; }

Target:
protected ImageDescriptor decorateImage(ImageDescriptor input, Object element) { ImageDescriptor res = super.decorateImage(input, element); if (res == null) { return null; } IResource resource = Adapters.adapt(element, IResource.class); if (resource != null && (resource.getType() != IResource.PROJECT || ((IProject) resource).isOpen())) { ImageDescriptor overlay = null; switch (getHighestProblemSeverity(resource)) { case IMarker.SEVERITY_ERROR: overlay = PlatformUI.getWorkbench().getSharedImages() .getImageDescriptor(ISharedImages.IMG_DEC_FIELD_ERROR); break; case IMarker.SEVERITY_WARNING: overlay = PlatformUI.getWorkbench().getSharedImages() .getImageDescriptor(ISharedImages.IMG_DEC_FIELD_WARNING); break; } if (overlay != null) { res = new DecorationOverlayIcon(res, overlay, IDecoration.BOTTOM_LEFT); } } return res; }
Source:
public void handleDataChange(String dataPath, Object data) { LOG.info("got notification about barrier " + barrierStatePath + "; done=" + data); if (notAValidEven()) return; zkUtils.unsubscribeDataChanges(barrierStatePath, this); barrierListenerOptional.ifPresent( zkBarrierListener -> zkBarrierListener.onBarrierStateChanged(barrierVersion, (State) data)); }

Target:
public void handleDataChange(String dataPath, Object data) { LOG.info("got notification about barrier " + barrierStatePath + "; done=" + data); if (notAValidEvent()) return; zkUtils.unsubscribeDataChanges(barrierStatePath, this); barrierListenerOptional.ifPresent( zkBarrierListener -> zkBarrierListener.onBarrierStateChanged(barrierVersion, (State) data)); }
Source:
protected JComponent getDialogContent() { final DCPanel formPanel = new DCPanel(); WidgetUtils.addToGridBag(DCLabel.bright("Datastore name:"), formPanel, 0, 0); WidgetUtils.addToGridBag(_datastoreNameField, formPanel, 1, 0); final DCPanel checkBoxPanel = new DCPanel().setTitledBorder("Contained datastores"); checkBoxPanel.setLayout(new VerticalLayout(4)); for (JCheckBox checkBox : _checkBoxes) { checkBoxPanel.add(checkBox); } JScrollPane checkBoxScrollPane = WidgetUtils.scrolleable(checkBoxPanel); checkBoxScrollPane.setPreferredSize(new Dimension(checkBoxPanel.getWidth(), 300)); checkBoxScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); checkBoxScrollPane.setBackground(_outerPanel.getBackground()); WidgetUtils.addToGridBag(checkBoxScrollPane, formPanel, 0, 1, 2, 1); DCPanel buttonPanel = getButtonPanel(); DCPanel centerPanel = new DCPanel(); centerPanel.setLayout(new VerticalLayout(4)); centerPanel.add(formPanel); centerPanel.add(buttonPanel); JXStatusBar statusBar = WidgetFactory.createStatusBar(_statusLabel); _outerPanel.setLayout(new BorderLayout()); _outerPanel.add(centerPanel, BorderLayout.CENTER); _outerPanel.add(statusBar, BorderLayout.SOUTH); return _outerPanel; }

Target:
protected JComponent getDialogContent() { final DCPanel formPanel = new DCPanel(); WidgetUtils.addToGridBag(DCLabel.bright("Datastore name:"), formPanel, 0, 0); WidgetUtils.addToGridBag(_datastoreNameField, formPanel, 1, 0); final DCPanel checkBoxPanel = new DCPanel().setTitledBorder("Contained datastores"); checkBoxPanel.setLayout(new VerticalLayout(4)); for (JCheckBox checkBox : _checkBoxes) { checkBoxPanel.add(checkBox); } final JScrollPane checkBoxScrollPane = WidgetUtils.scrolleable(checkBoxPanel); checkBoxScrollPane.setPreferredSize(new Dimension(checkBoxPanel.getWidth(), 300)); checkBoxScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); checkBoxScrollPane.setBackground(_outerPanel.getBackground()); WidgetUtils.addToGridBag(checkBoxScrollPane, formPanel, 0, 1, 2, 1); final DCPanel buttonPanel = getButtonPanel(); final DCPanel centerPanel = new DCPanel(); centerPanel.setLayout(new VerticalLayout(4)); centerPanel.add(formPanel); centerPanel.add(buttonPanel); final JXStatusBar statusBar = WidgetFactory.createStatusBar(_statusLabel); _outerPanel.setLayout(new BorderLayout()); _outerPanel.add(centerPanel, BorderLayout.CENTER); _outerPanel.add(statusBar, BorderLayout.SOUTH); return _outerPanel; }
Source:
public ImageInputStream createInputStreamInstance(Object input, boolean useCache, File cacheDir) throws IOException { if (input instanceof CogUri) { if (((CogUri)input).isUseCache()) { return new CachingCogImageInputStream((CogUri) input); } else { return new DefaultCogImageInputStream((CogUri) input); } } if (input instanceof String || input instanceof URL || input instanceof URI) { if (((CogUri)input).isUseCache()) { return new CachingCogImageInputStream(new CogUri(input.toString())); } else { return new DefaultCogImageInputStream(new CogUri(input.toString())); } } throw new IOException("Invalid input."); }

Target:
public ImageInputStream createInputStreamInstance(Object input, boolean useCache, File cacheDir) throws IOException { if (input instanceof CogUri) { return ((CogUri) input).isUseCache() ? new CachingCogImageInputStream((CogUri) input) : new DefaultCogImageInputStream((CogUri) input); } if (input instanceof String || input instanceof URL || input instanceof URI) { return useCache ? new CachingCogImageInputStream(new CogUri(input.toString())) : new DefaultCogImageInputStream(new CogUri(input.toString()).useCache(false)); } throw new IOException("Invalid input."); }
Source:
protected boolean doEquivalent(TopicRef a, TopicRef b) { return ((a.getTopic() == b.getTopic()) && (a.getPublisher() == b.getPublisher())); }

Target:
protected boolean doEquivalent(TopicRef a, TopicRef b) { return Objects.equals(a.getTopic(), b.getTopic()) && Objects.equals(a.getPublisher(), b.getPublisher()); }
Source:
public void toExecute(JobExecutionContext context) throws JobExecutionException { JobDataMap map = context.getMergedJobDataMap(); String consumerUuid = map.getString(JobStatus.TARGET_ID); String cdnLabel = map.getString(CDN_LABEL); String webAppPrefix = map.getString(WEBAPP_PREFIX); String apiUrl = map.getString(API_URL); Consumer consumer = validateConsumer(consumerUuid); log.info("Starting async export for {}", consumerUuid); try { ExportResult result = manifestManager.generateAndStoreManifest(consumer, cdnLabel, webAppPrefix, apiUrl); context.setResult(result); log.info("Async export complete."); } catch (Exception e) { throw new JobExecutionException(e.getMessage(), e, false); } }

Target:
public void toExecute(JobExecutionContext context) throws JobExecutionException { JobDataMap map = context.getMergedJobDataMap(); String consumerUuid = map.getString(JobStatus.TARGET_ID); String cdnLabel = map.getString(CDN_LABEL); String webAppPrefix = map.getString(WEBAPP_PREFIX); String apiUrl = map.getString(API_URL); Map<String, String> extensionData = (Map<String, String>) map.get(EXTENSION_DATA); log.info("Starting async export for {}", consumerUuid); try { ExportResult result = manifestManager.generateAndStoreManifest(consumerUuid, cdnLabel, webAppPrefix, apiUrl, extensionData); context.setResult(result); log.info("Async export complete."); } catch (Exception e) { throw new JobExecutionException(e.getMessage(), e, false); } }
Source:
public void testLocalVariableSyntaxForLambdaParametersWithJava11() { ASTCompilationUnit compilationUnit = ParserTstUtil.parseAndTypeResolveJava("11", loadSource("LocalVariableSyntaxForLambdaParameters.java")); List<ASTLambdaExpression> lambdas = compilationUnit.findDescendantsOfType(ASTLambdaExpression.class); Assert.assertEquals(4, lambdas.size()); List<ASTFormalParameter> formalParameters = lambdas.get(0).findDescendantsOfType(ASTFormalParameter.class); Assert.assertEquals(1, formalParameters.size()); assertNull(formalParameters.get(0).getTypeNode()); }

Target:
public void testLocalVariableSyntaxForLambdaParametersWithJava11() { ASTCompilationUnit compilationUnit = ParserTstUtil.parseAndTypeResolveJava("11", loadSource("LocalVariableSyntaxForLambdaParameters.java")); List<ASTLambdaExpression> lambdas = compilationUnit.findDescendantsOfType(ASTLambdaExpression.class); Assert.assertEquals(4, lambdas.size()); List<ASTFormalParameter> formalParameters = lambdas.get(0).findDescendantsOfType(ASTFormalParameter.class); Assert.assertEquals(1, formalParameters.size()); Assert.assertNull(formalParameters.get(0).getTypeNode()); Assert.assertTrue(formalParameters.get(0).isTypeInferred()); }
Source:
public String resolve(String toResolve) { String str = ""; try { if (specfile == null || toResolve.equals("")) { if (toResolve.length() > 2 && toResolve.substring(2, toResolve.length() - 1) .equals(name)) { return toResolve; } } str = RPMQuery.eval(UiUtils.resolveDefines(specfile, toResolve)).trim(); } catch (CoreException e) { e.printStackTrace(); } return str; }

Target:
public String resolve(String toResolve) { String str = ""; try { if (specfile == null || toResolve.equals("")) { if (toResolve.length() > 2 && toResolve.substring(2, toResolve.length() - 1) .equals(name)) { return toResolve; } } str = RPMQuery.eval(UiUtils.resolveDefines(specfile, toResolve)).trim(); } catch (CoreException e) { SpecfileLog.logError("Unable to evaluate " + toResolve, e); } return str; }
Source:
public static TaggedBlobItem populateTaggedBlobItem(FilterBlobItem filterBlobItem) { Map<String, String> tags = new HashMap<>(); if (filterBlobItem.getTags() != null && filterBlobItem.getTags().getBlobTagSet() != null) { for (BlobTag tag : filterBlobItem.getTags().getBlobTagSet()) { tags.put(tag.getKey(), tag.getValue()); } } return new TaggedBlobItem(filterBlobItem.getContainerName(), filterBlobItem.getName(), tags); }

Target:
public static TaggedBlobItem populateTaggedBlobItem(FilterBlobItem filterBlobItem) { return new TaggedBlobItem(filterBlobItem.getContainerName(), filterBlobItem.getName(), tagMapFromBlobTags(filterBlobItem.getTags())); }
Source:
@Override public void close() { if (shuttingDown.compareAndSet(false, true)) { try { if (queryHandle != null && queryHandle.isAlive()) { queryHandle.cancel("closing query input source"); } } catch (Exception ex) { firstError.compareAndSet(null, ex); log.error("Error attempting to cancel query:", ex); } try { if (tempDir != null) { Files.deleteDir(tempDir); } } catch (Exception ex) { firstError.compareAndSet(null, ex); log.error("Error attempting to delete temporary directory:", ex); } Throwable error = firstError.get(); if (error != null) { closeFuture.completeExceptionally(error); throw Throwables.propagate(error); } else { closeFuture.complete(null); } } else { closeFuture.join(); } }

Target:
@Override public void close() { if (shuttingDown.compareAndSet(false, true)) { try { if (queryHandle != null) { queryHandle.cancel("closing query input source"); } } catch (Exception ex) { firstError.compareAndSet(null, ex); log.error("Error attempting to cancel query:", ex); } queryEngine.close(); try { if (tempDir != null) { LessFiles.deleteDir(tempDir); } } catch (Exception ex) { firstError.compareAndSet(null, ex); log.error("Error attempting to delete temporary directory:", ex); } Throwable error = firstError.get(); if (error != null) { closeFuture.completeExceptionally(error); throw Throwables.propagate(error); } else { closeFuture.complete(null); } } else { closeFuture.join(); } }
Source:
private void registerCmEvents(CodeMirror cm) { cm.on("cursorActivity", updateActiveLine(cm)); cm.on("scroll", doScroll(otherCM(cm))); cm.addKeyMap(KeyMap.create().on("'u'", upToChange())); cm.addKeyMap(KeyMap.create().on("'o'", toggleOpenBox(cm))); cm.addKeyMap(KeyMap.create().on("Enter", toggleOpenBox(cm))); if (Gerrit.isSignedIn()) { cm.addKeyMap(KeyMap.create().on("'c'", insertNewDraft(cm))); } CodeMirror.disableUnwantedKey("vim", "A"); CodeMirror.disableUnwantedKey("vim", "C"); CodeMirror.disableUnwantedKey("vim", "D"); CodeMirror.disableUnwantedKey("vim", "I"); CodeMirror.disableUnwantedKey("vim", "O"); CodeMirror.disableUnwantedKey("vim", "P"); CodeMirror.disableUnwantedKey("vim", "R"); CodeMirror.disableUnwantedKey("vim", "S"); CodeMirror.disableUnwantedKey("vim", "U"); CodeMirror.disableUnwantedKey("vim", "X"); CodeMirror.disableUnwantedKey("vim", "Y"); CodeMirror.disableUnwantedKey("vim", "~"); }

Target:
private void registerCmEvents(CodeMirror cm) { cm.on("cursorActivity", updateActiveLine(cm)); cm.on("scroll", doScroll(otherCM(cm))); cm.on("mousedown", ignoreRightClick()); cm.addKeyMap(KeyMap.create().on("'u'", upToChange())); cm.addKeyMap(KeyMap.create().on("'o'", toggleOpenBox(cm))); cm.addKeyMap(KeyMap.create().on("Enter", toggleOpenBox(cm))); if (Gerrit.isSignedIn()) { cm.addKeyMap(KeyMap.create().on("'c'", insertNewDraft(cm))); } CodeMirror.disableUnwantedKey("vim", "A"); CodeMirror.disableUnwantedKey("vim", "C"); CodeMirror.disableUnwantedKey("vim", "D"); CodeMirror.disableUnwantedKey("vim", "I"); CodeMirror.disableUnwantedKey("vim", "O"); CodeMirror.disableUnwantedKey("vim", "P"); CodeMirror.disableUnwantedKey("vim", "R"); CodeMirror.disableUnwantedKey("vim", "S"); CodeMirror.disableUnwantedKey("vim", "U"); CodeMirror.disableUnwantedKey("vim", "X"); CodeMirror.disableUnwantedKey("vim", "Y"); CodeMirror.disableUnwantedKey("vim", "~"); }
Source:
private boolean connectedRead(EpollRecvByteAllocatorHandle allocHandle, ByteBuf byteBuf, int maxDatagramPacketSize) throws Exception { try { int writable = maxDatagramPacketSize != 0 ? Math.min(byteBuf.writableBytes(), maxDatagramPacketSize) : byteBuf.writableBytes(); allocHandle.attemptedBytesRead(writable); byteBuf.writerIndex(byteBuf.readerIndex() + writable); int read = doReadBytes(byteBuf); if (read <= 0) { allocHandle.lastBytesRead(read); return false; } allocHandle.lastBytesRead(maxDatagramPacketSize <= 0 ? read : writable); DatagramPacket packet = new DatagramPacket(byteBuf, localAddress(), remoteAddress()); allocHandle.incMessagesRead(1); pipeline().fireChannelRead(packet); byteBuf = null; return true; } finally { if (byteBuf != null) { byteBuf.release(); } } }

Target:
private boolean connectedRead(EpollRecvByteAllocatorHandle allocHandle, ByteBuf byteBuf, int maxDatagramPacketSize) throws Exception { try { int writable = maxDatagramPacketSize != 0 ? Math.min(byteBuf.writableBytes(), maxDatagramPacketSize) : byteBuf.writableBytes(); allocHandle.attemptedBytesRead(writable); int writerIndex = byteBuf.writerIndex(); int localReadAmount; if (byteBuf.hasMemoryAddress()) { localReadAmount = socket.readAddress(byteBuf.memoryAddress(), writerIndex, writerIndex + writable); } else { ByteBuffer buf = byteBuf.internalNioBuffer(writerIndex, writable); localReadAmount = socket.read(buf, buf.position(), buf.limit()); } if (localReadAmount <= 0) { allocHandle.lastBytesRead(localReadAmount); return false; } byteBuf.writerIndex(writerIndex + localReadAmount); allocHandle.lastBytesRead(maxDatagramPacketSize <= 0 ? localReadAmount : writable); DatagramPacket packet = new DatagramPacket(byteBuf, localAddress(), remoteAddress()); allocHandle.incMessagesRead(1); pipeline().fireChannelRead(packet); byteBuf = null; return true; } finally { if (byteBuf != null) { byteBuf.release(); } } }
Source:
public static CryptoService getConfigured(AccumuloConfiguration conf) { String configuredClass = conf.get(Property.INSTANCE_CRYPTO_SERVICE.getKey()); if (singleton == null) { singleton = loadCryptoService(configuredClass); singleton.init(conf.getAllPropertiesWithPrefix(Property.INSTANCE_CRYPTO_PREFIX)); } else { if (!singleton.getClass().getName().equals(configuredClass)) { singleton = loadCryptoService(configuredClass); singleton.init(conf.getAllPropertiesWithPrefix(Property.INSTANCE_CRYPTO_PREFIX)); } } return singleton; }

Target:
public static CryptoService getConfigured(AccumuloConfiguration conf) { String currentClass = singleton.getClass().getName(); String configuredClass = conf.get(Property.INSTANCE_CRYPTO_SERVICE.getKey()); if (!currentClass.equals(configuredClass)) { String msg = String.format("Configured crypto class %s changed since initialization of %s.", configuredClass, currentClass); throw new CryptoService.CryptoException(msg); } return singleton; }
Source:
public void testRacyGitDetection() throws IOException, IllegalStateException, InterruptedException { DirCache dc; TreeSet<Long> modTimes = new TreeSet<Long>(); File lastFile; modTimes.add(fsTick(db.getIndexFile())); addToWorkDir("a", "a"); lastFile = addToWorkDir("b", "b"); modTimes.add(fsTick(lastFile)); addToIndex(modTimes); assertEquals( "[[a, modTime(index/file): t0/t0], [b, modTime(index/file): t0/t0]]", indexState(modTimes)); modTimes.add(Long.valueOf(db.getIndexFile().lastModified())); addToWorkDir("a", "a2"); addToIndex(modTimes); dc = db.readDirCache(); assertTrue(dc.getEntryCount() == 2); assertTrue(dc.getEntry("a").isSmudged()); assertFalse(dc.getEntry("b").isSmudged()); assertEquals( "[[a, modTime(index/file): t0/t0, unsmudged], [b, modTime(index/file): t1/t1]]", indexState(modTimes)); assertEquals( "[[a, modTime(index/file): t0/t0, unsmudged], [b, modTime(index/file): t1/t1]]", indexState(modTimes)); }

Target:
public void testRacyGitDetection() throws IOException, IllegalStateException, InterruptedException { DirCache dc; TreeSet<Long> modTimes = new TreeSet<Long>(); File lastFile; modTimes.add(fsTick(db.getIndexFile())); addToWorkDir("a", "a"); lastFile = addToWorkDir("b", "b"); modTimes.add(fsTick(lastFile)); addToIndex(modTimes); assertEquals( "[[a, modTime(index/file): t0/t0, length(index/file): 1/1," + " mode(index/file): 100644/100644, stage: 0]," + " [b, modTime(index/file): t0/t0, length(index/file): 1/1," + " mode(index/file): 100644/100644, stage: 0]]", indexState(modTimes)); modTimes.add(Long.valueOf(db.getIndexFile().lastModified())); addToWorkDir("a", "a2"); addToIndex(modTimes); dc = db.readDirCache(); assertTrue(dc.getEntryCount() == 2); assertTrue(dc.getEntry("a").isSmudged()); assertFalse(dc.getEntry("b").isSmudged()); assertEquals( "[[a, modTime(index/file): t0/t0, unsmudged," + " length(index/file): 2/2, mode(index/file): 100644/100644," + " stage: 0], [b, modTime(index/file): t1/t1, length(index/file):" + " 1/1, mode(index/file): 100644/100644, stage: 0]]", indexState(modTimes)); }
Source:
public void asyncGetLedgersContainBookies(final Set<BookieSocketAddress> bookies, final GenericCallback<SortedMap<Long, LedgerMetadata>> callback) { final SortedMap<Long, LedgerMetadata> ledgers = new ConcurrentSkipListMap<Long, LedgerMetadata>(); bkc.getLedgerManager().asyncProcessLedgers(new Processor<Long>() { @Override public void process(final Long lid, final AsyncCallback.VoidCallback cb) { bkc.getLedgerManager().readLedgerMetadata(lid) .whenComplete((metadata, exception) -> { if (exception instanceof BKException.BKNoSuchLedgerExistsException) { cb.processResult(BKException.Code.OK, null, null); return; } else if (exception != null) { cb.processResult(BKException.getExceptionCode(exception), null, null); return; } Set<BookieSocketAddress> bookiesInLedger = metadata.getValue().getBookiesInThisLedger(); Sets.SetView<BookieSocketAddress> intersection = Sets.intersection(bookiesInLedger, bookies); if (!intersection.isEmpty()) { ledgers.put(lid, metadata.getValue()); } cb.processResult(BKException.Code.OK, null, null); }); } }, new AsyncCallback.VoidCallback() { @Override public void processResult(int rc, String path, Object ctx) { callback.operationComplete(rc, ledgers); } }, null, BKException.Code.OK, BKException.Code.MetaStoreException); }

Target:
public void asyncGetLedgersContainBookies(final Set<BookieSocketAddress> bookies, final GenericCallback<SortedMap<Long, LedgerMetadata>> callback) { final SortedMap<Long, LedgerMetadata> ledgers = new ConcurrentSkipListMap<Long, LedgerMetadata>(); bkc.getLedgerManager().asyncProcessLedgers(new Processor<Long>() { @Override public void process(final Long lid, final AsyncCallback.VoidCallback cb) { bkc.getLedgerManager().readLedgerMetadata(lid) .whenComplete((metadata, exception) -> { if (BKException.getExceptionCode(exception) == BKException.Code.NoSuchLedgerExistsException) { cb.processResult(BKException.Code.OK, null, null); return; } else if (exception != null) { cb.processResult(BKException.getExceptionCode(exception), null, null); return; } Set<BookieSocketAddress> bookiesInLedger = metadata.getValue().getBookiesInThisLedger(); Sets.SetView<BookieSocketAddress> intersection = Sets.intersection(bookiesInLedger, bookies); if (!intersection.isEmpty()) { ledgers.put(lid, metadata.getValue()); } cb.processResult(BKException.Code.OK, null, null); }); } }, new AsyncCallback.VoidCallback() { @Override public void processResult(int rc, String path, Object ctx) { callback.operationComplete(rc, ledgers); } }, null, BKException.Code.OK, BKException.Code.MetaStoreException); }
Source:
private void onUpdatedShouldRunDecision(RunConditionCheckResult result) { boolean newShouldRunDecision = result.isShouldRun(); boolean reasonsChanged; synchronized (mCurrentCheckResult) { reasonsChanged = !mCurrentCheckResult.get().equals(result); mCurrentCheckResult.set(result); } if (reasonsChanged) { onRunConditionCheckResultChange(result); } if (newShouldRunDecision != mLastDeterminedShouldRun) { Log.i(TAG, "shouldRun decision changed to " + newShouldRunDecision + " according to configured run conditions."); mLastDeterminedShouldRun = newShouldRunDecision; if (newShouldRunDecision) { switch (mCurrentState) { case DISABLED: case INIT: shutdown(State.INIT, () -> { launchStartupTask(); }); break; case STARTING: case ACTIVE: case ERROR: break; default: break; } } else { if (mCurrentState == State.DISABLED) { return; } Log.v(TAG, "Stopping syncthing"); shutdown(State.DISABLED, () -> {}); } } }

Target:
private void onUpdatedShouldRunDecision(RunConditionCheckResult result) { boolean newShouldRunDecision = result.isShouldRun(); boolean reasonsChanged = !mCurrentCheckResult.getAndSet(result).equals(result); if (reasonsChanged) { onRunConditionCheckResultChange(result); } if (newShouldRunDecision != mLastDeterminedShouldRun) { Log.i(TAG, "shouldRun decision changed to " + newShouldRunDecision + " according to configured run conditions."); mLastDeterminedShouldRun = newShouldRunDecision; if (newShouldRunDecision) { switch (mCurrentState) { case DISABLED: case INIT: shutdown(State.INIT, () -> { launchStartupTask(); }); break; case STARTING: case ACTIVE: case ERROR: break; default: break; } } else { if (mCurrentState == State.DISABLED) { return; } Log.v(TAG, "Stopping syncthing"); shutdown(State.DISABLED, () -> {}); } } }
Source:
public SupremeCourtJudgment process(RawSourceScJudgment rJudgment) { log.debug("Processing: {}", rJudgment); markProcessed(rJudgment); SourceScJudgment sourceScJudgment = sourceScJudgmentParser.parse(rJudgment.getJsonContent()); SupremeCourtJudgment scJudgment = sourceScJudgmentConverter.convertJudgment(sourceScJudgment); SupremeCourtJudgment oldScJudgment = scJudgmentRepository.findOneBySourceCodeAndSourceJudgmentId(SourceCode.SUPREME_COURT, scJudgment.getSourceInfo().getSourceJudgmentId()); if (oldScJudgment != null) { log.debug("same found (rJudgmentId:{}, judgmentId: {}), updating...", rJudgment.getId(), oldScJudgment.getId()); judgmentOverwriter.overwriteJudgment(oldScJudgment, scJudgment); return oldScJudgment; } return scJudgment; }

Target:
public SupremeCourtJudgment process(RawSourceScJudgment rJudgment) { log.trace("Processing: rawSourceScJudgment id={}", rJudgment.getId()); markProcessed(rJudgment); SourceScJudgment sourceScJudgment = sourceScJudgmentParser.parse(rJudgment.getJsonContent()); SupremeCourtJudgment scJudgment = sourceScJudgmentConverter.convertJudgment(sourceScJudgment); SupremeCourtJudgment oldScJudgment = scJudgmentRepository.findOneBySourceCodeAndSourceJudgmentId(SourceCode.SUPREME_COURT, scJudgment.getSourceInfo().getSourceJudgmentId()); if (oldScJudgment != null) { log.trace("same found (rJudgmentId:{}, judgmentId: {}), updating...", rJudgment.getId(), oldScJudgment.getId()); judgmentOverwriter.overwriteJudgment(oldScJudgment, scJudgment); return oldScJudgment; } return scJudgment; }
Source:
public void writePackedRefs() throws IOException { boolean peeled = false; for (final Ref r : refs) { if (r.getStorage().isPacked() && r.isPeeled()) { peeled = true; break; } } final StringWriter w = new StringWriter(); if (peeled) { w.write(RefDirectory.PACKED_REFS_HEADER); if (peeled) w.write(RefDirectory.PACKED_REFS_PEELED); w.write('\n'); } final char[] tmp = new char[Constants.OBJECT_ID_STRING_LENGTH]; for (final Ref r : refs) { if (r.getStorage() != Ref.Storage.PACKED) continue; ObjectId objectId = r.getObjectId(); if (objectId == null) { throw new TransportException(MessageFormat .format(JGitText.get().cannotRead, r.getName())); } objectId.copyTo(tmp, w); w.write(' '); w.write(r.getName()); w.write('\n'); ObjectId peeledObjectId = r.getPeeledObjectId(); if (peeledObjectId != null) { w.write('^'); peeledObjectId.copyTo(tmp, w); w.write('\n'); } } writeFile(Constants.PACKED_REFS, Constants.encode(w.toString())); }

Target:
public void writePackedRefs() throws IOException { boolean peeled = false; for (final Ref r : refs) { if (r.getStorage().isPacked() && r.isPeeled()) { peeled = true; break; } } final StringWriter w = new StringWriter(); if (peeled) { w.write(RefDirectory.PACKED_REFS_HEADER); if (peeled) w.write(RefDirectory.PACKED_REFS_PEELED); w.write('\n'); } final char[] tmp = new char[Constants.OBJECT_ID_STRING_LENGTH]; for (final Ref r : refs) { if (r.getStorage() != Ref.Storage.PACKED) continue; ObjectId objectId = r.getObjectId(); if (objectId == null) { throw new NullPointerException(); } objectId.copyTo(tmp, w); w.write(' '); w.write(r.getName()); w.write('\n'); ObjectId peeledObjectId = r.getPeeledObjectId(); if (peeledObjectId != null) { w.write('^'); peeledObjectId.copyTo(tmp, w); w.write('\n'); } } writeFile(Constants.PACKED_REFS, Constants.encode(w.toString())); }
Source:
public void put(AlluxioURI dir, List<URIStatus> statuses) { try { CachedItem item = mCache.get(dir.getPath(), new Callable<CachedItem>() { @Override public CachedItem call() throws Exception { return new CachedItem(); } }); item.setDirStatuses(statuses); for (URIStatus status : statuses) { put(status.getPath(), status); } } catch (Exception e) { e.printStackTrace(); } }

Target:
public void put(AlluxioURI dir, List<URIStatus> statuses) { try { CachedItem item = mCache.get(dir.getPath(), () -> new CachedItem()); item.setDirStatuses(statuses); for (URIStatus status : statuses) { put(status.getPath(), status); } } catch (ExecutionException e) { LOG.warn("Failed to cache metadata for dir {}", dir.getPath()); } }
Source:
private void dispatch(ExecutionReference reference, ExecutableFlow exflow, Executor choosenExecutor) throws ExecutorManagerException { exflow.setUpdateTime(System.currentTimeMillis()); reference.setExecutor(choosenExecutor); callExecutorServer(reference, ConnectorParams.EXECUTE_ACTION); executorLoader.assignExecutor(exflow.getExecutionId(), choosenExecutor.getId()); runningFlows.put(exflow.getExecutionId(), new Pair<ExecutionReference, ExecutableFlow>(reference, exflow)); }

Target:
private void dispatch(ExecutionReference reference, ExecutableFlow exflow, Executor choosenExecutor) throws ExecutorManagerException { exflow.setUpdateTime(System.currentTimeMillis()); reference.setExecutor(choosenExecutor); callExecutorServer(reference, ConnectorParams.EXECUTE_ACTION); executorLoader.assignExecutor(exflow.getExecutionId(), choosenExecutor.getId()); runningFlows.put(exflow.getExecutionId(), new Pair<ExecutionReference, ExecutableFlow>(reference, exflow)); logger.info(String.format( "Successfully dispatched exec %d with error count %d", exflow.getExecutionId(), reference.getNumErrors())); }