auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected String run() throws Exception { EntityMetadata emd = getMetadata().getEntityMetadata(entity, version); CRUDController crudController = RestConfiguration.getFactory().getFactory().getCRUDController(emd); if (crudController instanceof MongoCRUDController) { MongoCRUDController mcc = (MongoCRUDController) crudController; mcc.reindex(emd); return String.format("Starting reindex of %s:%s", entity, version); } throw new UnsupportedOperationException("This command is only available on MongoDB backed instances"); }

Target:
protected String run() throws Exception { EntityInfo entityInfo = getMetadata().getEntityInfo(entity); CRUDController crudController = RestConfiguration.getFactory().getFactory().getCRUDController(entityInfo.getDataStore().getBackend()); if (crudController instanceof MongoCRUDController) { MongoCRUDController mcc = (MongoCRUDController) crudController; mcc.reindex(entityInfo); return String.format("Starting reindex of %s", entity); } throw new UnsupportedOperationException("This command is only available on MongoDB backed instances"); }
Source:
private void addPlayableToQueue(Playable playable) { if (playable instanceof FeedMedia) { FeedItem feedItem = DBReader.getFeedItem(((FeedMedia) playable).getId()); DBWriter.addQueueItem(this, feedItem); } }

Target:
private void addPlayableToQueue(Playable playable) { if (playable instanceof FeedMedia) { long itemId = ((FeedMedia) playable).getId(); DBWriter.addQueueItem(this, false, false, itemId); } }
Source:
public void registerListener(PluginContainer plugin, Object listenerObject) { checkNotNull(plugin, "plugin"); checkNotNull(listenerObject, "listener"); if (this.registeredListeners.contains(listenerObject)) { SpongeImpl.getLogger().warn("Plugin attempted to register an already registered listener ({})", plugin.getId(), listenerObject.getClass().getName()); return; } List<RegisteredListener<?>> handlers = Lists.newArrayList(); Class<?> handle = listenerObject.getClass(); for (Method method : handle.getMethods()) { Listener listener = method.getAnnotation(Listener.class); if (listener != null) { if (isValidHandler(method)) { @SuppressWarnings("unchecked") Class<? extends Event> eventClass = (Class<? extends Event>) method.getParameterTypes()[0]; AnnotatedEventListener handler; try { handler = this.handlerFactory.create(listenerObject, method); } catch (Exception e) { SpongeImpl.getLogger().error("Failed to create handler for on {}", method, handle, e); continue; } handlers.add(createRegistration(plugin, eventClass, listener, handler)); } else { SpongeImpl.getLogger().warn("The method on has @{} but has the wrong signature", method, handle.getName(), Listener.class.getName()); } } } this.registeredListeners.add(listenerObject); register(handlers); }

Target:
public void registerListener(PluginContainer plugin, Object listenerObject) { checkNotNull(plugin, "plugin"); checkNotNull(listenerObject, "listener"); if (this.registeredListeners.contains(listenerObject)) { SpongeImpl.getLogger().warn("Plugin attempted to register an already registered listener ({})", plugin.getId(), listenerObject.getClass().getName()); Thread.dumpStack(); return; } List<RegisteredListener<?>> handlers = Lists.newArrayList(); Class<?> handle = listenerObject.getClass(); for (Method method : handle.getMethods()) { Listener listener = method.getAnnotation(Listener.class); if (listener != null) { if (isValidHandler(method)) { @SuppressWarnings("unchecked") Class<? extends Event> eventClass = (Class<? extends Event>) method.getParameterTypes()[0]; AnnotatedEventListener handler; try { handler = this.handlerFactory.create(listenerObject, method); } catch (Exception e) { SpongeImpl.getLogger().error("Failed to create handler for on {}", method, handle, e); continue; } handlers.add(createRegistration(plugin, eventClass, listener, handler)); } else { SpongeImpl.getLogger().warn("The method on has @{} but has the wrong signature", method, handle.getName(), Listener.class.getName()); } } } this.registeredListeners.add(listenerObject); register(handlers); }
Source:
public <T> Enumeration<T> resources(Class<? extends T> resourceClass) { return (Enumeration<T>) (isJarResource(resourceClass) ? (Enumeration<T>) jarFile.entries() : Collections.emptyEnumeration()); }

Target:
public <T> Enumeration<T> resources(Class<? extends T> resourceClass) { if (isJarResource(resourceClass)) { return (Enumeration<T>) jarFile.entries(); } else { return Collections.emptyEnumeration(); } }
Source:
public void readFully(long position, byte[] buffer) throws IOException { }

Target:
public void readFully(long position, byte[] buffer) { }
Source:
private void checkShutdown() { if (completedOrFailedEvalCount.incrementAndGet() == initServerCount + addedServerContextCount.get() + initWorkerCount + addedWorkerContextCount.get()) { while (optimizationOrchestrator.isPlanExecuting()) { try { LOG.log(Level.INFO, "It's time to shutdown active contexts, but wait for completion of plan execution"); Thread.sleep(3000); } catch (final InterruptedException e) { LOG.log(Level.FINEST, "Interrupted while waiting for plan finish", e); } } for (final ActiveContext serverContext : serverContexts) { serverContext.close(); } for (final ActiveContext workerContext : workerContextsToClose) { workerContext.close(); } isComplete = true; } }

