auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public PayableDocument copyAsPayableDocument() { final InvoiceRow invoiceRow = this; final InvoiceId invoiceId; final OrderId prepayOrderId; final boolean creditMemo; if (invoiceRow.getC_Invoice_ID() > 0) { invoiceId = InvoiceId.ofRepoId(invoiceRow.getC_Invoice_ID()); prepayOrderId = null; creditMemo = invoiceRow.isCreditMemo(); } else if (invoiceRow.getC_Order_ID() > 0) { invoiceId = null; prepayOrderId = OrderId.ofRepoId(invoiceRow.getC_Order_ID()); creditMemo = false; } else { throw new AdempiereException("No document reference: " + invoiceRow); } final ICurrencyDAO currenciesRepo = Services.get(ICurrencyDAO.class); final CurrencyId currencyId = currenciesRepo.getByCurrencyCode(invoiceRow.getCurrencyISOCode()).getId(); return PayableDocument.builder() .clientAndOrgId(ClientAndOrgId.ofClientAndOrg(ClientId.METASFRESH, invoiceRow.getOrgId())) .invoiceId(invoiceId) .prepayOrderId(prepayOrderId) .bpartnerId(BPartnerId.ofRepoIdOrNull(invoiceRow.getC_BPartner_ID())) .soTrx(SOTrx.ofBoolean(invoiceRow.isCustomerDocument())) .creditMemo(creditMemo) .documentNo(invoiceRow.getDocumentNo()) .openAmt(Money.of(invoiceRow.getOpenAmtConv_APAdjusted(), currencyId)) .amountsToAllocate(AllocationAmounts.builder() .payAmt(Money.of(invoiceRow.getAppliedAmt_APAdjusted(), currencyId)) .discountAmt(Money.of(invoiceRow.getDiscount_APAdjusted(), currencyId)) .writeOffAmt(Money.of(invoiceRow.getWriteOffAmt_APAdjusted(), currencyId)) .build()) .build(); }

Target:
public PayableDocument copyAsPayableDocument() { final InvoiceRow invoiceRow = this; final InvoiceId invoiceId; final OrderId prepayOrderId; final boolean creditMemo; if (invoiceRow.getC_Invoice_ID() > 0) { invoiceId = InvoiceId.ofRepoId(invoiceRow.getC_Invoice_ID()); prepayOrderId = null; creditMemo = invoiceRow.isCreditMemo(); } else if (invoiceRow.getC_Order_ID() > 0) { invoiceId = null; prepayOrderId = OrderId.ofRepoId(invoiceRow.getC_Order_ID()); creditMemo = false; } else { throw new AdempiereException("No document reference: " + invoiceRow); } final ICurrencyDAO currenciesRepo = Services.get(ICurrencyDAO.class); final CurrencyId currencyId = currenciesRepo.getByCurrencyCode(invoiceRow.getCurrencyISOCode()).getId(); return PayableDocument.builder() .clientAndOrgId(ClientAndOrgId.ofClientAndOrg(Env.getClientId(), invoiceRow.getOrgId())) .invoiceId(invoiceId) .prepayOrderId(prepayOrderId) .bpartnerId(BPartnerId.ofRepoIdOrNull(invoiceRow.getC_BPartner_ID())) .soTrx(SOTrx.ofBoolean(invoiceRow.isCustomerDocument())) .creditMemo(creditMemo) .documentNo(invoiceRow.getDocumentNo()) .openAmt(Money.of(invoiceRow.getOpenAmtConv_APAdjusted(), currencyId)) .amountsToAllocate(AllocationAmounts.builder() .payAmt(Money.of(invoiceRow.getAppliedAmt_APAdjusted(), currencyId)) .discountAmt(Money.of(invoiceRow.getDiscount_APAdjusted(), currencyId)) .writeOffAmt(Money.of(invoiceRow.getWriteOffAmt_APAdjusted(), currencyId)) .build()) .build(); }
Source:
public void testInitProducerIdRequest() throws Exception { final long producerId = 343434L; TransactionManager transactionManager = createTransactionManager(); setupWithTransactionState(transactionManager); prepareAndReceiveInitProducerId(producerId, Errors.NONE); assertTrue(transactionManager.hasProducerId()); assertEquals(producerId, transactionManager.producerIdAndEpoch().producerId); assertEquals((short) 0, transactionManager.producerIdAndEpoch().epoch); }

Target:
public void testInitProducerIdRequest() { final long producerId = 343434L; TransactionManager transactionManager = createTransactionManager(); setupWithTransactionState(transactionManager); prepareAndReceiveInitProducerId(producerId, Errors.NONE); assertTrue(transactionManager.hasProducerId()); assertEquals(producerId, transactionManager.producerIdAndEpoch().producerId); assertEquals((short) 0, transactionManager.producerIdAndEpoch().epoch); }
Source:
public void testFtpOutboundFlowWithChmod() { IntegrationFlow flow = f -> f .handle(Ftp.outboundAdapter(sessionFactory(), FileExistsMode.FAIL) .useTemporaryFileName(false) .fileNameExpression("headers['" + FileHeaders.FILENAME + "']") .chmod(644) .remoteDirectory("ftpTarget")); IntegrationFlowRegistration registration = this.flowContext.registration(flow).register(); String fileName = "foo.file"; Message<ByteArrayInputStream> message = MessageBuilder .withPayload(new ByteArrayInputStream("foo".getBytes(StandardCharsets.UTF_8))) .setHeader(FileHeaders.FILENAME, fileName) .build(); registration.getInputChannel().send(message); RemoteFileTemplate<FTPFile> template = new RemoteFileTemplate<>(sessionFactory()); FTPFile[] files = template.execute(session -> session.list(getTargetRemoteDirectory().getName() + "/" + fileName)); assertThat(files.length).isEqualTo(1); assertThat(files[0].getSize()).isEqualTo(3); assertThat(files[0].hasPermission(FTPFile.USER_ACCESS, FTPFile.READ_PERMISSION)).isTrue(); assertThat(files[0].hasPermission(FTPFile.USER_ACCESS, FTPFile.WRITE_PERMISSION)).isTrue(); assertThat(files[0].hasPermission(FTPFile.GROUP_ACCESS, FTPFile.READ_PERMISSION)).isTrue(); assertThat(files[0].hasPermission(FTPFile.GROUP_ACCESS, FTPFile.WRITE_PERMISSION)).isFalse(); assertThat(files[0].hasPermission(FTPFile.WORLD_ACCESS, FTPFile.READ_PERMISSION)).isTrue(); assertThat(files[0].hasPermission(FTPFile.WORLD_ACCESS, FTPFile.WRITE_PERMISSION)).isFalse(); registration.destroy(); }

