auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int saveResource(String resourcePath, boolean replace) { if (resourcePath == null || resourcePath.equals("")) { throw new IllegalArgumentException("ResourcePath cannot be null or empty"); } resourcePath = resourcePath.replace('\\', '/'); InputStream in = getResource(resourcePath); if (in == null) { throw new IllegalArgumentException("The embedded resource '" + resourcePath + "' cannot be found in " + file); } File outFile = new File(dataFolder, resourcePath); int lastIndex = resourcePath.lastIndexOf('/'); File outDir = new File(dataFolder, resourcePath.substring(0, lastIndex >= 0 ? lastIndex : 0)); if (!outDir.exists()) { outDir.mkdirs(); } try { if (!outFile.exists() || replace) { OutputStream out = new FileOutputStream(outFile); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } out.close(); in.close(); return 0; } else { logger.log(Level.WARNING, "Could not save " + outFile.getName() + " to " + outFile + " because " + outFile.getName() + " already exists."); return 1; } } catch (IOException ex) { logger.log(Level.SEVERE, "Could not save " + outFile.getName() + " to " + outFile, ex); return 2; } }

Target:
public resourceSaveStatus saveResource(String resourcePath, boolean replace) { if (resourcePath == null || resourcePath.equals("")) { throw new IllegalArgumentException("ResourcePath cannot be null or empty"); } resourcePath = resourcePath.replace('\\', '/'); InputStream in = getResource(resourcePath); if (in == null) { throw new IllegalArgumentException("The embedded resource '" + resourcePath + "' cannot be found in " + file); } File outFile = new File(dataFolder, resourcePath); int lastIndex = resourcePath.lastIndexOf('/'); File outDir = new File(dataFolder, resourcePath.substring(0, lastIndex >= 0 ? lastIndex : 0)); if (!outDir.exists()) { outDir.mkdirs(); } try { if (!outFile.exists() || replace) { OutputStream out = new FileOutputStream(outFile); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } out.close(); in.close(); return resourceSaveStatus.SUCESS; } else { logger.log(Level.WARNING, "Could not save " + outFile.getName() + " to " + outFile + " because " + outFile.getName() + " already exists."); return resourceSaveStatus.EXISTS; } } catch (IOException ex) { logger.log(Level.SEVERE, "Could not save " + outFile.getName() + " to " + outFile, ex); return resourceSaveStatus.FAIL; } }
Source:
ServerNodeKey( Properties connProperties ) { m_connProperties = new Properties( ); for ( String propertyName : connProperties.stringPropertyNames( ) ) { System.out.println( "propertyName :: " + propertyName ); System.out.println( "connProperties.getProperty( propertyName ) :: " + connProperties.getProperty( propertyName ) ); m_connProperties.setProperty( propertyName, connProperties.getProperty( propertyName ) ); if(propertyName.equals( "mongoURI" ) ) { MongoClientURI mongoUri = getMongoURI( connProperties ); if(mongoUri.getUsername()!=null) m_connProperties.setProperty(USERNAME_PROP,mongoUri.getUsername()); } } }

Target:
ServerNodeKey( Properties connProperties ) { m_connProperties = new Properties( ); for ( String propertyName : connProperties.stringPropertyNames( ) ) { System.out.println( "propertyName :: " + propertyName ); System.out.println( "connProperties.getProperty( propertyName ) :: " + connProperties.getProperty( propertyName ) ); m_connProperties.setProperty( propertyName, connProperties.getProperty( propertyName ) ); if ( propertyName.equals( MONGO_URI_PROP ) ) { MongoClientURI mongoUri = getMongoURI( connProperties ); if ( mongoUri.getUsername( ) != null ) { m_connProperties.setProperty( USERNAME_PROP, mongoUri.getUsername( ) ); } } } }
Source:
public Mono<Void> deadLetter(ServiceBusReceivedMessage message, DeadLetterOptions deadLetterOptions) { if (deadLetterOptions != null) { return updateDisposition(message, DispositionStatus.SUSPENDED, deadLetterOptions.getDeadLetterReason(), deadLetterOptions.getDeadLetterErrorDescription(), deadLetterOptions.getPropertiesToModify()); } else { return updateDisposition(message, DispositionStatus.SUSPENDED, null, null, null); } }

Target:
public Mono<Void> deadLetter(ServiceBusReceivedMessage message, DeadLetterOptions deadLetterOptions) { Objects.requireNonNull(deadLetterOptions, "'deadLetterOptions' cannot be null."); return updateDisposition(message, DispositionStatus.SUSPENDED, deadLetterOptions.getDeadLetterReason(), deadLetterOptions.getDeadLetterErrorDescription(), deadLetterOptions.getPropertiesToModify()); }
Source:
public ExpandableRecyclerAdapterHelper(List<Object> itemList) { sCurrentId = INITIAL_STABLE_ID; generateHelperItemList(itemList); }

Target:
public ExpandableRecyclerAdapterHelper(List<Object> itemList) { generateHelperItemList(itemList); }
Source:
protected Object execute(Object blobInput, String chainOrOperationId, CoreSession session, Map<String, Object> contextParams, Map<String, Object> operationParams) throws ClientException { if (contextParams == null) { contextParams = new HashMap<>(); } if (operationParams == null) { operationParams = new HashMap<>(); } OperationContext ctx = new OperationContext(session); AutomationServer server = Framework.getService(AutomationServer.class); RestBinding binding = server.getOperationBinding(chainOrOperationId); if (binding != null && binding.isAdministrator()) { Principal principal = ctx.getPrincipal(); if (!(principal instanceof NuxeoPrincipal && ((NuxeoPrincipal) principal).isAdministrator())) { String message = "Not allowed. You must be administrator to use this operation"; log.error(message); throw new WebSecurityException(message); } } ctx.setInput(blobInput); ctx.putAll(contextParams); try { Object result = null; AutomationService as = Framework.getLocalService(AutomationService.class); result = as.run(ctx, chainOrOperationId, operationParams); return result; } catch (Exception e) { log.error("Error while executing automation batch ", e); throw ClientException.wrap(e); } }