Target:
private void checkShutdown() { if (completedOrFailedEvalCount.incrementAndGet() == initServerCount + addedServerContextCount.get() + initWorkerCount + addedWorkerContextCount.get()) { if (isFinished.compareAndSet(false, true)) { Executors.newSingleThreadExecutor().submit(new Runnable() { @Override public void run() { while (optimizationOrchestrator.isPlanExecuting()) { try { LOG.log(Level.INFO, "It's time to shutdown active contexts, but wait for completion of plan execution"); Thread.sleep(SHUTDOWN_TRIAL_INTERVAL_MS); } catch (final InterruptedException e) { LOG.log(Level.FINEST, "Interrupted while waiting for plan finish", e); } } for (final ActiveContext serverContext : serverContexts) { serverContext.close(); } for (final ActiveContext workerContext : workerContextsToClose) { workerContext.close(); } } }); } } }
Source:
protected CreateNodesWithGroupEncodedIntoNameThenAddToSet( CreateNodeWithGroupEncodedIntoName addNodeWithGroupStrategy, ListNodesStrategy listNodesStrategy, GroupNamingConvention.Factory namingConvention, @Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor, CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.Factory customizeNodeAndAddToGoodMapOrPutExceptionIntoBadMapFactory, GoogleComputeEngineApi api, @UserProject Supplier<String> userProject, @Named("global") Predicate<AtomicReference<Operation>> operationDonePredicate, @Named(OPERATION_COMPLETE_INTERVAL) Long operationCompleteCheckInterval, @Named(OPERATION_COMPLETE_TIMEOUT) Long operationCompleteCheckTimeout, FirewallTagNamingConvention.Factory firewallTagNamingConvention) { super(addNodeWithGroupStrategy, listNodesStrategy, namingConvention, userExecutor, customizeNodeAndAddToGoodMapOrPutExceptionIntoBadMapFactory); this.api = checkNotNull(api, "google compute api"); this.userProject = checkNotNull(userProject, "user project name"); this.operationCompleteCheckInterval = checkNotNull(operationCompleteCheckInterval, "operation completed check interval"); this.operationCompleteCheckTimeout = checkNotNull(operationCompleteCheckTimeout, "operation completed check timeout"); this.operationDonePredicate = operationDonePredicate; this.firewallTagNamingConvention = firewallTagNamingConvention; }

Target:
protected CreateNodesWithGroupEncodedIntoNameThenAddToSet( CreateNodeWithGroupEncodedIntoName addNodeWithGroupStrategy, ListNodesStrategy listNodesStrategy, GroupNamingConvention.Factory namingConvention, @Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor, CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.Factory customizeNodeAndAddToGoodMapOrPutExceptionIntoBadMapFactory, GoogleComputeEngineApi api, @UserProject Supplier<String> userProject, @Named("global") Predicate<AtomicReference<Operation>> operationDonePredicate, @Named(OPERATION_COMPLETE_INTERVAL) Long operationCompleteCheckInterval, @Named(OPERATION_COMPLETE_TIMEOUT) Long operationCompleteCheckTimeout, FirewallTagNamingConvention.Factory firewallTagNamingConvention) { super(addNodeWithGroupStrategy, listNodesStrategy, namingConvention, userExecutor, customizeNodeAndAddToGoodMapOrPutExceptionIntoBadMapFactory); this.api = checkNotNull(api, "google compute api"); this.userProject = checkNotNull(userProject, "user project name"); this.operationCompleteCheckInterval = checkNotNull(operationCompleteCheckInterval, "operation completed check interval"); this.operationCompleteCheckTimeout = checkNotNull(operationCompleteCheckTimeout, "operation completed check timeout"); this.operationDonePredicate = operationDonePredicate; this.firewallTagNamingConvention = checkNotNull(firewallTagNamingConvention, "firewallTagNamingConvention"); }
Source:
private List<VendorSupplierDiversity> buildVendorDiversitiesFromPmwFormCheckboxes(PaymentWorksVendor pmwVendor, Map<String, SupplierDiversity> paymentWorksToKfsDiversityMap, List<VendorSupplierDiversity> kfsVendorSupplierDiversities) { if (paymentWorksFormModeService.shouldUseLegacyFormProcessingMode()) { ArrayList<String> pmwDiversities = new ArrayList<String>(Arrays.asList(pmwVendor.getDiversityClassifications().split("\\s*,\\s*"))); if (!pmwDiversities.isEmpty()) { for (String pmwDiversity : pmwDiversities) { if (paymentWorksToKfsDiversityMap.containsKey(pmwDiversity)) { SupplierDiversity supplierDiversityFromMap = paymentWorksToKfsDiversityMap.get(pmwDiversity); kfsVendorSupplierDiversities.add(buildVendorSupplierDiversity(supplierDiversityFromMap. getVendorSupplierDiversityCode(), addOneYearToDate(getDateTimeService().getCurrentDate()))); } else { LOG.info("buildVendorDiversities:: PaymentWorks Vendor : " + pmwVendor.getRequestingCompanyLegalName() + " Diversity Value : " + pmwDiversity + " does not have corresponding KFS SupplierDiversity defined."); } } } } else if (paymentWorksFormModeService.shouldUseForeignFormProcessingMode()) { LOG.info("buildVendorDiversitiesFromPmwFormCheckboxes, " + PaymentWorksConstants.FOREIGN_FORM_PROCESSING_NOT_IMPLEMENTED_LOG_MESSAGE); } return kfsVendorSupplierDiversities; }

Target:
private List<VendorSupplierDiversity> buildVendorDiversitiesFromPmwFormCheckboxes(PaymentWorksVendor pmwVendor, Map<String, SupplierDiversity> paymentWorksToKfsDiversityMap, List<VendorSupplierDiversity> kfsVendorSupplierDiversities) { if (StringUtils.isNotBlank(pmwVendor.getDiversityClassifications())) { ArrayList<String> pmwDiversities = new ArrayList<String>(Arrays.asList(pmwVendor.getDiversityClassifications().split("\\s*,\\s*"))); if (!pmwDiversities.isEmpty()) { for (String pmwDiversity : pmwDiversities) { if (paymentWorksToKfsDiversityMap.containsKey(pmwDiversity)) { SupplierDiversity supplierDiversityFromMap = paymentWorksToKfsDiversityMap.get(pmwDiversity); kfsVendorSupplierDiversities.add(buildVendorSupplierDiversity(supplierDiversityFromMap. getVendorSupplierDiversityCode(), addOneYearToDate(getDateTimeService().getCurrentDate()))); } else { LOG.info("buildVendorDiversities:: PaymentWorks Vendor : " + pmwVendor.getRequestingCompanyLegalName() + " Diversity Value : " + pmwDiversity + " does not have corresponding KFS SupplierDiversity defined."); } } } } return kfsVendorSupplierDiversities; }
Source:
private void processDeviceAuthDeniedResponse(Map<String, String> sessionAttribute) { String userCode = sessionAttribute.get(AuthorizeRequestParam.USER_CODE); DeviceAuthorizationCacheControl cacheData = deviceAuthorizationService.getDeviceAuthzByUserCode(userCode); if (cacheData != null) { if (cacheData.getStatus() == DeviceAuthorizationStatus.PENDING) { cacheData.setStatus(DeviceAuthorizationStatus.DENIED); deviceAuthorizationService.saveInCache(cacheData, true, false); deviceAuthorizationService.removeDeviceAuthRequestInCache(userCode, null); } } }