Target:
public void testFtpOutboundFlowWithChmod() { IntegrationFlow flow = f -> f .handle(Ftp.outboundAdapter(sessionFactory(), FileExistsMode.FAIL) .useTemporaryFileName(false) .fileNameExpression("headers['" + FileHeaders.FILENAME + "']") .chmod(0644) .remoteDirectory("ftpTarget")); IntegrationFlowRegistration registration = this.flowContext.registration(flow).register(); String fileName = "foo.file"; Message<ByteArrayInputStream> message = MessageBuilder .withPayload(new ByteArrayInputStream("foo".getBytes(StandardCharsets.UTF_8))) .setHeader(FileHeaders.FILENAME, fileName) .build(); registration.getInputChannel().send(message); RemoteFileTemplate<FTPFile> template = new RemoteFileTemplate<>(sessionFactory()); FTPFile[] files = template.execute(session -> session.list(getTargetRemoteDirectory().getName() + "/" + fileName)); assertThat(files.length).isEqualTo(1); assertThat(files[0].getSize()).isEqualTo(3); registration.destroy(); }
Source:
public void onEvent(Event event, Object o, Object o1) { try { org.xwiki.eventstream.Event eventStreamEvent = (org.xwiki.eventstream.Event) o; List<RecordableEventDescriptor> descriptorList = this.recordableEventDescriptorManager.getRecordableEventDescriptors(true); for (RecordableEventDescriptor descriptor : descriptorList) { if (descriptor.getEventType().equals(eventStreamEvent.getType()) && this.notificationConfiguration.isEnabled() && this.notificationConfiguration.areEmailsEnabled()) { this.liveNotificationEmailManager.addEvent(eventStreamEvent); this.startNotificationThread(); } } } catch (EventStreamException e) { logger.warn("Unable to retrieve a full list of RecordableEventDescriptor.", e); } }

Target:
public void onEvent(Event event, Object o, Object o1) { if (this.notificationConfiguration.isEnabled() && this.notificationConfiguration.areEmailsEnabled()) { try { org.xwiki.eventstream.Event eventStreamEvent = (org.xwiki.eventstream.Event) o; List<RecordableEventDescriptor> descriptorList = this.recordableEventDescriptorManager.getRecordableEventDescriptors(true); for (RecordableEventDescriptor descriptor : descriptorList) { if (descriptor.getEventType().equals(eventStreamEvent.getType())) { this.liveNotificationEmailManager.addEvent(eventStreamEvent); this.startNotificationThread(); } } } catch (EventStreamException e) { logger.warn("Unable to retrieve a full list of RecordableEventDescriptor.", e); } } }
Source:
public static String getDisplay(DrugOrder delegate) { StringBuilder ret = new StringBuilder(); if (delegate.getDrug() != null) { ret.append(delegate.getDrug().getName()); } else { ret.append(delegate.getConcept().getDisplayString()); } ret.append(": "); if(delegate.getDosingType() != null && delegate.getDosingInstructionsInstance() != null) { ret.append(delegate.getDosingInstructionsInstance().getDosingInstructionsAsString(Context.getLocale())); } else if (delegate.getDose() != null) { ret.append(delegate.getDose()); if (delegate.getDoseUnits() != null && delegate.getDoseUnits().getName() != null) { ret.append(delegate.getDoseUnits().getName().getName()); } else { ret.append("[no units]"); } } else { ret.append("[no dose]"); } return ret.toString(); }

Target:
public static String getDisplay(DrugOrder delegate) { StringBuilder ret = new StringBuilder(); if (delegate.getDrug() != null) { ret.append(delegate.getDrug().getName()); } else { ret.append(delegate.getConcept().getDisplayString()); } if(delegate.getDosingType() != null && delegate.getDosingInstructionsInstance() != null) { String dosingInstructionsAsString = delegate.getDosingInstructionsInstance().getDosingInstructionsAsString(Context.getLocale()); ret.append(": "); ret.append(dosingInstructionsAsString); } return ret.toString(); }
Source:
public ColorPickerLifecycleManager(EEFCustomWidgetDescription description, IVariableManager variableManager, IInterpreter interpreter, TransactionalEditingDomain editingDomain) { super(description, variableManager, interpreter, editingDomain); this.description = description; }

Target:
public ColorPickerLifecycleManager(EEFCustomWidgetDescription description, IVariableManager variableManager, IInterpreter interpreter, TransactionalEditingDomain editingDomain) { super(variableManager, interpreter, editingDomain); this.description = description; }
Source:
public boolean next() throws IOException { for (;;) { LogQueueEntry t = queue.poll(); if (t == null) { return false; } refName = t.lc.getRefName(); updateIndex = t.lc.getUpdateIndex(); entry = t.lc.getReflogEntry(); boolean include = includeDeletes || entry != null; skipShadowed(refName, updateIndex); add(t); if (include) { return true; } return true; } }

Target:
public boolean next() throws IOException { for (;;) { LogQueueEntry t = queue.poll(); if (t == null) { return false; } refName = t.lc.getRefName(); updateIndex = t.lc.getUpdateIndex(); entry = t.lc.getReflogEntry(); boolean include = includeDeletes || entry != null; skipShadowed(refName, updateIndex); add(t); if (include) { return true; } } }
Source:
public static String relativeTime(final OffsetDateTime offsetDateTime) { return relativeTime(fromUTC(offsetDateTime)); }

Target:
public static String relativeTime(final OffsetDateTime offsetDateTime) { return relativeTime(OffsetDateTimeKt.toCalendar(offsetDateTime)); }
Source:
public void shouldGetBahmniProgramEnrollmentByPatientUuid() throws Exception { ProgramEnrollment programEnrollment = prepareBahmniProgramEnrollment(); URI url = config.toInstancePathWithParams("/bahmniprogramenrollment?patient={uuid}&v=full", programEnrollment.getPatient().getUuid()); when(restOperations.exchange(eq(url), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class))) .thenReturn(getResponseFromFile(BAHMNI_PROGRAM_ENROLLMENT_TABLE)); List<ProgramEnrollment> fetched = programEnrollmentResource.getBahmniProgramEnrollmentByPatientUuid(config, programEnrollment.getPatient().getUuid()); verify(restOperations).exchange(eq(url), eq(HttpMethod.GET), requestCaptor.capture(), eq(String.class)); assertThat(fetched, hasItem(programEnrollment)); assertThat(fetched.size(), equalTo(1)); assertThat(requestCaptor.getValue().getHeaders(), equalTo(getHeadersForGet(config))); assertThat(JsonUtils.readJson(requestCaptor.getValue().getBody(), JsonObject.class), nullValue()); }