Target:
protected Object execute(Object blobInput, String chainOrOperationId, CoreSession session, Map<String, Object> contextParams, Map<String, Object> operationParams) throws ClientException { if (contextParams == null) { contextParams = new HashMap<>(); } if (operationParams == null) { operationParams = new HashMap<>(); } OperationContext ctx = new OperationContext(session); AutomationServer server = Framework.getService(AutomationServer.class); RestBinding binding = server.getOperationBinding(chainOrOperationId); if (binding != null && binding.isAdministrator()) { Principal principal = ctx.getPrincipal(); if (!(principal instanceof NuxeoPrincipal && ((NuxeoPrincipal) principal).isAdministrator())) { String message = "Not allowed. You must be administrator to use this operation"; log.error(message + ": " + chainOrOperationId); throw new WebSecurityException(message); } } ctx.setInput(blobInput); ctx.putAll(contextParams); try { Object result = null; AutomationService as = Framework.getLocalService(AutomationService.class); result = as.run(ctx, chainOrOperationId, operationParams); return result; } catch (Exception e) { log.error("Error while executing automation batch ", e); throw ClientException.wrap(e); } }
Source:
public SAMFileWriter makeWriter(final SAMFileHeader header, final boolean presorted, final File outputFile, final File referenceFasta) { final String filename = outputFile.getName(); if (filename.endsWith(SamReader.Type.CRAM_TYPE.fileExtension())) { if (referenceFasta == null && Defaults.REFERENCE_FASTA == null) { if (Defaults.USE_CRAM_REF_DOWNLOAD) { log.warn("Reference file is not provided, remote sequence service may be used when writing CRAM file: " + outputFile.getAbsolutePath()); } else { log.warn("Neither reference file nor sequence service are provided when writing CRAM file: " + outputFile.getAbsolutePath()); } } return makeCRAMWriter(header, presorted, outputFile, referenceFasta); } if (filename.endsWith(SamReader.Type.SAM_TYPE.fileExtension())) { return makeSAMWriter(header, presorted, outputFile); } if (!filename.endsWith(SamReader.Type.BAM_TYPE.fileExtension())) { log.warn("Unknown file extension, assuming BAM format when writing file: " + outputFile.getAbsolutePath()); } return makeBAMWriter(header, presorted, outputFile); }

Target:
public SAMFileWriter makeWriter(final SAMFileHeader header, final boolean presorted, final File outputFile, final File referenceFasta) { return makeWriter(header, presorted, IOUtil.toPath( outputFile ), IOUtil.toPath(referenceFasta)); }
Source:
public void setup() { System.setProperty("jenkins.model.Jenkins.SHOW_STACK_TRACE", "false"); System.setProperty("org.kohsuke.stapler.HttpResponses.SHOW_STACK_TRACE", "false"); }

Target:
public void setup() { clearProperties(); }
Source:
public static boolean isUserNameValid(final String username, ConstraintValidatorContext context) { String validCharacters = "[a-zA-ZÀ-ÿ0-9\\_\\-\\."; validCharacters += "\\u00C0-\\u017F"; validCharacters += "\\x{4e00}-\\x{9fa5}"; validCharacters += "]*"; Pattern p = Pattern.compile(validCharacters); Matcher m = p.matcher(username); return m.matches(); }

Target:
public static boolean isUserNameValid(final String username, ConstraintValidatorContext context) { if (username == null) { return false; } String validCharacters = "[a-zA-Z0-9\\_\\-\\."; validCharacters += "]"; validCharacters += "{2,60}"; Pattern p = Pattern.compile(validCharacters); Matcher m = p.matcher(username); return m.matches(); }
Source:
public Optional<IndexingExpectations<BigDecimal>> getIndexingExpectations() { return Optional.of( new IndexingExpectations<>( BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.TEN, nextUp( BigDecimal.ONE ) , nextDown( BigDecimal.ONE ), BigDecimal.valueOf( 42.42 ), BigDecimal.valueOf( 1584514514.000000184 ), BigDecimal.valueOf( Double.MAX_VALUE ), BigDecimal.valueOf( Double.MAX_VALUE ), scale( Long.MAX_VALUE ), scale( Long.MIN_VALUE ) ) ); }

Target:
public Optional<IndexingExpectations<BigDecimal>> getIndexingExpectations() { return Optional.of( new IndexingExpectations<>( BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.TEN, nextUp( BigDecimal.ONE ) , nextDown( BigDecimal.ONE ), BigDecimal.valueOf( 42.42 ), BigDecimal.valueOf( 1584514514.000000184 ), scaled( Long.MAX_VALUE ), scaled( Long.MIN_VALUE ), new BigDecimal( "-0.00000000012" ), BigDecimal.valueOf( 0.0000000001 ) ) ); }
Source:
public void setConfigValue(ConfigValues enumValue, DomainsConfigurationEntry entry, boolean passedAsValue) throws ManageDomainsResult { log.info("Setting value for " + enumValue.toString() + " to " + entry.getDomainsLoggingEntry()); File passFile = null; try { passFile = createPassFile(entry.getDomainsConfigurationEntry()); Process engineConfigProcess = Runtime.getRuntime().exec(engineConfigExecutable + " -s " + enumValue.name() + ((passedAsValue) ? "=" + entry.getDomainsConfigurationEntry() : " --admin-pass-file " + passFile.getAbsolutePath()) + " -p " + engineConfigProperties); int retVal = engineConfigProcess.waitFor(); if (retVal != 0) { throw new ManageDomainsResult(ManageDomainsResultEnum.FAILED_SETTING_CONFIGURATION_VALUE_FOR_OPTION, "Verify Connection to Db, Check if DB service is running", enumValue.name()); } } catch (Throwable e) { throw new ManageDomainsResult(ManageDomainsResultEnum.FAILED_SETTING_CONFIGURATION_VALUE_FOR_OPTION_WITH_DETAILS, "Verify Connection to Db, Check if DB service is running", new String[] { enumValue.name(), e.getMessage() }); } finally { disposePassFile(passFile); } }