Target:
private void processDeviceAuthDeniedResponse(Map<String, String> sessionAttribute) { String userCode = sessionAttribute.get(DeviceAuthorizationService.SESSION_USER_CODE); DeviceAuthorizationCacheControl cacheData = deviceAuthorizationService.getDeviceAuthzByUserCode(userCode); if (cacheData != null && cacheData.getStatus() == DeviceAuthorizationStatus.PENDING) { cacheData.setStatus(DeviceAuthorizationStatus.DENIED); deviceAuthorizationService.saveInCache(cacheData, true, false); deviceAuthorizationService.removeDeviceAuthRequestInCache(userCode, null); } }
Source:
private void connectToTarget(IProcessDMContext procCtx, RequestMonitor rm) { ILaunch launch = (ILaunch)procCtx.getAdapter(ILaunch.class); assert launch != null; if (launch != null) { Map<String, Object> attributes = null; try { attributes = launch.getLaunchConfiguration().getAttributes(); } catch (CoreException e) boolean extended = CDebugUtils.getAttribute( attributes, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_EXTENDED, IGDBLaunchConfigurationConstants.DEBUGGER_REMOTE_EXTENDED_DEFAULT); boolean isTcpConnection = CDebugUtils.getAttribute( attributes, IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, false); if (isTcpConnection) { String remoteTcpHost = CDebugUtils.getAttribute( attributes, IGDBLaunchConfigurationConstants.ATTR_HOST, INVALID); String remoteTcpPort = CDebugUtils.getAttribute( attributes, IGDBLaunchConfigurationConstants.ATTR_PORT, INVALID); fCommandControl.queueCommand( fCommandFactory.createMITargetSelect(fCommandControl.getContext(), remoteTcpHost, remoteTcpPort, extended), new ImmediateDataRequestMonitor<MIInfo>(rm)); } else { String serialDevice = CDebugUtils.getAttribute( attributes, IGDBLaunchConfigurationConstants.ATTR_DEV, INVALID); fCommandControl.queueCommand( fCommandFactory.createMITargetSelect(fCommandControl.getContext(), serialDevice, extended), new ImmediateDataRequestMonitor<MIInfo>(rm)); } } else { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Cannot reconnect to target.", null)); rm.done(); } }

Target:
private void connectToTarget(IProcessDMContext procCtx, RequestMonitor rm) { ILaunch launch = (ILaunch)procCtx.getAdapter(ILaunch.class); assert launch != null; if (launch != null) { Map<String, Object> attributes = null; try { attributes = launch.getLaunchConfiguration().getAttributes(); } catch (CoreException e) boolean isTcpConnection = CDebugUtils.getAttribute( attributes, IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, false); if (isTcpConnection) { String remoteTcpHost = CDebugUtils.getAttribute( attributes, IGDBLaunchConfigurationConstants.ATTR_HOST, INVALID); String remoteTcpPort = CDebugUtils.getAttribute( attributes, IGDBLaunchConfigurationConstants.ATTR_PORT, INVALID); fCommandControl.queueCommand( fCommandFactory.createMITargetSelect(fCommandControl.getContext(), remoteTcpHost, remoteTcpPort, true), new ImmediateDataRequestMonitor<MIInfo>(rm)); } else { String serialDevice = CDebugUtils.getAttribute( attributes, IGDBLaunchConfigurationConstants.ATTR_DEV, INVALID); fCommandControl.queueCommand( fCommandFactory.createMITargetSelect(fCommandControl.getContext(), serialDevice, true), new ImmediateDataRequestMonitor<MIInfo>(rm)); } } else { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Cannot reconnect to target.", null)); rm.done(); } }
Source:
public final X next() { if(!hasNext()) { throw new NoSuchElementException(); } assert current != null; X result = current; current = null; return result; }

Target:
public final X next() { if(current == null) { throw new NoSuchElementException(); } X result = current; fetchNext(); return result; }
Source:
private DruidPredicateFactory getPredicateFactory() { return new DruidPredicateFactory() { @Override public Predicate<String> makeStringPredicate() { if (extractionFn != null) { return new Predicate<String>() { @Override public boolean apply(String input) { return doesMatch(extractionFn.apply(input)); } }; } else { return new Predicate<String>() { @Override public boolean apply(String input) { return doesMatch(input); } }; } } @Override public DruidLongPredicate makeLongPredicate() { if (extractionFn != null) { return new DruidLongPredicate() { @Override public boolean applyLong(long input) { return doesMatch(extractionFn.apply(input)); } }; } else if (boundDimFilter.getOrdering().equals(StringComparators.NUMERIC)) { return longPredicateSupplier.get(); } else { return new DruidLongPredicate() { @Override public boolean applyLong(long input) { return doesMatch(String.valueOf(input)); } }; } } @Override public DruidFloatPredicate makeFloatPredicate() { if (extractionFn != null) { return new DruidFloatPredicate() { @Override public boolean applyFloat(float input) { return doesMatch(extractionFn.apply(input)); } }; } else if (boundDimFilter.getOrdering().equals(StringComparators.NUMERIC)) { return floatPredicateSupplier.get(); } else { return new DruidFloatPredicate() { @Override public boolean applyFloat(float input) { return doesMatch(String.valueOf(input)); } }; } } @Override public DruidDoublePredicate makeDoublePredicate() { if (extractionFn != null) { return input -> doesMatch(extractionFn.apply(input)); } if(boundDimFilter.getOrdering().equals(StringComparators.NUMERIC)) { return input -> floatPredicateSupplier.get().applyFloat((float) input); } return input -> doesMatch(String.valueOf(input)); } }; }

Target:
private DruidPredicateFactory getPredicateFactory() { return new DruidPredicateFactory() { @Override public Predicate<String> makeStringPredicate() { if (extractionFn != null) { return input -> doesMatch(extractionFn.apply(input)); } return input -> doesMatch(input); } @Override public DruidLongPredicate makeLongPredicate() { if (extractionFn != null) { return input -> doesMatch(extractionFn.apply(input)); } if (boundDimFilter.getOrdering().equals(StringComparators.NUMERIC)) { return longPredicateSupplier.get(); } return input -> doesMatch(String.valueOf(input)); } @Override public DruidFloatPredicate makeFloatPredicate() { if (extractionFn != null) { return input -> doesMatch(extractionFn.apply(input)); } if (boundDimFilter.getOrdering().equals(StringComparators.NUMERIC)) { return floatPredicateSupplier.get(); } return input -> doesMatch(String.valueOf(input)); } @Override public DruidDoublePredicate makeDoublePredicate() { if (extractionFn != null) { return input -> doesMatch(extractionFn.apply(input)); } if (boundDimFilter.getOrdering().equals(StringComparators.NUMERIC)) { return input -> doublePredicateSupplier.get().applyDouble(input); } return input -> doesMatch(String.valueOf(input)); } }; }
Source:
public static List<String> getStringFromTargets(Path prjPath) { final List<String> classPathFiles = new ArrayList<>(); searchTargetFiles(prjPath, classPathFiles, JAVA_CLASS_EXT, DROOLS_EXT, GDROOLS_EXT, RDROOLS_EXT, XML_EXT, SCENARIO_EXT); return classPathFiles; }

Target:
public static List<String> getStringFromTargets(Path prjPath) { return getStringFromTargetWithStream(prjPath, CommonConstants.JAVA_CLASS_EXT, CommonConstants.DROOLS_EXT, CommonConstants.GDROOLS_EXT, CommonConstants.RDROOLS_EXT, CommonConstants.XML_EXT, CommonConstants.SCENARIO_EXT); }
Source:
private CtfIterator replaceRandomElement(final CtfTmfContext context) { fAccessLock.lock(); try { final int size = fRandomAccess.size(); final int pos = fRnd.nextInt(size); final CtfTmfContext victim = fRandomAccess.get(pos); fRandomAccess.set(pos, context); CtfIterator elem = fMap.remove(victim); if (elem.isClosed()) { String traceLog = victim.getTrace() != null ? victim.getTrace().toString() : ""; Activator.getDefault().logError("Found closed iterator in iterator manager. " + traceLog); elem.dispose(); elem = (CtfIterator) fTrace.createIterator(); } fMap.put(context, elem); victim.dispose(); return elem; } finally { fAccessLock.unlock(); } }

Target:
private CtfIterator replaceRandomElement(final CtfTmfContext context) { fAccessLock.lock(); try { final int size = fRandomAccess.size(); final int pos = fRnd.nextInt(size); final CtfTmfContext victim = fRandomAccess.get(pos); fRandomAccess.set(pos, context); CtfIterator elem = fMap.remove(victim); if (elem.isClosed()) { Activator.getDefault().logError("Found closed iterator in iterator manager. " + victim.getTrace()); elem.dispose(); elem = (CtfIterator) fTrace.createIterator(); } fMap.put(context, elem); victim.dispose(); return elem; } finally { fAccessLock.unlock(); } }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.media_player_layout); VideoView videoView = (VideoView) findViewById(R.id.video_display); Button closeButton = (Button) findViewById(R.id.close_button); final VideoPlayerListener listenerInstance = listener; Intent intent = getIntent(); final String fileName = intent.getStringExtra(FILE_NAME); final String urlToOpen = intent.getStringExtra(URL_TO_OPEN); videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { if (listenerInstance != null) listenerInstance.onVideoComplete(); openUrl(urlToOpen); } }); closeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listenerInstance != null) listenerInstance.onCancel(); closeActivity(); } }); videoView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (listenerInstance != null) listenerInstance.onVideoClick(); openUrl(urlToOpen); return true; } }); File file = extractFromResource("/assets/" + fileName); videoView.setVideoPath(file.getAbsolutePath()); videoView.requestFocus(); videoView.start(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.media_player_layout); VideoView videoView = (VideoView) findViewById(R.id.video_display); Button closeButton = (Button) findViewById(R.id.close_button); final VideoPlayerListener listenerInstance = listener; Intent intent = getIntent(); final String fileName = intent.getStringExtra(FILE_NAME); final String urlToOpen = intent.getStringExtra(URL_TO_OPEN); videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { if (listenerInstance != null) listenerInstance.onVideoComplete(); openUrl(urlToOpen); } }); closeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listenerInstance != null) listenerInstance.onCancel(); closeActivity(); } }); videoView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (listenerInstance != null) listenerInstance.onVideoClick(); openUrl(urlToOpen); return true; } }); File file = extractFromResource("/assets/" + fileName); if (file != null) { videoView.setVideoPath(file.getAbsolutePath()); videoView.requestFocus(); videoView.start(); } else closeActivity(); }
Source:
public static Version create(String version) { Version v = null; if (version != null && !version.isEmpty()) { SoftReference<Version> vRef = POOL.get(version); v = vRef != null ? vRef.get() : null; if (v == null) { v = VersionParser.parse(version, 0, version.length()); synchronized (POOL) { POOL.put(version, new SoftReference<Version>(v)); } } } return v; }