Target:
public void shouldGetBahmniProgramEnrollmentByPatientUuid() throws Exception { ProgramEnrollment programEnrollment = prepareBahmniProgramEnrollment(); URI url = config.toInstancePathWithParams("/bahmniprogramenrollment?patient={uuid}&v=full", programEnrollment.getPatient().getUuid()); when(restOperations.exchange(eq(url), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class))) .thenReturn(getResponseFromFile(BAHMNI_PROGRAM_ENROLLMENT_TABLE)); List<ProgramEnrollment> fetched = programEnrollmentResource.getBahmniProgramEnrollmentByPatientUuid(config, programEnrollment.getPatient().getUuid()); verify(restOperations).exchange(eq(url), eq(HttpMethod.GET), requestCaptor.capture(), eq(String.class)); assertThat(fetched, hasItem(programEnrollment)); assertThat(fetched.size(), equalTo(1)); assertThat(requestCaptor.getValue().getHeaders(), equalTo(getHeadersForGet(config))); }
Source:
public void parseAndValidate() throws JsonParseException { ReferencedCourtCasesTagValueItem[] referencedCourtCasesTagValueItems = jsonStringParser.parseAndValidate(jsonTagValue); assertNotNull(referencedCourtCasesTagValueItems); }

Target:
public void parseAndValidate() throws JsonParseException { ReferencedCourtCasesTagValueItem[] referencedCourtCasesTagValueItems = jsonStringParser.parseAndValidate(jsonTagValue); assertNotNull(referencedCourtCasesTagValueItems); List<ReferencedCourtCasesTagValueItem> tagValueItems = Lists.newArrayList(referencedCourtCasesTagValueItems); assertEquals(1, tagValueItems.stream().filter(item->item.getCaseNumber().equals("XVI1 Ko 439/96") && item.getJudgmentIds().isEmpty()).count()); assertEquals(1, tagValueItems.stream().filter(item->item.getCaseNumber().equals("II AKa 115/99") && item.getJudgmentIds().size()==1 && item.getJudgmentIds().contains(83218l)).count()); }
Source:
public PortableInfoboxObject isNotHeroImageSquare() { wait.forElementVisible(mainImage); Assertion.assertNotEquals(mainImage.getSize().getHeight(), mainImage.getSize().getWidth()); PageObjectLogging.log("Hero image", "is square", true); return this; }

Target:
public PortableInfoboxObject isNotHeroImageSquare() { wait.forElementVisible(mainImage); Assertion.assertNotEquals(mainImage.getSize().getHeight(), mainImage.getSize().getWidth()); PageObjectLogging.log("Hero image", "is not square", true); return this; }
Source:
public void testToOneInitializedByQuery() throws Exception { em.getTransaction().begin(); String nativeQuery = "MATCH ( n:" + TABLE_NAME + " { name:'Portia', author:'Oscar Wilde' } ) RETURN n"; OscarWildePoem poem = (OscarWildePoem) em.createNativeQuery( nativeQuery, OscarWildePoem.class ).getSingleResult(); assertThat( poem.getCritic() ).isNotNull(); em.getTransaction().commit(); }

Target:
public void testToOneInitializedByQuery() throws Exception { em.getTransaction().begin(); String nativeQuery = "MATCH ( n:" + TABLE_NAME + " { name:'Portia', author:'Oscar Wilde' } ) RETURN n"; OscarWildePoem poem = (OscarWildePoem) em.createNativeQuery( nativeQuery, OscarWildePoem.class ).getSingleResult(); assertThat( poem.getCritic() ).isNotNull(); assertThat( poem.getCritic().getName() ).as( "Wrong critic name" ).isEqualTo( "Roger" ); em.getTransaction().commit(); }
Source:
protected void onResume() { super.onResume(); if (!freshRegFlag && !isUnregisterBtnClicked) { if (CommonUtils.isNetworkAvailable(context)) { JSONObject requestParams = new JSONObject(); try { requestParams.put(resources.getString(R.string.shared_pref_regId), regId); } catch (JSONException e) { if (Constants.DEBUG_MODE_ENABLED) { Log.d(TAG, "Invalid JSON." + e); } } CommonUtils.callSecuredAPI(AlreadyRegisteredActivity.this, Constants.IS_REGISTERED_ENDPOINT, Constants.POST_METHOD, requestParams, AlreadyRegisteredActivity.this, Constants.IS_REGISTERED_REQUEST_CODE); } else { CommonDialogUtils.showNetworkUnavailableMessage(AlreadyRegisteredActivity.this); } } }

Target:
protected void onResume() { super.onResume(); if (!freshRegFlag && !isUnregisterBtnClicked) { if (CommonUtils.isNetworkAvailable(context)) { JSONObject requestParams = new JSONObject(); try { requestParams.put(resources.getString(R.string.shared_pref_regId), regId); } catch (JSONException e) { Log.e(TAG, "Invalid JSON." + e); } CommonUtils.callSecuredAPI(AlreadyRegisteredActivity.this, Constants.IS_REGISTERED_ENDPOINT, HTTP_METHODS.POST, requestParams, AlreadyRegisteredActivity.this, Constants.IS_REGISTERED_REQUEST_CODE); } else { CommonDialogUtils.showNetworkUnavailableMessage(AlreadyRegisteredActivity.this); } } }
Source:
private Expression getExpression(String expression) { if (isTemplate(expression)) { logger.warn("Template expressions are deprecated in favor of literal expressions"); return new SpelExpressionParser().parseExpression(expression, PARSER_CONTEXT); } return new SpelExpressionParser().parseExpression(expression); }