Target:
public void setConfigValue(ConfigValues enumValue, DomainsConfigurationEntry entry, boolean passedAsValue) throws ManageDomainsResult { log.info("Setting value for " + enumValue.toString() + " to " + entry.getDomainsLoggingEntry()); File passFile = null; try { passFile = createPassFile(entry.getDomainsConfigurationEntry()); Process engineConfigProcess = Runtime.getRuntime().exec(engineConfigExecutable + " -s " + enumValue.name() + ((passedAsValue) ? "=" + entry.getDomainsConfigurationEntry() : " --admin-pass-file " + passFile.getAbsolutePath()) + " -p " + engineConfigProperties); int retVal = engineConfigProcess.waitFor(); if (retVal != 0) { throw new ManageDomainsResult(ManageDomainsResultEnum.FAILED_SETTING_CONFIGURATION_VALUE_FOR_OPTION, enumValue.name()); } } catch (Throwable e) { throw new ManageDomainsResult(ManageDomainsResultEnum.FAILED_SETTING_CONFIGURATION_VALUE_FOR_OPTION_WITH_DETAILS, new String[] { enumValue.name(), e.getMessage() }); } finally { disposePassFile(passFile); } }
Source:
private String getRandomString() { String randomAppId; byte[] array = new byte[7]; new Random().nextBytes(array); randomAppId = new String(array, Charset.forName("UTF-8")); return randomAppId; }

Target:
private String getRandomString() { return UUID.randomUUID().toString(); }
Source:
public void configure(ResourceInfo resourceInfo, FeatureContext context) { Config config = ConfigProvider.getConfig(); Optional<String> skipPattern = config.getOptionalValue("mp.opentracing.server.skip-pattern", String.class); Optional<String> operationNameProvider = config.getOptionalValue("mp.opentracing.server.operation-name-provider", String.class); Tracer tracer; Object tracerObject = servletContext.getAttribute(TracerInitializer.SMALLRYE_OPENTRACING_TRACER); if (tracerObject instanceof Tracer) { tracer = (Tracer) tracerObject; } else { TracingLogger.ROOT_LOGGER.noTracerAvailable(); return; } ServerTracingDynamicFeature.Builder builder = new ServerTracingDynamicFeature.Builder(tracer) .withOperationNameProvider(ClassNameOperationName.newBuilder()) .withTraceSerialization(false); if (skipPattern.isPresent()) { builder.withSkipPattern(skipPattern.get()); } if (operationNameProvider.isPresent()) { if ("http-path".equalsIgnoreCase(operationNameProvider.get())) { builder.withOperationNameProvider(OperationNameProvider.WildcardOperationName.newBuilder()); } else if (!"class-method".equalsIgnoreCase(operationNameProvider.get())) { TracingLogger.ROOT_LOGGER.warn("Provided operation name does not match http-path or class-method. Using default class-method."); } } ServerTracingDynamicFeature delegate = builder.build(); delegate.configure(resourceInfo, context); }

Target:
public void configure(ResourceInfo resourceInfo, FeatureContext context) { Config config = ConfigProvider.getConfig(); Optional<String> skipPattern = config.getOptionalValue("mp.opentracing.server.skip-pattern", String.class); Optional<String> operationNameProvider = config.getOptionalValue("mp.opentracing.server.operation-name-provider", String.class); Tracer tracer; Object tracerObject = servletContext.getAttribute(TracerInitializer.SMALLRYE_OPENTRACING_TRACER); if (tracerObject instanceof Tracer) { tracer = (Tracer) tracerObject; } else { TracingLogger.ROOT_LOGGER.noTracerAvailable(); return; } ServerTracingDynamicFeature.Builder builder = new ServerTracingDynamicFeature.Builder(tracer) .withOperationNameProvider(ClassNameOperationName.newBuilder()) .withTraceSerialization(false); if (skipPattern.isPresent()) { builder.withSkipPattern(skipPattern.get()); } if (operationNameProvider.isPresent()) { if ("http-path".equalsIgnoreCase(operationNameProvider.get())) { builder.withOperationNameProvider(OperationNameProvider.WildcardOperationName.newBuilder()); } else if (!"class-method".equalsIgnoreCase(operationNameProvider.get())) { TracingLogger.ROOT_LOGGER.wrongOperationNameProvider(); } } ServerTracingDynamicFeature delegate = builder.build(); delegate.configure(resourceInfo, context); }
Source:
public Response call() { long time = 0; while (time < waitTime) { String queryState = (String) query(format("SELECT state from system.runtime.queries" + " WHERE query = '%s' ORDER BY created DESC LIMIT 1", sqlStatement)).row(0).get(0); if (!queryState.equalsIgnoreCase("running")) { try { Thread.sleep(step); } catch (InterruptedException e) { e.printStackTrace(); return null; } time = time + step; } else { String queryId = (String) query(format("SELECT query_id from system.runtime.queries" + " WHERE query = '%s' ORDER BY created DESC LIMIT 1", sqlStatement)).row(0).get(0); return (new CancelQuery(queryId, serverAddress)).cancel(); } } return null; }

Target:
public Response call() { long endTime = System.currentTimeMillis() + WAIT_TIME; while (System.currentTimeMillis() < endTime && !Thread.currentThread().isInterrupted()) { QueryResult queryResult = query(format("SELECT state, query_id from system.runtime.queries" + " WHERE query = '%s' ORDER BY created DESC LIMIT 1", sqlStatement)); if (queryResult.getRowsCount() == 0) { sleepUninterruptibly(STEP, TimeUnit.MILLISECONDS); continue; } String queryState = (String) queryResult.row(0).get(0); String queryId = (String) queryResult.row(0).get(1); if (!queryState.equalsIgnoreCase("running")) { sleepUninterruptibly(STEP, TimeUnit.MILLISECONDS); } else { return queryCanceller.cancel(queryId); } } return null; }
Source:
public CellEditor createPropertyEditor(Composite parent) { CellEditor cellEditor = null; if (object instanceof EObject && getPermissionAuthority().canEditInstance((EObject) object)) { cellEditor = super.createPropertyEditor(parent); } return cellEditor; }

Target:
public CellEditor createPropertyEditor(Composite parent) { CellEditor cellEditor = null; if (!(object instanceof EObject) || getPermissionAuthority() != null && getPermissionAuthority().canEditInstance((EObject) object)) { cellEditor = super.createPropertyEditor(parent); } return cellEditor; }
Source:
public GpsNetInitiatedHandler(Context context, INetInitiatedListener netInitiatedListener, boolean isSuplEsEnabled) { mContext = context; if (netInitiatedListener == null) { throw new IllegalArgumentException("netInitiatedListener is null"); } else { mNetInitiatedListener = netInitiatedListener; } mIsSuplEsEnabled = isSuplEsEnabled; mLocationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE); mTelephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); mPhoneStateListener = new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if (DEBUG) Log.d(TAG, "onCallStateChanged(): "+"state is "+ state); if (state == TelephonyManager.CALL_STATE_IDLE) { mIsInEmergency = false; } } }; mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE); IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_NEW_OUTGOING_CALL); mContext.registerReceiver(mBroadcastReciever, intentFilter, null, mHandler); }