Target:
public static Version create(String version) { Version v = null; if (version != null && version.length() > 0) { SoftReference<Version> vRef = POOL.get(version); v = vRef != null ? vRef.get() : null; if (v == null) { v = VersionParser.parse(version, 0, version.length()); synchronized (POOL) { POOL.put(version, new SoftReference<Version>(v)); } } } return v; }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof OpenstackNetworkProviderProperties)) { return false; } OpenstackNetworkProviderProperties other = (OpenstackNetworkProviderProperties) obj; return super.equals(obj) && Objects.equals(pluginType, pluginType) && Objects.equals(agentConfiguration, other.agentConfiguration); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof OpenstackNetworkProviderProperties)) { return false; } OpenstackNetworkProviderProperties other = (OpenstackNetworkProviderProperties) obj; return super.equals(obj) && Objects.equals(pluginType, other.pluginType) && Objects.equals(agentConfiguration, other.agentConfiguration); }
Source:
public void setup(){ filename = "./USDAdatabase.txt"; file = new File(filename); lengthOfFile = 0; try { FileReader fr = new FileReader(file); LineNumberReader lnr = new LineNumberReader(fr); while (lnr.readLine() != null) { lengthOfFile++; } } catch(Exception e){ System.out.println(e); } dbp = new DbParser(); foodName = "TURTLE,GREEN,RAW"; }