Target:
private Expression getExpression(String expression) { if (isTemplate(expression)) { logger.warn("#{...} syntax is not required for this run-time expression and is deprecated in favor of a simple expression string"); return new SpelExpressionParser().parseExpression(expression, PARSER_CONTEXT); } return new SpelExpressionParser().parseExpression(expression); }
Source:
private void terminateContainer(DockerCloud dc, DockerClient client, Container container) { boolean gracefulFailed = false; try { terminateContainerGracefully(dc, container); } catch (TerminationException e) { LOGGER.warn("Graceful termination of container failed with TerminationException", container.getId(), e); gracefulFailed = true; } catch (ContainerIsTaintedException e) { LOGGER.warn("Container has been tempered with; skipping cleanup", container.getId(), e); return; } if (gracefulFailed) { try { client.removeContainerCmd(container.getId()).withForce(true).exec(); } catch (RuntimeException e) { LOGGER.warn("Forced termination of container failed with RuntimeException", container.getId(), e); } } }

Target:
private void terminateContainer(DockerCloud dc, DockerClient client, Container container) { boolean gracefulFailed = false; try { terminateContainerGracefully(dc, container); } catch (TerminationException e) { gracefulFailed = true; } catch (ContainerIsTaintedException e) { LOGGER.warn("Container has been tampered with; skipping cleanup", container.getId(), e); return; } if (gracefulFailed) { try { Instant start = clock.instant(); client.removeContainerCmd(container.getId()).withForce(true).exec(); Instant stop = clock.instant(); executionStatistics.addContainerRemovalForce(Duration.between(start, stop).toMillis()); } catch (RuntimeException e) { LOGGER.warn("Forced termination of container failed with RuntimeException", container.getId(), e); executionStatistics.addContainerRemovalFailed(); } } }
Source:
private void renderConstants(ParameterHolder<?> criteriaBuilder) { for (Map.Entry<Object, String> entry : constantToLabel.entrySet()) { try { criteriaBuilder.setParameter(entry.getValue(), entry.getKey()); } catch (Exception e) { throw e; } } }

Target:
private void renderConstants(ParameterHolder<?> criteriaBuilder) { for (Map.Entry<Object, String> entry : constantToLabel.entrySet()) { criteriaBuilder.setParameter(entry.getValue(), entry.getKey()); } }
Source:
protected String checkJavaVersion(final PrintStream logger, String javaCommand, final BufferedReader r, final StringWriter output) throws IOException { String line; while (null != (line = r.readLine())) { output.write(line); output.write("\n"); line = line.toLowerCase(Locale.ENGLISH); if (line.startsWith("java version \"") || line.startsWith("openjdk version \"")) { final String versionStr = line.substring( line.indexOf('\"') + 1, line.lastIndexOf('\"')); logger.println(Messages.SSHLauncher_JavaVersionResult( getTimestamp(), javaCommand, versionStr)); final VersionNumber minJavaLevel = JavaProvider.getMinJavaLevel(); try { final Number version = NumberFormat.getNumberInstance(Locale.US).parse(versionStr); if(version.doubleValue() < Double.parseDouble("1."+minJavaLevel)) { throw new IOException(Messages .SSHLauncher_NoJavaFound(line, minJavaLevel.toString())); } } catch(final ParseException e) { throw new IOException(Messages.SSHLauncher_NoJavaFound(line, minJavaLevel)); } return javaCommand; } } return null; }

Target:
protected String checkJavaVersion(final PrintStream logger, String javaCommand, final BufferedReader r, final StringWriter output) throws IOException { String line; while (null != (line = r.readLine())) { output.write(line); output.write("\n"); line = line.toLowerCase(Locale.ENGLISH); if (line.startsWith("java version \"") || line.startsWith("openjdk version \"")) { final String versionStr = line.substring( line.indexOf('\"') + 1, line.lastIndexOf('\"')); logger.println(Messages.SSHLauncher_JavaVersionResult( getTimestamp(), javaCommand, versionStr)); final VersionNumber minJavaLevel = JavaProvider.getMinJavaLevel(); try { final Number version = NumberFormat.getNumberInstance(Locale.US).parse(versionStr); if(version.doubleValue() < Double.parseDouble("1."+minJavaLevel)) { throw new IOException(Messages .SSHLauncher_NoJavaFound2(line, minJavaLevel.toString())); } } catch(final ParseException e) { throw new IOException(Messages.SSHLauncher_NoJavaFound2(line, minJavaLevel)); } return javaCommand; } } return null; }
Source:
public ValidationError(String msg) { super("ValidationError: " + msg); }

Target:
public ValidationError(String msg) { super(msg); }
Source:
private List<ErrorReporter> sinkTaskReporters(ConnectorTaskId id, SinkConnectorConfig connConfig, ErrorHandlingMetrics errorHandlingMetrics, Class<? extends Connector> connectorClass) { ArrayList<ErrorReporter> reporters = new ArrayList<>(); LogReporter logReporter = new LogReporter(id, connConfig, errorHandlingMetrics); reporters.add(logReporter); String topic = connConfig.dlqTopicName(); if (topic != null && !topic.isEmpty()) { Map<String, Object> producerProps = producerConfigs(id, "connector-dlq-producer-" + id, config, connConfig, connectorClass, connectorClientConfigOverridePolicy); Map<String, Object> adminProps = adminConfigs(id, "", config, connConfig, connectorClass, connectorClientConfigOverridePolicy); DeadLetterQueueReporter reporter = DeadLetterQueueReporter.createAndSetup(adminProps, id, connConfig, producerProps, errorHandlingMetrics); reporters.add(reporter); } return reporters; }