Target:
public GpsNetInitiatedHandler(Context context, INetInitiatedListener netInitiatedListener, boolean isSuplEsEnabled) { mContext = context; if (netInitiatedListener == null) { throw new IllegalArgumentException("netInitiatedListener is null"); } else { mNetInitiatedListener = netInitiatedListener; } mIsSuplEsEnabled = isSuplEsEnabled; mLocationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE); mTelephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); mPhoneStateListener = new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if (DEBUG) Log.d(TAG, "onCallStateChanged(): state is "+ state); if (state == TelephonyManager.CALL_STATE_IDLE) { mIsInEmergency = false; } } }; mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE); IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_NEW_OUTGOING_CALL); mContext.registerReceiver(mBroadcastReciever, intentFilter, null, mHandler); }
Source:
public ColumnVector() { this.isNull = new boolean[DEFAULT_VECTOR_LENGTH]; }

Target:
public ColumnVector() { this.isNull = new boolean[MAX_VECTOR_LENGTH]; }
Source:
public void setGroundAndAirSpeeds(double groundSpeed, double airSpeed, double climb) { this.groundSpeed = new org.droidplanner.core.helpers.units.Speed(groundSpeed); this.airSpeed = new org.droidplanner.core.helpers.units.Speed(airSpeed); this.verticalSpeed = new org.droidplanner.core.helpers.units.Speed(climb); double altitude = myDrone.getAltitude().getAltitude(); if(altitude + climb* COLLISION_SECONDS_BEFORE_COLLISION < 0 && climb < COLLISION_DANGEROUS_SPEED && altitude > COLLISION_SAFE_ALTITUDE){ myDrone.getState().setCollisionImminent(true); }else{ myDrone.getState().setCollisionImminent(false); } }

Target:
public void setGroundAndAirSpeeds(double groundSpeed, double airSpeed, double climb) { this.groundSpeed = new org.droidplanner.core.helpers.units.Speed(groundSpeed); this.airSpeed = new org.droidplanner.core.helpers.units.Speed(airSpeed); this.verticalSpeed = new org.droidplanner.core.helpers.units.Speed(climb); checkCollisionIsImminent(); }
Source:
private void processFallbackWindow( List<RowMetaAndData> list ) { if ( isProcessing.compareAndSet( false, true ) ) { if ( this.subject != null ) { this.subject.dispose(); this.subject = this.buffer.subscribe( bufferList -> processBufferWindow( bufferList ) ); } hasWindow.compareAndSet( false, true ); unSubscribeStarter(); setCacheWindow( list ); isProcessing.compareAndSet( true, false ); } }

Target:
private void processFallbackWindow( List<RowMetaAndData> list ) { if ( isProcessing.compareAndSet( false, true ) ) { if ( this.subject != null ) { this.subject.dispose(); this.subject = this.buffer.subscribe( bufferList -> processBufferWindow( bufferList ) ); } hasWindow.set( true ); unSubscribeStarter(); setCacheWindow( list ); isProcessing.set( false ); } }
Source:
BitMappedTrie<T> drop(int n) { if (n <= 0) { return this; } else if (n >= length()) { return empty(); } else { final int index = offset + n; final Object[] root = arePointingToSameLeaf(0, n) ? array : modifyLeaf(array, depthShift, index, Arrays::copyDrop, Identity); return new BitMappedTrie<T>(root, index, length() - n, depthShift).collapseHeight(); } }

Target:
BitMappedTrie<T> drop(int n) { if (n <= 0) { return this; } else if (n >= length()) { return empty(); } else { final int index = offset + n; final Object[] root = arePointingToSameLeaf(0, n) ? array : modifyLeaf(array, depthShift, index, Arrays::copyDrop, IDENTITY); return collapsed(root, index, length() - n, depthShift); } }
Source:
public WebSocketSession getSession(String sessionId) { if (isRunning()) { if (!isConnected()) { stop(); start(); } try { this.connectionLatch.await(this.connectionTimeout, TimeUnit.SECONDS); } catch (InterruptedException e) { logger.error("'clientSession' has not been established during 'openConnection'"); } } try { if (this.openConnectionException != null) { throw new IllegalStateException(this.openConnectionException); } Assert.state(this.clientSession != null, "'clientSession' has not been established. Consider to 'start' this container."); } catch (IllegalStateException e){ stop(); throw e; } return this.clientSession; }

Target:
public WebSocketSession getSession(String sessionId) { if (isRunning()) { if (!isConnected() && !this.connecting) { stop(); start(); } try { this.connectionLatch.await(this.connectionTimeout, TimeUnit.SECONDS); } catch (InterruptedException e) { logger.error("'clientSession' has not been established during 'openConnection'"); } this.connecting = false; } try { if (this.openConnectionException != null) { throw new IllegalStateException(this.openConnectionException); } Assert.state(this.clientSession != null, "'clientSession' has not been established. Consider to 'start' this container."); } catch (IllegalStateException e) { stop(); throw e; } return this.clientSession; }
Source:
private void updatePointer(final ILogData data) { if ((data.getType() == DataType.DATA || data.getType() == DataType.HOLE) && !data.hasCheckpointMetadata()) { getCurrentContext().setGlobalPointer(data.getGlobalAddress()); } }

Target:
private void updatePointer(final ILogData data) { if ((data.isData() || data.isHole()) && !data.hasCheckpointMetadata()) { getCurrentContext().setGlobalPointer(data.getGlobalAddress()); } }
Source:
private SmsChannel sendSMS(List<String> mobileList, SmsTemplate template, List<String> paramList) throws SmsSendingException { logger.info(String.format("ready to send sms, mobileList: %s, template: %s, params: %s", String.join(",", mobileList), template.name(), String.join(",", paramList))); SmsChannel successChannel = null; SmsChannel channel = template.getChannel(); try { if (channel == SmsChannel.Primary || channel == SmsChannel.TryBoth) { smsProviderPrimary.sendSMS(mobileList, template, paramList); successChannel = SmsChannel.Primary; } if (channel == SmsChannel.Backup) { smsProviderBackup.sendSMS(mobileList, template, paramList); successChannel = SmsChannel.Backup; } } catch (SmsSendingException e) { if (channel == SmsChannel.TryBoth) { logger.warn("send sms via primary channel failed, try backup channel.", e); try { smsProviderBackup.sendSMS(mobileList, template, paramList); successChannel = SmsChannel.Backup; } catch (SmsSendingException e1) { logger.error("send sms via primary and backup channel all failed.", e); throw e1; } } else { logger.error(String.format("send sms via %s channel failed.", channel), e); throw e; } } logger.info(String.format("send sms success, mobileList: %s, template: %s, params: %s", String.join(",", mobileList), template.name(), String.join(",", paramList))); return successChannel; }