Target:
public void setup() throws IOException{ filename = "./USDAdatabase.txt"; file = new File(filename); lengthOfFile = 0; FileReader fr = new FileReader(file); LineNumberReader lnr = new LineNumberReader(fr); while (lnr.readLine() != null) { lengthOfFile++; } dbp = new DbParser(); foodName = "TURTLE,GREEN,RAW"; }
Source:
private ServiceName getTracerConfigurationServiceDependency(DeploymentPhaseContext deploymentPhaseContext) { DeploymentUnit deploymentUnit = deploymentPhaseContext.getDeploymentUnit(); JBossWebMetaData jbossWebMetaData = getJBossWebMetaData(deploymentUnit); if (null == jbossWebMetaData || null == jbossWebMetaData.getContextParams()) { return null; } for (ParamValueMetaData param : jbossWebMetaData.getContextParams()) { if (SMALLRYE_OPENTRACING_TRACER_CONFIGURATION.equals(param.getParamName())) { if (param.getParamValue() != null && !param.getParamValue().startsWith(TRACER_CAPABILITY_NAME)) { return TRACER_CAPABILITY.getCapabilityServiceName(param.getParamValue()); } return ServiceName.parse(param.getParamValue()); } } final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); if (support.hasCapability(DEFAULT_TRACER_CAPABILITY_NAME)) { return DEFAULT_TRACER_CAPABILITY.getCapabilityServiceName(); } return null; }

Target:
private ServiceName getTracerConfigurationServiceDependency(DeploymentPhaseContext deploymentPhaseContext) { DeploymentUnit deploymentUnit = deploymentPhaseContext.getDeploymentUnit(); JBossWebMetaData jbossWebMetaData = getJBossWebMetaData(deploymentUnit); if (null == jbossWebMetaData || null == jbossWebMetaData.getContextParams()) { return null; } for (ParamValueMetaData param : jbossWebMetaData.getContextParams()) { if (SMALLRYE_OPENTRACING_TRACER_CONFIGURATION.equals(param.getParamName())) { String value = param.getParamValue(); if (value != null && !value.isEmpty()) { return TRACER_CAPABILITY.getCapabilityServiceName(value); } } } return null; }
Source:
private void downloadPatient(Patient patient) { ToastUtil.showShortToast(mContext, ToastUtil.ToastType.NOTICE, R.string.download_started); new PatientApi().downloadPatientByUuid(patient.getUuid(), new DownloadPatientCallbackListener() { @Override public void onPatientDownloaded(Patient patient) { new PatientDAO().savePatient(patient); new PatientApi().syncPatient(patient); new VisitApi().syncVisitsData(patient); new VisitApi().syncLastVitals(patient.getUuid()); ToastUtil.success("Patient with UUID " + patient.getUuid() + " is now available locally"); } @Override public void onResponse() @Override public void onErrorResponse() { ToastUtil.error("Failed to fetch patient data"); } }); }

Target:
private void downloadPatient(Patient patient) { ToastUtil.showShortToast(mContext, ToastUtil.ToastType.NOTICE, R.string.download_started); new PatientDAO().savePatient(patient); new VisitApi().syncVisitsData(patient); new VisitApi().syncLastVitals(patient.getUuid()); ToastUtil.success("Patient with UUID " + patient.getUuid() + " is now available locally"); }
Source:
public void whenInvalidCursorThenException() throws Exception { subscriptionBase.setInitialCursors(ImmutableList.of( new SubscriptionCursorWithoutToken(ET1, P0, ""), new SubscriptionCursorWithoutToken(ET2, P0, ""), new SubscriptionCursorWithoutToken(ET3, P0, "") )); final NakadiCursor tmp = mock(NakadiCursor.class); when(cursorConverter.convert((SubscriptionCursorWithoutToken) any())).thenReturn(tmp); doThrow(new InvalidCursorException(CursorError.INVALID_FORMAT)) .when(topicRepository).validateReadCursors(any()); subscriptionValidationService.validateSubscription(subscriptionBase, client); }

Target:
public void whenInvalidCursorThenException() throws Exception { subscriptionBase.setInitialCursors(ImmutableList.of( new SubscriptionCursorWithoutToken(ET1, P0, ""), new SubscriptionCursorWithoutToken(ET2, P0, ""), new SubscriptionCursorWithoutToken(ET3, P0, "") )); final NakadiCursor cursor = mock(NakadiCursor.class); when(cursorConverter.convert((SubscriptionCursorWithoutToken) any())).thenReturn(cursor); doThrow(new InvalidCursorException(CursorError.INVALID_FORMAT)) .when(topicRepository).validateReadCursors(any()); subscriptionValidationService.validateSubscription(subscriptionBase, client); }
Source:
public void display(Mod mod) { this.mod = mod; panel.removeAll(); if (mod != null){ panel.setBorder(BorderFactory.createTitledBorder(mod.getName() + (mod.isUpdateable()? " - by " + mod.getCreator() : " - added from zip"))); if (!mod.isUpdateable()){ panel.add(new JLabel("<html><b>Warning:</b> Local File Only. Not updateable.</html>")); } else if(mod.isUpdateAvailable()) { panel.add(new JLabel("<html><b>An update for this mod is available.</b></html>")); } panel.add(new JLabel("Mod Version: " + mod.getNewestFileName())); String kspVersion = mod.getSupportedVersion(); panel.add(new JLabel("KSP Version: " + (kspVersion != null ? kspVersion : "Unknown"))); JLabel updatedLabel = new JLabel(); Date updatedOn = mod.getUpdatedOn(); updatedLabel.setText("Last Updated: " + (updatedOn != null ? DATE_FORMAT.format(updatedOn) : "N/A")); panel.add(updatedLabel); panel.add(new JLabel("Mod origin: " + mod.getOriginSite())); panel.add(new UrlPanel("Go to Mod Page", mod.getPageUrl()).getComponent()); Path zipPath = mod.getCachedImagePath(config); if (zipPath != null && zipPath.toFile().exists()){ String readmeText = ModStructure.getReadmeText(config, mod); if (readmeText != null && !readmeText.trim().isEmpty()){ panel.add(new JLabel("<html><b>Readme:</b></html")); JTextArea readmeArea = new JTextArea(readmeText); readmeArea.setLineWrap(true); readmeArea.setWrapStyleWord(true); readmeArea.setEditable(false); panel.add(readmeArea); } } } }