Target:
private List<ErrorReporter> sinkTaskReporters(ConnectorTaskId id, SinkConnectorConfig connConfig, ErrorHandlingMetrics errorHandlingMetrics, Class<? extends Connector> connectorClass) { ArrayList<ErrorReporter> reporters = new ArrayList<>(); LogReporter logReporter = new LogReporter(id, connConfig, errorHandlingMetrics); reporters.add(logReporter); String topic = connConfig.dlqTopicName(); if (topic != null && !topic.isEmpty()) { Map<String, Object> producerProps = producerConfigs(id, "connector-dlq-producer-" + id, config, connConfig, connectorClass, connectorClientConfigOverridePolicy); Map<String, Object> adminProps = adminConfigs(id, "connector-dlq-adminclient-", config, connConfig, connectorClass, connectorClientConfigOverridePolicy); DeadLetterQueueReporter reporter = DeadLetterQueueReporter.createAndSetup(adminProps, id, connConfig, producerProps, errorHandlingMetrics); reporters.add(reporter); } return reporters; }
Source:
public CollectionResource createCollection(String newName) throws DotRuntimeException { User user=(User)HttpManager.request().getAuthorization().getTag(); if(dotDavHelper.isTempResource(newName)){ File f = dotDavHelper.createTempFolder(File.separator + host.getHostname() + File.separator + newName); TempFolderResourceImpl tr = new TempFolderResourceImpl(f.getPath(),f ,isAutoPub); return tr; } if(!path.endsWith("/")){ path = path + "/"; } try { Folder f = dotDavHelper.createFolder(path + newName, user); FolderResourceImpl fr = new FolderResourceImpl(f, path + newName + "/"); return fr; } catch (Exception e) { if(e instanceof InvalidFolderNameException) { Logger.warnAndDebug(HostResourceImpl.class, e.getMessage(), e); throw new DotRuntimeException(e.getMessage()); } else { Logger.error(this, e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } } }

Target:
public CollectionResource createCollection(String newName) throws DotRuntimeException { User user=(User)HttpManager.request().getAuthorization().getTag(); if(dotDavHelper.isTempResource(newName)){ File f = dotDavHelper.createTempFolder(File.separator + host.getHostname() + File.separator + newName); TempFolderResourceImpl tr = new TempFolderResourceImpl(f.getPath(),f ,isAutoPub); return tr; } if(!path.endsWith("/")){ path = path + "/"; } try { Folder f = dotDavHelper.createFolder(path + newName, user); FolderResourceImpl fr = new FolderResourceImpl(f, path + newName + "/"); return fr; } catch(InvalidFolderNameException e) { Logger.warnAndDebug(HostResourceImpl.class, e.getMessage(), e); throw new DotRuntimeException(e.getMessage()); } catch (Exception e) { Logger.error(this, e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } }
Source:
protected void performLiveSnapshot(Guid createdSnapshotId) { try { TransactionSupport.executeInScope(TransactionScopeOption.Suppress, new TransactionMethod<Void>() { @Override public Void runInTransaction() { List<Disk> pluggedDisks = new VmRunHandler().getPluggedDisks(getVm(), DbFacade.getInstance() .getDiskDao() .getAllForVm(getVm().getId())); runVdsCommand(VDSCommandType.Snapshot, new SnapshotVDSCommandParameters(getVm().getrun_on_vds().getValue(), getVm().getId(), ImagesHandler.filterImageDisks(pluggedDisks, false, true))); return null; } }); } catch (VdcBLLException e) { if (e.getErrorCode() == VdcBllErrors.SNAPSHOT_FAILED) { getParameters().setTaskGroupSuccess(false); log.errorFormat("Wasn't able to live snpashot due to error: {0}, rolling back.", ExceptionUtils.getMessage(e)); revertToActiveSnapshot(createdSnapshotId); } else { throw e; } } }

Target:
protected void performLiveSnapshot(Guid createdSnapshotId) { try { TransactionSupport.executeInScope(TransactionScopeOption.Suppress, new TransactionMethod<Void>() { @Override public Void runInTransaction() { List<Disk> pluggedDisks = VmRunHandler.getInstance().getPluggedDisks(getVm()); runVdsCommand(VDSCommandType.Snapshot, new SnapshotVDSCommandParameters(getVm().getrun_on_vds().getValue(), getVm().getId(), ImagesHandler.filterImageDisks(pluggedDisks, false, true))); return null; } }); } catch (VdcBLLException e) { if (e.getErrorCode() == VdcBllErrors.SNAPSHOT_FAILED) { getParameters().setTaskGroupSuccess(false); log.errorFormat("Wasn't able to live snpashot due to error: {0}, rolling back.", ExceptionUtils.getMessage(e)); revertToActiveSnapshot(createdSnapshotId); } else { throw e; } } }
Source:
public void onNewIntent(Intent intent) { super.onNewIntent(intent); if(intent.getAction().equals(ACTION_VIEW) && intent.getData().getHost().equals("android.owncloud.com")) { getOAuth2AccessTokenFromCapturedRedirection(intent.getData()); } }

Target:
public void onNewIntent(Intent intent) { super.onNewIntent(intent); if(intent.getAction().equals(ACTION_VIEW)) { getOAuth2AccessTokenFromCapturedRedirection(intent.getData()); } }
Source:
public void testGetUndefined() { String result = DlmsUnitTypeDto.getUnit(0); Assert.assertTrue("UNDEFINED".equals(result)); result = DlmsUnitTypeDto.getUnit(100); Assert.assertTrue("UNDEFINED".equals(result)); }

Target:
public void testGetUndefined() { String result = DlmsUnitTypeDto.getUnit(0); assertEquals("UNDEFINED", result); result = DlmsUnitTypeDto.getUnit(100); }
Source:
protected boolean setAndValidateDiskProfiles() { if (getDiskImageInfo() != null && DiskStorageType.IMAGE == getDiskImageInfo().getDiskStorageType()) { Map<DiskImage, Guid> map = new HashMap<>(); map.put(getDiskImageInfo(), getStorageDomainId()); return validate(DiskProfileHelper.setAndValidateDiskProfiles(map)); } return true; }

Target:
protected boolean setAndValidateDiskProfiles() { return validate(DiskProfileHelper.setAndValidateDiskProfiles(Collections.singletonMap(getDiskImageInfo(), getStorageDomainId()))); }
Source:
public WorkspaceImpl createWorkspace( WorkspaceConfig config, String namespace, @Nullable Map<String, String> attributes) throws ServerException, NotFoundException, ConflictException, ValidationException { TracingTags.USER_ID.set(() -> EnvironmentContext.getCurrent().getSubject().getUserId()); requireNonNull(config, "Required non-null config"); requireNonNull(namespace, "Required non-null namespace"); validator.validateConfig(config); if (attributes != null) { validator.validateAttributes(attributes); } WorkspaceImpl workspace = doCreateWorkspace(config, accountManager.getByName(namespace), attributes, false); TracingTags.WORKSPACE_ID.set(workspace.getId()); return workspace; }

Target:
public WorkspaceImpl createWorkspace( WorkspaceConfig config, String namespace, @Nullable Map<String, String> attributes) throws ServerException, NotFoundException, ConflictException, ValidationException { TracingTags.STACK_ID.set(() -> attributes.getOrDefault("stackId", "no stack")); requireNonNull(config, "Required non-null config"); requireNonNull(namespace, "Required non-null namespace"); validator.validateConfig(config); if (attributes != null) { validator.validateAttributes(attributes); } WorkspaceImpl workspace = doCreateWorkspace(config, accountManager.getByName(namespace), attributes, false); TracingTags.WORKSPACE_ID.set(workspace.getId()); return workspace; }
Source:
abstract void connect(InetSocketAddress addr) throws IOException; abstract SocketAddress getRemoteSocketAddress(); abstract SocketAddress getLocalSocketAddress(); abstract void cleanup(); abstract void packetAdded(); abstract void onClosing(); abstract void saslCompleted(); abstract void connectionPrimed(); abstract void doTransport(int waitTimeOut, List<Packet> pendingQueue, ClientCnxn cnxn) throws IOException, InterruptedException; abstract void testableCloseSocket() throws IOException; abstract void close(); abstract void sendPacket(Packet p) throws IOException; public ZKClientConfig getClientConfig() { return clientConfig; }

Target:
abstract void connect(InetSocketAddress addr) throws IOException; abstract SocketAddress getRemoteSocketAddress(); abstract SocketAddress getLocalSocketAddress(); abstract void cleanup(); abstract void packetAdded(); abstract void onClosing(); abstract void saslCompleted(); abstract void connectionPrimed(); abstract void doTransport(int waitTimeOut, List<Packet> pendingQueue, ClientCnxn cnxn) throws IOException, InterruptedException; abstract void testableCloseSocket() throws IOException; abstract void close(); abstract void sendPacket(Packet p) throws IOException; protected void initProperties() { packetLen = Integer.getInteger( clientConfig.getProperty(ZKConfig.JUTE_MAXBUFFER), ZKClientConfig.CLIENT_MAX_PACKET_LENGTH_DEFAULT); if (LOG.isDebugEnabled()) { LOG.debug("{} is {}", ZKConfig.JUTE_MAXBUFFER, packetLen); } }
Source:
protected Builder() { super(EtcdApi.class); id("etcd").name("Etcd API").identityName("Optional Username").defaultIdentity("Optional Username and Password") .documentation(URI.create("<LINK_0>")) .version(API_VERSION).buildVersion(BUILD_VERSION).defaultEndpoint("<LINK_1>") .defaultProperties(EtcdApiMetadata.defaultProperties()) .defaultModules(ImmutableSet.<Class<? extends Module>> of(EtcdHttpApiModule.class)); }

Target:
protected Builder() { super(EtcdApi.class); id("etcd"). name("Etcd API"). identityName("Optional Username"). credentialName("Optional Password"). defaultIdentity("N/A"). defaultCredential("N/A"). documentation(URI.create("<LINK_0>")). version(API_VERSION). buildVersion(BUILD_VERSION). defaultEndpoint("<LINK_1>"). defaultProperties(EtcdApiMetadata.defaultProperties()). defaultModules(ImmutableSet.<Class<? extends Module>> of(EtcdHttpApiModule.class)); }
Source:
public void startStripe(InputStreamSources dictionaryStreamSources, List<ColumnEncoding> encoding) throws IOException { ColumnEncodingKind kind = encoding.get(streamDescriptor.getStreamId()) .getColumnEncodingForSequence(streamDescriptor.getSequence()) .getColumnEncodingKind(); if (kind == DIRECT || kind == DIRECT_V2 || kind == DWRF_DIRECT) { currentReader = directReader; } else if (kind == DWRF_MAP_FLAT) { currentReader = flattenedReader; } else { throw new IllegalArgumentException("Unsupported encoding " + kind); } currentReader.startStripe(dictionaryStreamSources, encoding); }

Target:
public void startStripe(InputStreamSources dictionaryStreamSources, List<ColumnEncoding> encoding) throws IOException { ColumnEncodingKind kind = encoding.get(streamDescriptor.getStreamId()) .getColumnEncoding(streamDescriptor.getSequence()) .getColumnEncodingKind(); if (kind == DIRECT || kind == DIRECT_V2 || kind == DWRF_DIRECT) { currentReader = directReader; } else if (kind == DWRF_MAP_FLAT) { currentReader = flatReader; } else { throw new IllegalArgumentException("Unsupported encoding " + kind); } currentReader.startStripe(dictionaryStreamSources, encoding); }
Source:
public void deleteStory(String storyId) { m_db.deleteStory(storyId); }

Target:
public void deleteStory(String storyId) { m_db.deleteStory(storyId); m_storyList.remove(storyId); PublishStoryListChanged(); }
Source:
public void populate(ICube cube) { tryInit(vanilla, world); Random rand = getChunkSpecificRandom(cube.getX(), cube.getZ()); CubeGeneratorsRegistry.populateVanillaCubic(world, rand, cube); if (cube.getY() < 0 || cube.getY() >= worldHeightCubes) { return; } if (cube.getY() >= 0 && cube.getY() < worldHeightCubes) { for (int y = worldHeightCubes - 1; y >= 0; y--) { ((ICubicWorldInternal) world).getCubeFromCubeCoords(cube.getX(), y, cube.getZ()).setPopulated(true); } try { vanilla.populate(cube.getX(), cube.getZ()); } catch (IllegalArgumentException ex) { StackTraceElement[] stack = ex.getStackTrace(); if (stack == null || stack.length < 1 || !stack[0].getClassName().equals(Random.class.getName()) || !stack[0].getMethodName().equals("nextInt")) { throw ex; } else { CubicChunks.LOGGER.error("Error while populating. Likely known mod issue, ignoring...", ex); } } GameRegistry.generateWorld(cube.getX(), cube.getZ(), world, vanilla, world.getChunkProvider()); } }

Target:
public void populate(ICube cube) { tryInit(vanilla, world); Random rand = getCubeSpecificRandom(cube.getX(), cube.getY(), cube.getZ()); CubeGeneratorsRegistry.populateVanillaCubic(world, rand, cube); if (cube.getY() < 0 || cube.getY() >= worldHeightCubes) { return; } if (cube.getY() >= 0 && cube.getY() < worldHeightCubes) { for (int y = worldHeightCubes - 1; y >= 0; y--) { ((ICubicWorldInternal) world).getCubeFromCubeCoords(cube.getX(), y, cube.getZ()).setPopulated(true); } try { vanilla.populate(cube.getX(), cube.getZ()); } catch (IllegalArgumentException ex) { StackTraceElement[] stack = ex.getStackTrace(); if (stack == null || stack.length < 1 || !stack[0].getClassName().equals(Random.class.getName()) || !stack[0].getMethodName().equals("nextInt")) { throw ex; } else { CubicChunks.LOGGER.error("Error while populating. Likely known mod issue, ignoring...", ex); } } GameRegistry.generateWorld(cube.getX(), cube.getZ(), world, vanilla, world.getChunkProvider()); } }
Source:
public void testCloseWithCancellation() throws Exception { cnt = 0; boolean failed = false; startGrids(3); Ignite g4 = grid(2); IgniteDataStreamer<Object, Object> dataLdr = g4.dataStreamer(DEFAULT_CACHE_NAME); dataLdr.perNodeBufferSize(32); List<IgniteFuture> futures = new ArrayList<>(501); for (int i = 0; i < 500; i++) futures.add(dataLdr.addData(i, i)); try { dataLdr.close(true); } catch (CacheException ignored) { failed = true; } finally { assertTrue(failed); for (IgniteFuture fut : futures) assertTrue(fut.isDone()); } }

Target:
public void testCloseWithCancellation() throws Exception { cnt = 0; startGrids(2); Ignite g1 = grid(1); List<IgniteFuture> futures = new ArrayList<>(); IgniteDataStreamer<Object, Object> dataLdr = g1.dataStreamer(DEFAULT_CACHE_NAME); for (int i = 0; i < 100; i++) futures.add(dataLdr.addData(i, i)); try { dataLdr.close(true); } catch (CacheException e) { } for (IgniteFuture fut : futures) assertTrue(fut.isDone()); }
Source:
public MessageContext receive() { boolean connectionSuccess = checkAndTryConnect(); if (!connectionSuccess) { throw new SynapseException(idString + "Error while connecting to JMS provider. " + MessageProcessorConstants.STORE_CONNECTION_ERROR); } try { Message message = consumer.receive(500); if (message == null) { return null; } if (!(message instanceof ObjectMessage)) { logger.warn("JMS Consumer " + getId() + " did not receive a javax.jms.ObjectMessage"); message.acknowledge(); return null; } ObjectMessage msg = (ObjectMessage) message; String messageId = msg.getStringProperty(Constants.OriginalMessageID); if (!(msg.getObject() instanceof StorableMessage)) { logger.warn("JMS Consumer " + getId() + " did not receive a valid message."); message.acknowledge(); return null; } StorableMessage storableMessage = (StorableMessage) msg.getObject(); org.apache.axis2.context.MessageContext axis2Mc = store.newAxis2Mc(); MessageContext synapseMc = store.newSynapseMc(axis2Mc); synapseMc = MessageConverter.toMessageContext(storableMessage, axis2Mc, synapseMc); updateCache(message, synapseMc, messageId, false); if (logger.isDebugEnabled()) { logger.debug(getId() + " Received MessageId:" + messageId + " priority:" + message.getJMSPriority()); } return synapseMc; } catch (JMSException e) { logger.error("Cannot fetch messages from Store " + store.getName()); updateCache(null, null, "", true); cleanup(); return receive(); } }

Target:
public MessageContext receive() { boolean connectionSuccess = checkAndTryConnect(); if (!connectionSuccess) { throw new SynapseException(idString + "Error while connecting to JMS provider. " + MessageProcessorConstants.STORE_CONNECTION_ERROR); } try { Message message = consumer.receive(5000); if (message == null) { return null; } if (!(message instanceof ObjectMessage)) { logger.warn("JMS Consumer " + getId() + " did not receive a javax.jms.ObjectMessage"); message.acknowledge(); return null; } ObjectMessage msg = (ObjectMessage) message; String messageId = msg.getStringProperty(Constants.OriginalMessageID); if (!(msg.getObject() instanceof StorableMessage)) { logger.warn("JMS Consumer " + getId() + " did not receive a valid message."); message.acknowledge(); return null; } StorableMessage storableMessage = (StorableMessage) msg.getObject(); org.apache.axis2.context.MessageContext axis2Mc = store.newAxis2Mc(); MessageContext synapseMc = store.newSynapseMc(axis2Mc); synapseMc = MessageConverter.toMessageContext(storableMessage, axis2Mc, synapseMc); updateCache(message, synapseMc, messageId, false); if (logger.isDebugEnabled()) { logger.debug(getId() + " Received MessageId:" + messageId + " priority:" + message.getJMSPriority()); } return synapseMc; } catch (JMSException e) { logger.error("Cannot fetch messages from Store " + store.getName()); updateCache(null, null, "", true); cleanup(); return receive(); } }
Source:
public <R> R access(Function<VersionLockedObject<T>, Boolean> directAccessCheckFunction, Consumer<VersionLockedObject<T>> updateFunction, Function<T, R> accessFunction) { long ts = lock.tryOptimisticRead(); if (ts != 0) { try (Timer.Context optimistReadDuration = VloMetricsHelper.getOptimisticReadContext()) { if (directAccessCheckFunction.apply(this)) { log.trace("Access Direct (optimistic-read) access at {}", this, getVersionUnsafe()); R ret = accessFunction.apply(object.getContext(ICorfuExecutionContext.DEFAULT)); long versionForCorrectness = getVersionUnsafe(); if (lock.validate(ts)) { correctnessLogger.trace("Version, {}", versionForCorrectness); return ret; } } } catch (Exception e) { if (lock.validate(ts)) { throw e; } log.warn("Access Direct (optimistic-read) exception, upgrading lock. Exception ", this, e); } } try (Timer.Context updateObjectReadDuration = VloMetricsHelper.getUpdatedObjectReadContext()) { ts = lock.tryConvertToWriteLock(ts); if (ts == 0) { ts = lock.writeLock(); } if (directAccessCheckFunction.apply(this)) { log.trace("Access Direct (writelock) access at {}", this, getVersionUnsafe()); return accessFunction.apply(object.getContext(ICorfuExecutionContext.DEFAULT)); } updateFunction.accept(this); correctnessLogger.trace("Version, {}", getVersionUnsafe()); log.trace("Access Updated (writelock) access at {}", this, getVersionUnsafe()); return accessFunction.apply(object.getContext(ICorfuExecutionContext.DEFAULT)); } finally { lock.unlock(ts); } }

Target:
public <R> R access(Function<VersionLockedObject<T>, Boolean> directAccessCheckFunction, Consumer<VersionLockedObject<T>> updateFunction, Function<T, R> accessFunction) { long ts = lock.tryOptimisticRead(); if (ts != 0) { try (Timer.Context optimistReadDuration = VloMetricsHelper.getOptimisticReadContext()) { if (directAccessCheckFunction.apply(this)) { log.trace("Access Direct (optimistic-read) access at {}", this, getVersionUnsafe()); R ret = accessFunction.apply(object.getContext(ICorfuExecutionContext.DEFAULT)); long versionForCorrectness = getVersionUnsafe(); if (lock.validate(ts)) { correctnessLogger.trace("Version, {}", versionForCorrectness); return ret; } } } catch (Exception e) { if (lock.validate(ts)) { throw e; } log.warn("Access Direct (optimistic-read) exception, upgrading lock. Exception ", this, e); } } try (Timer.Context updateObjectReadDuration = VloMetricsHelper.getUpdatedObjectReadContext()) { ts = lock.tryConvertToWriteLock(ts); if (ts == 0) { ts = lock.writeLock(); } if (directAccessCheckFunction.apply(this)) { log.trace("Access Direct (writelock) access at {}", this, getVersionUnsafe()); R ret = accessFunction.apply(object.getContext(ICorfuExecutionContext.DEFAULT)); correctnessLogger.trace("Version, {}", getVersionUnsafe()); return ret; } updateFunction.accept(this); correctnessLogger.trace("Version, {}", getVersionUnsafe()); log.trace("Access Updated (writelock) access at {}", this, getVersionUnsafe()); return accessFunction.apply(object.getContext(ICorfuExecutionContext.DEFAULT)); } finally { lock.unlock(ts); } }
Source:
private void loadSmooshFileMetadata() { try { byte[] metadata = indexFileSource.readFile(SMOOSH_METADATA_FILE_NAME); BufferedReader in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(metadata))); String line = in.readLine(); if (line == null) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: first line should be version,maxChunkSize,numChunks, got null.")); } String[] splits = line.split(","); if (!"v1".equals(splits[0])) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: unknown version[%s], v1 is all I know.", splits[0])); } if (splits.length != 3) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: wrong number of splits[%d] in line[%s]", splits.length, line)); } numFiles = Integer.valueOf(splits[2]); while ((line = in.readLine()) != null) { splits = line.split(","); if (splits.length != 4) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: wrong number of splits[%d] in line[%s]", splits.length, line)); } columnSmoosh.put(splits[0], new SmooshFileMetadata(Integer.parseInt(splits[1]), Integer.parseInt(splits[2]), Integer.parseInt(splits[3]))); } } catch (IOException e) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, e); } }