Target:
private SmsChannel sendSMS(List<String> mobileList, SmsTemplate template, List<String> paramList) throws SmsSendingException { logger.info(String.format("ready to send sms, mobileList: %s, template: %s, params: %s", String.join(",", mobileList), template.name(), String.join(",", paramList))); SmsChannel successChannel = null; SmsChannel channel = template.getChannel(); try { if (channel == SmsChannel.Primary || channel == SmsChannel.TryBoth) { smsProviderPrimary.sendSMS(mobileList, template, paramList); successChannel = SmsChannel.Primary; } if (channel == SmsChannel.Backup) { smsProviderBackup.sendSMS(mobileList, template, paramList); successChannel = SmsChannel.Backup; } } catch (SmsSendingException e) { if (channel == SmsChannel.TryBoth) { logger.warn("send sms via primary channel failed, try backup channel.", e); try { smsProviderBackup.sendSMS(mobileList, template, paramList); successChannel = SmsChannel.Backup; } catch (SmsSendingException e1) { logger.error("send sms via primary and backup channel all failed.", e1); throw e1; } } else { logger.error(String.format("send sms via %s channel failed.", channel), e); throw e; } } logger.info(String.format("send sms success, mobileList: %s, template: %s, params: %s, channel: %s", String.join(",", mobileList), template.name(), String.join(",", paramList), successChannel)); return successChannel; }
Source:
default List<ConsentSignature> getConsentSignatureHistory(SubpopulationGuid subpopGuid) { List<ConsentSignature> signatures = Lists.newArrayList(); for (Map.Entry<HibernateAccountConsentKey, HibernateAccountConsent> entry : getConsents().entrySet()) { HibernateAccountConsentKey key = entry.getKey(); HibernateAccountConsent consent = entry.getValue(); if (key.getSubpopulationGuid().equals(subpopGuid.getGuid())) { ConsentSignature signature = new ConsentSignature.Builder() .withName(consent.getName()) .withBirthdate(consent.getBirthdate()) .withImageData(consent.getSignatureImageData()) .withImageMimeType(consent.getSignatureImageMimeType()) .withConsentCreatedOn(consent.getConsentCreatedOn()) .withSignedOn(key.getSignedOn()) .withWithdrewOn(consent.getWithdrewOn()).build(); signatures.add(signature); } } signatures.sort(Comparator.comparing(ConsentSignature::getSignedOn)); return ImmutableList.copyOf(signatures); }

Target:
default List<ConsentSignature> getConsentSignatureHistory(SubpopulationGuid subpopGuid) { List<ConsentSignature> signatures = Lists.newArrayList(); for (Map.Entry<HibernateAccountConsentKey, HibernateAccountConsent> entry : getConsents().entrySet()) { HibernateAccountConsentKey key = entry.getKey(); HibernateAccountConsent consent = entry.getValue(); if (key.getSubpopulationGuid().equals(subpopGuid.getGuid())) { ConsentSignature signature = new ConsentSignature.Builder() .withName(consent.getName()) .withBirthdate(consent.getBirthdate()) .withImageData(consent.getSignatureImageData()) .withImageMimeType(consent.getSignatureImageMimeType()) .withConsentCreatedOn(consent.getConsentCreatedOn()) .withSignedOn(key.getSignedOn()) .withWithdrewOn(consent.getWithdrewOn()).build(); signatures.add(signature); } } signatures.sort(comparing(ConsentSignature::getSignedOn)); return ImmutableList.copyOf(signatures); }
Source:
public void testQuery() throws IOException { IDatabases dbs = new DatabasesImpl(DATABASE_CONNECTION1); dbs.getDatabase1().deleteAll(); IUserPersistence users = dbs.getDatabase1().users(); User userA = users.createDefaultInstance().setHandle("A").setBio("Rapper").setNumPosts(1); User userB = users.createDefaultInstance().setHandle("B").setBio("Rapper").setNumPosts(2); User userC = users.createDefaultInstance().setHandle("C").setBio("Drug dealer").setNumPosts(2); User userD = users.createDefaultInstance().setHandle("D").setBio("Cool dentist").setNumPosts(3); userA.save(); userB.save(); userC.save(); userD.save(); Set<User> result; result = users.query().find(); assertTrue(result.isEmpty()); result = users.query().bio("Cool dentist").find(); assertEquals(1, result.size()); assertTrue(result.contains(userD)); result = users.query().handle("A").bio("Rapper").num_posts(1).find(); assertEquals(1, result.size()); assertTrue(result.contains(userA)); result = users.query().bio("Rapper").num_posts(2).find(); assertEquals(1, result.size()); assertTrue(result.contains(userB)); result = users.query().num_posts(3).bio("Rapper").find(); assertTrue(result.isEmpty()); }