Target:
public void display(Mod mod) { this.mod = mod; panel.removeAll(); if (mod != null){ panel.setBorder(BorderFactory.createTitledBorder(mod.getName() + (mod.isUpdateable()? " - by " + mod.getCreator() : " - added from zip"))); if (!mod.isUpdateable()){ panel.add(new JLabel("<html><b>Warning:</b> Local File Only. Not updateable.</html>")); } else if(mod.isUpdateAvailable()) { panel.add(new JLabel("<html><b>An update for this mod is available.</b></html>")); } panel.add(new JLabel("Mod Version: " + mod.getNewestFileName())); String kspVersion = mod.getSupportedVersion(); panel.add(new JLabel("KSP Version: " + (kspVersion != null ? kspVersion : "Unknown"))); JLabel updatedLabel = new JLabel(); Date updatedOn = mod.getUpdatedOn(); updatedLabel.setText("Last Updated: " + (updatedOn != null ? DATE_FORMAT.format(updatedOn) : "N/A")); panel.add(updatedLabel); panel.add(new UrlPanel("Go to Mod Page (on " + String.valueOf(mod.getOriginSite()) + ")", mod.getPageUrl()).getComponent()); Path zipPath = mod.getCachedImagePath(config); if (zipPath != null && zipPath.toFile().exists()){ String readmeText = ModStructure.getReadmeText(config, mod); if (readmeText != null && !readmeText.trim().isEmpty()){ panel.add(new JLabel("<html><b>Readme:</b></html")); JTextArea readmeArea = new JTextArea(readmeText); readmeArea.setLineWrap(true); readmeArea.setWrapStyleWord(true); readmeArea.setEditable(false); panel.add(readmeArea); } } } }
Source:
public String topic() { return String.valueOf(hnd.orderedTopic()); }

Target:
public String topic() { return toStringSafe(hnd.orderedTopic()); }
Source:
private static void multipartUpload(ServerSideMultipartManager multipart) { String uploadObject = MantaClient.SEPARATOR + mantaUsername + "/stor/multipart"; try { ServerSideMultipartUpload upload = multipart.initiateUpload(uploadObject); MantaMultipartUploadPart part1 = multipart.uploadPart(upload, 1, RandomUtils.nextBytes(5242880)); MantaMultipartUploadPart part2 = multipart.uploadPart(upload, 2, RandomUtils.nextBytes(1000000)); MantaMultipartUploadTuple[] parts = new MantaMultipartUploadTuple[] { part1, part2 }; Stream<MantaMultipartUploadTuple> partsStream = Arrays.stream(parts); multipart.complete(upload, partsStream); System.out.println(uploadObject + " is now assembled!"); } catch (IOException e) { ContextedRuntimeException exception = new ContextedRuntimeException( "A network error occurred when doing a multipart upload to Manta."); exception.setContextValue("path", uploadObject); throw exception; } }