Target:
private void loadSmooshFileMetadata() { try { byte[] metadata = indexFileSource.readFile(SMOOSH_METADATA_FILE_NAME); BufferedReader in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(metadata))); String line = in.readLine(); if (line == null) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: first line should be version,maxChunkSize,numChunks, got null.")); } String[] splits = line.split(","); if (!"v1".equals(splits[0])) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: unknown version[%s], v1 is all I know.", splits[0])); } if (splits.length != 3) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: wrong number of splits[%d] in line[%s]", splits.length, line)); } while (true) { line = in.readLine(); if (line == null) { break; } splits = line.split(","); if (splits.length != 4) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: wrong number of splits[%d] in line[%s]", splits.length, line)); } columnSmoosh.put(splits[0], new SmooshFileMetadata(Integer.parseInt(splits[1]), Integer.parseInt(splits[2]), Integer.parseInt(splits[3]))); } } catch (IOException e) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, e); } }
Source:
public void tearDown() { GuidService.deleteGuid(); System.clearProperty("go.agent.websocket.enabled"); System.clearProperty("go.agent.console.logs.websocket.enabled"); }

Target:
public void tearDown() { GuidService.deleteGuid(); System.clearProperty(SystemEnvironment.WEBSOCKET_ENABLED.propertyName()); System.clearProperty(SystemEnvironment.CONSOLE_LOGS_THROUGH_WEBSOCKET_ENABLED.propertyName()); }
Source:
private void refreshVdsRunTimeInfo() { boolean isVdsUpOrGoingToMaintenance = _vds.getStatus() == VDSStatus.Up || _vds.getStatus() == VDSStatus.PreparingForMaintenance || _vds.getStatus() == VDSStatus.Error || _vds.getStatus() == VDSStatus.NonOperational; try { if (isVdsUpOrGoingToMaintenance) { if (_vdsManager.getRefreshStatistics() || _vds.getStatus() == VDSStatus.PreparingForMaintenance) { refreshVdsStats(); ResourceManager.getInstance().getEventListener().updateSchedulingStats(_vds); } else { } } else { final AtomicBoolean processHardwareNeededAtomic = new AtomicBoolean(); VDSStatus refreshReturnStatus = _vdsManager.refreshCapabilities(processHardwareNeededAtomic, _vds); processHardwareCapsNeeded = processHardwareNeededAtomic.get(); refreshedCapabilities = true; if (refreshReturnStatus != VDSStatus.NonOperational) { _vdsManager.setStatus(VDSStatus.Up, _vds); } _saveVdsDynamic = true; } beforeFirstRefreshTreatment(isVdsUpOrGoingToMaintenance); refreshVmStats(); } catch (VDSRecoveringException e) { if (_vds.getStatus() != VDSStatus.PreparingForMaintenance) { throw e; } } moveVDSToMaintenanceIfNeeded(); }