Target:
public void testQuery() throws IOException { IDatabases dbs = new DatabasesImpl(DATABASE_CONNECTION1); dbs.getDatabase1().deleteAll(); IUserPersistence users = dbs.getDatabase1().users(); User userA = users.createDefaultInstance().setHandle("A").setBio("Trader").setNumPosts(1); User userB = users.createDefaultInstance().setHandle("B").setBio("Trader").setNumPosts(2); User userC = users.createDefaultInstance().setHandle("C").setBio("CEO").setNumPosts(2); User userD = users.createDefaultInstance().setHandle("D").setBio("Janitor").setNumPosts(3); userA.save(); userB.save(); userC.save(); userD.save(); Set<User> result; result = users.query().find(); assertTrue(result.isEmpty()); result = users.query().bio("Janitor").find(); assertEquals(1, result.size()); assertTrue(result.contains(userD)); result = users.query().handle("A").bio("Trader").numPosts(1).find(); assertEquals(1, result.size()); assertTrue(result.contains(userA)); result = users.query().bio("Trader").numPosts(2).find(); assertEquals(1, result.size()); assertTrue(result.contains(userB)); result = users.query().numPosts(3).bio("CEO").find(); assertTrue(result.isEmpty()); }
Source:
void setBluetoothTethering(boolean value, final String pkgName) { if (DBG) { Log.d(TAG, "setBluetoothTethering: " + value + ", mTetherOn: " + mTetherOn); } enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission"); ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); if (cm.isTetheringSupported()) { UserManager um = (UserManager) getSystemService(Context.USER_SERVICE); if (um.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING) && value) { throw new SecurityException("DISALLOW_CONFIG_TETHERING is enabled for this user."); } if (mTetherOn != value) { mTetherOn = value; List<BluetoothDevice> devList = getConnectedDevices(); for (BluetoothDevice dev : devList) { disconnect(dev); } } } else { throw new SecurityException( "Bluetooth does not have tethering permission, or tethering is disabled."); } }

Target:
void setBluetoothTethering(boolean value, final String pkgName) { if (DBG) { Log.d(TAG, "setBluetoothTethering: " + value + ", mTetherOn: " + mTetherOn); } enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission"); ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); if (cm.isTetheringSupported()) { if (mTetherOn != value) { mTetherOn = value; List<BluetoothDevice> devList = getConnectedDevices(); for (BluetoothDevice dev : devList) { disconnect(dev); } } } else { throw new SecurityException( "Bluetooth does not have tethering permission, or tethering is disabled."); } }
Source:
ListKeysOperation(Builder builder) { super(RiakMessageCodes.MSG_TsListKeysReq, RiakMessageCodes.MSG_TsListKeysResp, builder.reqBuilder, RiakTsPB.TsListKeysResp.PARSER); this.builder = builder; }

Target:
private ListKeysOperation(Builder builder) { super(RiakMessageCodes.MSG_TsListKeysReq, RiakMessageCodes.MSG_TsListKeysResp, builder.reqBuilder, RiakTsPB.TsListKeysResp.PARSER); this.builder = builder; }
Source:
public NetworkProfileListModel() { setTitle(ConstantsManager.getInstance().getConstants().vnicProfilesTitle()); setHelpTag(HelpTag.profiles); setHashName("profiles"); setIsAvailable(ApplicationModeHelper.isModeSupported(ApplicationMode.VirtOnly)); setComparator(new Linq.VnicProfileViewComparator()); setNewCommand(new UICommand("New", this)); setEditCommand(new UICommand("Edit", this)); setRemoveCommand(new UICommand("Remove", this)); updateActionAvailability(); }

Target:
public NetworkProfileListModel() { setTitle(ConstantsManager.getInstance().getConstants().vnicProfilesTitle()); setHelpTag(HelpTag.profiles); setHashName("profiles"); setAvailableInModes(ApplicationMode.VirtOnly); setComparator(new Linq.VnicProfileViewComparator()); setNewCommand(new UICommand("New", this)); setEditCommand(new UICommand("Edit", this)); setRemoveCommand(new UICommand("Remove", this)); updateActionAvailability(); }
Source:
private <T extends Metric, V> T doRegisterMetric(String simpleName, String key, String metricName, Class<T> metricClass, Supplier<V> supplier) { validateArguments(simpleName, metricName); Validate.notNull(metricClass, "metric class argument is null."); String fullMetricName = MetricRegistry.name(simpleName, key, metricName); Metric metric = null; if (!checkCache(simpleName, fullMetricName).isPresent()) { try { metric = createMetric(fullMetricName, metricClass); _metricRegistry.register(fullMetricName, metric); } catch (IllegalArgumentException e) { } updateCache(simpleName, fullMetricName, metric); } else { metric = _metricRegistry.getMetrics().get(fullMetricName); } if (metric != null && metric instanceof ResettableGauge) { Validate.notNull(supplier, "null supplier to Gauge"); ((ResettableGauge) metric).setSupplier(supplier); } return (T) metric; }

Target:
private <T extends Metric, V> T doRegisterMetric(String simpleName, String key, String metricName, Class<T> metricClass, Supplier<V> supplier) { validateArguments(simpleName, metricName); Validate.notNull(metricClass, "metric class argument is null."); String fullMetricName = MetricRegistry.name(simpleName, key, metricName); Metric metric = getMetric(fullMetricName, metricClass); if (metric != null && metric instanceof ResettableGauge) { Validate.notNull(supplier, "null supplier to Gauge"); ((ResettableGauge) metric).setSupplier(supplier); try { _metricRegistry.register(fullMetricName, metric); } catch (IllegalArgumentException e) { } } return (T) metric; }
Source:
public StandardDrive apply(Map<String, String> from) { if (from.size() == 0) return null; StandardDrive.Builder builder = new StandardDrive.Builder(); builder.name(from.get("name")); builder.media(MediaType.fromValue(from.get("media"))); if (from.containsKey("tags")) builder.tags(Splitter.on(' ').split(from.get("tags"))); builder.uuid(from.get("drive")); if (from.containsKey("claim:type")) builder.claimType(ClaimType.fromValue(from.get("claim:type"))); if (from.containsKey("readers")) builder.readers(Splitter.on(' ').split(from.get("readers"))); if (from.containsKey("size")) builder.size(Long.valueOf(from.get("size"))); if (from.containsKey("rawsize")) builder.rawSize(Long.valueOf(from.get("rawsize"))); if (from.containsKey("format")) builder.format(ImageConversionType.fromValue(from.get("format"))); Map<String, String> metadata = Maps.newLinkedHashMap(); for (Entry<String, String> entry : from.entrySet()) { if (entry.getKey().startsWith("user:")) metadata.put(entry.getKey().substring(entry.getKey().indexOf(':') + 1), entry.getValue()); } builder.userMetadata(metadata); try { return builder.build(); } catch (NullPointerException e) { logger.trace("entry missing data: %s; %s", e.getMessage(), from); return null; } }

Target:
public StandardDrive apply(Map<String, String> from) { if (from.isEmpty()) return null; StandardDrive.Builder builder = new StandardDrive.Builder(); builder.name(from.get("name")); builder.media(MediaType.fromValue(from.get("media"))); if (from.containsKey("tags")) builder.tags(Splitter.on(' ').split(from.get("tags"))); builder.uuid(from.get("drive")); if (from.containsKey("claim:type")) builder.claimType(ClaimType.fromValue(from.get("claim:type"))); if (from.containsKey("readers")) builder.readers(Splitter.on(' ').split(from.get("readers"))); if (from.containsKey("size")) builder.size(Long.valueOf(from.get("size"))); if (from.containsKey("rawsize")) builder.rawSize(Long.valueOf(from.get("rawsize"))); if (from.containsKey("format")) builder.format(ImageConversionType.fromValue(from.get("format"))); Map<String, String> metadata = Maps.newLinkedHashMap(); for (Entry<String, String> entry : from.entrySet()) { String key = entry.getKey(); if (key.startsWith("user:")) metadata.put(key.substring(key.indexOf(':') + 1), entry.getValue()); } builder.userMetadata(metadata); try { return builder.build(); } catch (NullPointerException e) { logger.warn("entry missing data: %s; %s", e.getMessage(), from); return null; } }
Source:
public void handleChildChange(String parentPath, List<String> currentChilds) { logger.info("Data change callback: child changed, path: " + parentPath + ", current child count: " + currentChilds.size()); try { updateNotificationTime(System.nanoTime()); if (parentPath != null && parentPath.startsWith(_path)) { if (currentChilds == null && parentPath.equals(_path)) { _manager.removeListener(_propertyKey, _listener); } else { NotificationContext changeContext = new NotificationContext(_manager); changeContext.setType(NotificationContext.Type.CALLBACK); changeContext.setPathChanged(parentPath); changeContext.setChangeType(_changeType); enqueueTask(changeContext); } } } catch (Exception e) { String msg = "exception in handling child-change. instance: " + _manager.getInstanceName() + ", parentPath: " + parentPath + ", listener: " + _listener; ZKExceptionHandler.getInstance().handle(msg, e); } }

Target:
public void handleChildChange(String parentPath, List<String> currentChilds) { if (logger.isDebugEnabled()) { logger.debug( "Data change callback: child changed, path: " + parentPath + ", current child count: " + currentChilds.size()); } try { updateNotificationTime(System.nanoTime()); if (parentPath != null && parentPath.startsWith(_path)) { if (currentChilds == null && parentPath.equals(_path)) { _manager.removeListener(_propertyKey, _listener); } else { NotificationContext changeContext = new NotificationContext(_manager); changeContext.setType(NotificationContext.Type.CALLBACK); changeContext.setPathChanged(parentPath); changeContext.setChangeType(_changeType); enqueueTask(changeContext); } } } catch (Exception e) { String msg = "exception in handling child-change. instance: " + _manager.getInstanceName() + ", parentPath: " + parentPath + ", listener: " + _listener; ZKExceptionHandler.getInstance().handle(msg, e); } }
Source:
public TransactionSnapshot(long timestamp, long readPointer, long writePointer, Collection<Long> invalid, NavigableMap<Long, TransactionManager.InProgressTx> inProgress) { this.timestamp = timestamp; this.readPointer = readPointer; this.writePointer = writePointer; this.invalid = invalid; this.inProgress = inProgress; this.committingChangeSets = new HashMap<>(); this.committedChangeSets = new HashMap<>(); }

Target:
public TransactionSnapshot(long timestamp, long readPointer, long writePointer, Collection<Long> invalid, NavigableMap<Long, TransactionManager.InProgressTx> inProgress) { this.timestamp = timestamp; this.readPointer = readPointer; this.writePointer = writePointer; this.invalid = invalid; this.inProgress = inProgress; this.committingChangeSets = Collections.emptyMap(); this.committedChangeSets = Collections.emptyMap(); }
Source:
public boolean resetAfterCatalogChange() { if (m_procName.startsWith("org.voltdb.sysprocs.UpdateApplicationCatalog")) { return false; } return true; }

Target:
public boolean resetAfterCatalogChange() { if (isProcedureUAC()) { return false; } return true; }
Source:
private String buildContainerName(String pluginName, String cheContainerName) { String preliminaryName = (pluginName + "-" + cheContainerName).toLowerCase(); if (preliminaryName.length() <= maxContainerNameLength) { return preliminaryName; } return ("plugin-" + cheContainerName).substring(0, maxContainerNameLength - 1).toLowerCase(); }

Target:
private String buildContainerName(String pluginName, String cheContainerName) { if (pluginName == null) { return cheContainerName.substring( 0, min(cheContainerName.length(), MAX_CONTAINER_NAME_LENGTH)); } String preliminaryName = (pluginName + "-" + cheContainerName).toLowerCase(); if (preliminaryName.length() <= MAX_CONTAINER_NAME_LENGTH) { return preliminaryName; } final String limitedContainerName = cheContainerName.substring(0, min(cheContainerName.length(), 49)); return (pluginName.substring( 0, min( pluginName.length(), MAX_CONTAINER_NAME_LENGTH - limitedContainerName.length() - 1)) + "-" + limitedContainerName) .toLowerCase(); }
Source:
public void submit() { final Dialog dialog = getDialog(); PrefManager.UserPrefManager userPrefs = new PrefManager.UserPrefManager(MainApplication.application); userPrefs.setAppRating(binding.ratingBar.getRating()); userPrefs.setLastRatedVersion(BuildConfig.VERSION_NAME); if (binding.ratingBar.getRating() <=3 ) { showFeedbackDialog(getActivity()); } else { showRateTheAppDialog(); } dialog.dismiss(); }

Target:
public void submit() { final Dialog dialog = getDialog(); PrefManager.UserPrefManager userPrefs = new PrefManager.UserPrefManager(MainApplication.application); userPrefs.setAppRating(binding.ratingBar.getRating()); userPrefs.setLastRatedVersion(BuildConfig.VERSION_NAME); if (binding.ratingBar.getRating() <= AppConstants.APP_NEGATIVE_RATING_THRESHOLD) { showFeedbackDialog(getActivity()); } else { showRateTheAppDialog(); } dialog.dismiss(); }
Source:
public void getFillStartPoints() { final Point[] cellSelection = createCellSelection( 2, 2, 1, 1, 1, 2, 2, 1, 3, 1, 3, 2); final Point[] fillStartPoints = GridPasteKeyListener.getFillStartPoints(cellSelection); assertEquals(2, fillStartPoints.length); final Set<Point> expectedStartPoints = new LinkedHashSet<Point>(Arrays.asList(createCellSelection( 1, 1, 1, 2))); for (final Point actualStartPoint : fillStartPoints) { final Iterator<Point> iterator = expectedStartPoints.iterator(); while (iterator.hasNext()) { final Point check = iterator.next(); if (actualStartPoint.equals(check)) { iterator.remove(); break; } } } assertTrue(expectedStartPoints.isEmpty()); }

Target:
public void getFillStartPoints() { final Point[] cellSelection = createCellSelection( 2, 2, 1, 1, 1, 2, 2, 1, 3, 1, 3, 2); final Point[] fillStartPoints = GridPasteKeyListener.getFillStartPoints(cellSelection); assertEquals(2, fillStartPoints.length); final Set<Point> expectedStartPoints = new LinkedHashSet<Point>(Arrays.asList(createCellSelection( 1, 1, 1, 2))); expectedStartPoints.removeAll(Arrays.asList(fillStartPoints)); assertTrue(expectedStartPoints.isEmpty()); }
Source:
public void testSignalIntermediateThrow() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-IntermediateThrowEventSignal.bpmn2"); ksession = createKnowledgeSession(kbase); Map<String, Object> params = new HashMap<String, Object>(); params.put("x", "MyValue"); ProcessInstance processInstance = ksession.startProcess( "SignalIntermediateEvent", params); Assertions.assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED); }

Target:
public void testSignalIntermediateThrow() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-IntermediateThrowEventSignal.bpmn2"); ksession = createKnowledgeSession(kbase); Map<String, Object> params = new HashMap<String, Object>(); params.put("x", "MyValue"); ProcessInstance processInstance = ksession.startProcess( "SignalIntermediateEvent", params); assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED); }
Source:
public int execute() { try { if (work.tableDataCopyIteratorsInitialized()) { initiateDataCopyTasks(); } else { Path dumpRoot = getEncodedDumpRootPath(); Path previousValidHiveDumpPath = getPreviousValidDumpMetadataPath(dumpRoot); boolean isBootstrap = (previousValidHiveDumpPath == null); if (shouldDump(previousValidHiveDumpPath)) { Path currentDumpPath = getCurrentDumpPath(dumpRoot, isBootstrap); Path hiveDumpRoot = new Path(currentDumpPath, ReplUtils.REPL_HIVE_BASE_DIR); work.setCurrentDumpPath(currentDumpPath); if (shouldDumpAuthorizationMetadata()) { LOG.info("Dumping authorization data"); initiateAuthorizationDumpTask(currentDumpPath); } DumpMetaData dmd = new DumpMetaData(hiveDumpRoot, conf); ReplChangeManager.getInstance(conf); Path cmRoot = new Path(conf.getVar(HiveConf.ConfVars.REPLCMDIR)); Long lastReplId; if (isBootstrap) { lastReplId = bootStrapDump(hiveDumpRoot, dmd, cmRoot, getHive()); } else { work.setEventFrom(getEventFromPreviousDumpMetadata(previousValidHiveDumpPath)); lastReplId = incrementalDump(hiveDumpRoot, dmd, cmRoot, getHive()); } work.setResultValues(Arrays.asList(currentDumpPath.toUri().toString(), String.valueOf(lastReplId))); initiateDataCopyTasks(); } else { LOG.info("Previous Dump is not yet loaded"); } } } catch (Exception e) { LOG.error("failed", e); setException(e); return ErrorMsg.getErrorMsg(e.getMessage()).getErrorCode(); } return 0; }

Target:
public int execute() { try { if (work.tableDataCopyIteratorsInitialized()) { initiateDataCopyTasks(); } else { Path dumpRoot = getEncodedDumpRootPath(); Path previousValidHiveDumpPath = getPreviousValidDumpMetadataPath(dumpRoot); boolean isBootstrap = (previousValidHiveDumpPath == null); if (shouldDump(previousValidHiveDumpPath)) { Path currentDumpPath = getCurrentDumpPath(dumpRoot, isBootstrap); Path hiveDumpRoot = new Path(currentDumpPath, ReplUtils.REPL_HIVE_BASE_DIR); work.setCurrentDumpPath(currentDumpPath); if (shouldDumpAuthorizationMetadata()) { initiateAuthorizationDumpTask(); } DumpMetaData dmd = new DumpMetaData(hiveDumpRoot, conf); ReplChangeManager.getInstance(conf); Path cmRoot = new Path(conf.getVar(HiveConf.ConfVars.REPLCMDIR)); Long lastReplId; if (isBootstrap) { lastReplId = bootStrapDump(hiveDumpRoot, dmd, cmRoot, getHive()); } else { work.setEventFrom(getEventFromPreviousDumpMetadata(previousValidHiveDumpPath)); lastReplId = incrementalDump(hiveDumpRoot, dmd, cmRoot, getHive()); } work.setResultValues(Arrays.asList(currentDumpPath.toUri().toString(), String.valueOf(lastReplId))); initiateDataCopyTasks(); } else { LOG.info("Previous Dump is not yet loaded"); } } } catch (Exception e) { LOG.error("failed", e); setException(e); return ErrorMsg.getErrorMsg(e.getMessage()).getErrorCode(); } return 0; }
Source:
protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { super.updateModel(context, operation); PathAddress address = context.getCurrentAddress(); for (Capability capability : this.descriptor.getCapabilities()) { context.registerCapability(capability.getRuntimeCapability(address), null); } }

Target:
protected void updateModel(OperationContext context, ModelNode operation) throws OperationFailedException { super.updateModel(context, operation); PathAddress address = context.getCurrentAddress(); for (Capability capability : this.descriptor.getCapabilities()) { context.registerCapability(capability.getRuntimeCapability(address), null); } ModelNode model = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); for (AttributeDefinition attribute : this.descriptor.getAttributes()) { if (model.hasDefined(attribute.getName()) || attribute.hasCapabilityRequirements()) { attribute.addCapabilityRequirements(context, model.get(attribute.getName())); } } }
Source:
@Override public void onRemoval(RemovalNotification<String, JedisPool> notification) { jedisPoolCache.invalidateAll(); }

Target:
@Override public void onRemoval(RemovalNotification<String, JedisPool> notification) { assert notification.getValue() != null; try { notification.getValue().destroy(); } catch (Exception e) { LOGGER.warn("While destroying JedisPool {}", notification.getKey()); } }