Target:
private static void multipartUpload(ServerSideMultipartManager multipart) { String uploadObject = SEPARATOR + mantaUsername + SEPARATOR + "stor" + SEPARATOR + "multipart"; try { ServerSideMultipartUpload upload = multipart.initiateUpload(uploadObject); MantaMultipartUploadPart part1 = multipart.uploadPart(upload, 1, RandomUtils.nextBytes(5242880)); MantaMultipartUploadPart part2 = multipart.uploadPart(upload, 2, RandomUtils.nextBytes(1000000)); MantaMultipartUploadTuple[] parts = new MantaMultipartUploadTuple[] { part1, part2 }; Stream<MantaMultipartUploadTuple> partsStream = Arrays.stream(parts); multipart.complete(upload, partsStream); System.out.println(uploadObject + " is now assembled!"); } catch (IOException e) { ContextedRuntimeException exception = new ContextedRuntimeException( "A network error occurred when doing a multipart upload to Manta."); exception.setContextValue("path", uploadObject); throw exception; } }
Source:
public ExecutionResponse execute(final Project project, final Execution execution) { try { return restTemplate.postForObject( EXECUTION_URI, notNull(execution, "execution"), ExecutionResponse.class, notNull(project, "project").getId()); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to execute AFM", e); } }

Target:
public ExecutionResponse execute(final Project project, final Execution execution) { final String projectId = notNull(notNull(project, "project").getId(), "projectId"); final ExecutionResponse response; try { response = restTemplate.postForObject( EXECUTION_URI, notNull(execution, "execution"), ExecutionResponse.class, projectId); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to execute AFM", e); } if (response == null) { throw new GoodDataException("Empty response when execution posted to API"); } return response; }
Source:
public void testDeleteFragmentizing() throws Exception { IgfsImpl igfs = (IgfsImpl)grid(0).fileSystem("igfs"); for (int i = 0; i < 30; i++) { IgfsPath path = new IgfsPath("/someFile" + i); try (IgfsOutputStream out = igfs.create(path, true)) { for (int j = 0; j < 5 * IGFS_GROUP_SIZE; j++) out.write(new byte[IGFS_BLOCK_SIZE]); } U.sleep(200); } igfs.clear(); for (int i = 0; i < NODE_CNT; i++) { IgniteEx g = grid(i); GridCacheAdapter<Object, Object> cache = ((IgniteKernal)g).internalCache( g.igfsx("igfs").configuration().getDataCacheConfiguration().getName()); boolean isCacheEmpty = GridTestUtils.waitForCondition(() -> cache.isEmpty(), 5000); assertTrue("Data cache is not empty [keys=" + cache.keySet() + ", node=" + g.localNode().id() + ']', isCacheEmpty); } }

Target:
public void testDeleteFragmentizing() throws Exception { IgfsImpl igfs = (IgfsImpl)grid(0).fileSystem("igfs"); for (int i = 0; i < 30; i++) { IgfsPath path = new IgfsPath("/someFile" + i); try (IgfsOutputStream out = igfs.create(path, true)) { for (int j = 0; j < 5 * IGFS_GROUP_SIZE; j++) out.write(new byte[IGFS_BLOCK_SIZE]); } U.sleep(200); } igfs.clear(); IntStream.range(0, NODE_CNT).parallel().forEach(i -> { IgniteEx g = grid(i); GridCacheAdapter<Object, Object> cache = ((IgniteKernal)g).internalCache( g.igfsx("igfs").configuration().getDataCacheConfiguration().getName()); boolean isCacheEmpty = GridTestUtils.waitUntil(() -> cache.isEmpty(), 1000); assertTrue("Data cache is not empty [keys=" + cache.keySet() + ", node=" + g.localNode().id() + ']', isCacheEmpty); }); }
Source:
public static RemoteWebDriver createInstance(BrowserFlavors browser) { DesiredCapabilities capability = null; RemoteWebDriver driver = null; switch (browser) { case FIREFOX: capability = new FireFoxCapabilitiesBuilder().createCapabilities(); break; case CHROME: capability = new ChromeCapabilitiesBuilder().createCapabilities(); break; case INTERNET_EXPLORER: capability = new IECapabilitiesBuilder().createCapabilities(); break; case MICROSOFT_EDGE: capability = new EdgeCapabilitiesBuilder().createCapabilities(); break; case HTMLUNIT: capability = new HtmlUnitCapabilitiesBuilder().createCapabilities(); break; case OPERA: capability = new OperaCapabilitiesBuilder().createCapabilities(); break; case PHANTOMJS: capability = new PhantomJSCapabilitiesBuilder().createCapabilities(); break; case SAFARI: capability = new SafariCapabilitiesBuilder().createCapabilities(); break; default: break; } capability = new UserCapabilitiesBuilder().getCapabilities(capability); logger.log(Level.FINE, "Spawning a browser with the following capabilities: " + DriverFactoryHelper.showCapabilities(capability)); driver = createDriverInstance(DriverFactoryHelper.getURL(), capability); if (Boolean.parseBoolean(Config.getConfigProperty(ConfigProperty.PRINT_DEBUG_INFO))) { DriverFactoryHelper.printDebugInfoForUser(driver); } return driver; }

Target:
public static RemoteWebDriver createInstance(BrowserFlavors browser) { DesiredCapabilities capability = null; RemoteWebDriver driver = null; switch (browser) { case FIREFOX: capability = new FireFoxCapabilitiesBuilder().createCapabilities(); break; case CHROME: capability = new ChromeCapabilitiesBuilder().createCapabilities(); break; case INTERNET_EXPLORER: capability = new IECapabilitiesBuilder().createCapabilities(); break; case MICROSOFT_EDGE: capability = new EdgeCapabilitiesBuilder().createCapabilities(); break; case HTMLUNIT: capability = new HtmlUnitCapabilitiesBuilder().createCapabilities(); break; case OPERA: capability = new OperaCapabilitiesBuilder().createCapabilities(); break; case PHANTOMJS: capability = new PhantomJSCapabilitiesBuilder().createCapabilities(); break; case SAFARI: capability = new SafariCapabilitiesBuilder().createCapabilities(); break; default: break; } capability = new UserCapabilitiesBuilder().getCapabilities(capability); logger.log(Level.FINE, "Spawning a browser with the following capabilities: " + DriverFactoryHelper.showCapabilities(capability)); driver = createDriverInstance(DriverFactoryHelper.getURL(), capability); if (Config.getBoolConfigProperty(ConfigProperty.PRINT_DEBUG_INFO)) { DriverFactoryHelper.printDebugInfoForUser(driver); } return driver; }
Source:
private static String getManagementRealmUrl(URL authUrl) { String scheme = "realm"; if (authUrl.getProtocol().equals("https")) { scheme = "realms"; } try { return new URI(scheme, authUrl.getUserInfo(), authUrl.getHost(), authUrl.getPort(), "/~/__management", null, null).toString(); } catch (URISyntaxException e) { throw new IllegalArgumentException("Could not create URL to the management Realm", e); } }

Target:
private static String getManagementRealmUrl(URL authUrl) { String scheme = "realm"; if (authUrl.getProtocol().equalsIgnoreCase("https")) { scheme = "realms"; } try { return new URI(scheme, authUrl.getUserInfo(), authUrl.getHost(), authUrl.getPort(), "/~/__management", null, null).toString(); } catch (URISyntaxException e) { throw new IllegalArgumentException("Could not create URL to the management Realm", e); } }
Source:
public SimpleObject get(@PathVariable("resource") String resource, @PathVariable("parentUuid") String parentUuid, @PathVariable("subResource") String subResource, HttpServletRequest request, HttpServletResponse response) throws ResponseException { baseUriSetup.setup(request); SubResource res = (SubResource) restService.getResourceByName(buildResourceName(resource) + "/" + subResource); RequestContext context = RestUtil.getRequestContext(request, response); Converter conv = res instanceof Converter ? (Converter) res : null; @SuppressWarnings("unchecked") SubResourceSearchHandler searchHandler = (SubResourceSearchHandler) restService.getSearchHandler(buildResourceName(resource) + "/" + subResource, request.getParameterMap()); if (searchHandler != null) { return searchHandler.search(parentUuid, context).toSimpleObject(conv); } return res.getAll(parentUuid, context); }

Target:
public SimpleObject get(@PathVariable("resource") String resource, @PathVariable("parentUuid") String parentUuid, @PathVariable("subResource") String subResource, HttpServletRequest request, HttpServletResponse response) throws ResponseException { baseUriSetup.setup(request); SubResource res = (SubResource) restService.getResourceByName(buildResourceName(resource) + "/" + subResource); RequestContext context = RestUtil.getRequestContext(request, response); Converter conv = res instanceof Converter ? (Converter) res : null; @SuppressWarnings("unchecked") SubResourceSearchHandler searchHandler = (SubResourceSearchHandler) restService.getSearchHandler( buildResourceName(resource) + "/" + subResource, request.getParameterMap()); if (searchHandler != null) { return searchHandler.search(parentUuid, context).toSimpleObject(conv); } Enumeration parameters = request.getParameterNames(); while (parameters.hasMoreElements()) { if (!RestConstants.SPECIAL_REQUEST_PARAMETERS.contains(parameters.nextElement())) { if (res instanceof Searchable) { return ((Searchable) res).search(context); } else { throw new ResourceDoesNotSupportOperationException(res.getClass().getSimpleName() + " is not searchable"); } } } return res.getAll(parentUuid, context); }
Source:
protected void tearDown() throws Exception { sessionResourceURI = null; super.tearDown(); }

Target:
protected void tearDown() throws Exception { if (defaultUiCallback != null) { SiriusEditPlugin.getPlugin().setUiCallback(defaultUiCallback); } sessionResourceURI = null; super.tearDown(); }
Source:
public Streamlet<R> withStream(String streamId) { StreamletUtils.require(streamId != null && !streamId.isEmpty(), "streamId can't be empty"); this.streamId = streamId; return this; }

Target:
public Streamlet<R> withStream(String streamId) { checkNotBlank(streamId, "streamId can't be empty"); Set<String> availableIds = getAvailableStreamIds(); if (availableIds.contains(streamId)) { StreamletShadow<R> shadow = new StreamletShadow<R>(this); shadow.setStreamId(streamId); return shadow; } else { throw new RuntimeException( String.format("Stream id %s is not available in %s. Available ids are: %s.", streamId, getName(), availableIds.toString())); } }
Source:
public Optional<Long> getCounterValue(String key) { Long value = counters.get(key); if (value == null) { return Optional.empty(); } return Optional.of(value); }

Target:
public Optional<Long> getCounterValue(String key) { return Optional.ofNullable(counters.get(key)); }
Source:
public void updateServiceGroup(ServiceGroup serviceGroup) throws InvalidServiceGroupException { try { if (serviceGroup == null || StringUtils.isEmpty(serviceGroup.getName())) { throw new IllegalArgumentException("Cartridge group or group name cannot be null"); } if (getServiceGroup(serviceGroup.getName()) == null) { throw new InvalidServiceGroupException(String.format("Cartridge group does not exist: " + "[cartridge-group] %s", serviceGroup.getName())); } persistServiceGroup(serviceGroup); if (log.isDebugEnabled()) { log.debug(String.format("Updated cartridge group: [group-name] %s", serviceGroup.getName())); } } catch (Exception e) { log.error((String.format("Unable to update cartridge group [group-name] %s", serviceGroup.getName())), e); } }

Target:
public void updateServiceGroup(ServiceGroup serviceGroup) throws InvalidServiceGroupException, RegistryException { try { if (serviceGroup == null || StringUtils.isEmpty(serviceGroup.getName())) { throw new IllegalArgumentException("Cartridge group or group name cannot be null"); } if (getServiceGroup(serviceGroup.getName()) == null) { throw new InvalidServiceGroupException(String.format("Cartridge group does not exist: " + "[cartridge-group] %s", serviceGroup.getName())); } persistServiceGroup(serviceGroup); if (log.isDebugEnabled()) { log.debug(String.format("Updated cartridge group: [group-name] %s", serviceGroup.getName())); } } catch (Exception e) { String message = (String.format("Unable to update cartridge group [group-name] %s", serviceGroup.getName())); log.error(message, e); throw new RegistryException(message, e); } }
Source:
public void Execute(Campaign campaign, Unit unit) { if (isGM) { unit.startActivating(null, true); } else { if (!unit.isSelfCrewed() && null == techId) { return; } unit.startActivating(campaign.getPerson(techId)); } }

Target:
public void Execute(Campaign campaign, Unit unit) { if (isGM) { unit.startActivating(null, true); } else { if (!unit.isSelfCrewed() && (null == tech)) { return; } unit.startActivating(tech); } }
Source:
public void getInstanceAsync_nonLooperThreadShouldThrow() { Realm.getInstanceAsync(realmConfig, new Realm.Callback() { @Override public void onSuccess(Realm realm) { } }); }

Target:
public void getInstanceAsync_nonLooperThreadShouldThrow() { Realm.getInstanceAsync(realmConfig, new Realm.Callback() { @Override public void onSuccess(Realm realm) { fail(); } }); }
Source:
public void testPrintXpathFullOption() throws Exception { final String expected = addEndOfLine( "CLASS_DEF -> CLASS_DEF [3:0]", "`--OBJBLOCK -> OBJBLOCK [3:28]", " |--METHOD_DEF -> METHOD_DEF [8:4]", " | `--SLIST -> { [8:26]", " | |--VARIABLE_DEF -> VARIABLE_DEF [9:8]", " | | |--IDENT -> a [9:12]"); exit.checkAssertionAfterwards(() -> { Assert.assertThat("Unexpected output log", systemOut.getLog(), is(expected)); Assert.assertThat("Unexpected system error log", systemErr.getLog(), is("")); }); Main.main("--tree-branch-for-xpath", "/CLASS_DEF + " getPath("InputMainXPath.java")); }

Target:
public void testPrintXpathFullOption() throws Exception { final String expected = addEndOfLine( "CLASS_DEF -> CLASS_DEF [3:0]", "`--OBJBLOCK -> OBJBLOCK [3:28]", " |--METHOD_DEF -> METHOD_DEF [8:4]", " | `--SLIST -> { [8:26]", " | |--VARIABLE_DEF -> VARIABLE_DEF [9:8]", " | | |--IDENT -> a [9:12]"); exit.checkAssertionAfterwards(() -> { Assert.assertThat("Unexpected output log", systemOut.getLog(), is(expected)); Assert.assertThat("Unexpected system error log", systemErr.getLog(), is("")); }); final String xpath = "/CLASS_DEF Main.main("--branch-matching-xpath", xpath, getPath("InputMainXPath.java")); }
Source:
public void test_translations() { Translations translations = getManager().moviesService().translations(TestData.MOVIE_ID, null); assertThat(translations).isNotNull(); assertThat(translations.id).isEqualTo(TestData.MOVIE_ID); assertThat(translations.translations.get(0).name).isNotNull(); assertThat(translations.translations.get(0).iso_639_1).isNotNull(); assertThat(translations.translations.get(0).english_name).isNotNull(); }

Target:
public void test_translations() { Translations translations = getManager().moviesService().translations(TestData.MOVIE_ID, null); assertThat(translations).isNotNull(); assertThat(translations.id).isEqualTo(TestData.MOVIE_ID); for (Translations.Translation translation : translations.translations) { assertThat(translation.name).isNotNull(); assertThat(translation.iso_639_1).isNotNull(); assertThat(translation.english_name).isNotNull(); } }
Source:
protected ScriptWrapper(String name, String description, String engineName, String typeName, boolean enabled, File file) { super(); this.name = name; this.description = description; this.engineName = engineName; this.typeName = typeName; this.enabled = enabled; this.file = file; this.setFile(file); }

Target:
protected ScriptWrapper(String name, String description, String engineName, String typeName, boolean enabled, File file) { super(); this.name = name; this.description = description; this.engineName = engineName; this.typeName = typeName; this.enabled = enabled; this.setFile(file); }