Target:
private void refreshVdsRunTimeInfo() { boolean isVdsUpOrGoingToMaintenance = _vds.getStatus() == VDSStatus.Up || _vds.getStatus() == VDSStatus.PreparingForMaintenance || _vds.getStatus() == VDSStatus.Error || _vds.getStatus() == VDSStatus.NonOperational; try { if (isVdsUpOrGoingToMaintenance) { if (_vdsManager.getRefreshStatistics() || _vds.getStatus() == VDSStatus.PreparingForMaintenance) { refreshVdsStats(); } else { } } else { final AtomicBoolean processHardwareNeededAtomic = new AtomicBoolean(); VDSStatus refreshReturnStatus = _vdsManager.refreshCapabilities(processHardwareNeededAtomic, _vds); processHardwareCapsNeeded = processHardwareNeededAtomic.get(); refreshedCapabilities = true; if (refreshReturnStatus != VDSStatus.NonOperational) { _vdsManager.setStatus(VDSStatus.Up, _vds); } _saveVdsDynamic = true; } beforeFirstRefreshTreatment(isVdsUpOrGoingToMaintenance); refreshVmStats(); } catch (VDSRecoveringException e) { if (_vds.getStatus() != VDSStatus.PreparingForMaintenance) { throw e; } } moveVDSToMaintenanceIfNeeded(); }
Source:
public List<String> getPartitionDimensions() { if (partitionDimension != null) { return ImmutableList.of(partitionDimension); } else { return null; } }

Target:
public List<String> getPartitionDimensions() { return ImmutableList.of(); }