auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>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(), <START> listenerObject.getClass().getName()); <END> 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); }</code><technical_language>nice dump stack trace well. I a private Bukkit plugin (I believe) is registering a listener twice, I registration is</technical_language>

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:
<code>public <T> Enumeration<T> resources(Class<? extends T> resourceClass) { return <START> (Enumeration<T>) (isJarResource(resourceClass) ? (Enumeration<T>) jarFile.entries() : Collections.emptyEnumeration()); <END> }</code><technical_language>above... simple if/else here</technical_language>

Target:
public <T> Enumeration<T> resources(Class<? extends T> resourceClass) { if (isJarResource(resourceClass)) { return (Enumeration<T>) jarFile.entries(); } else { return Collections.emptyEnumeration(); } }
Source:
<code>public void readFully(long position, byte[] buffer) <START> throws IOException <END> { }</code><technical_language>throws IOException is needed. for other readFullys</technical_language>

Target:
public void readFully(long position, byte[] buffer) { }
Source:
<code>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"); <START> Thread.sleep(3000); <END> } 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; } }</code><technical_language>this magic number a static variable</technical_language>

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:
<code>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; <START> this.firewallTagNamingConvention = firewallTagNamingConvention; <END> }</code><technical_language>null check</technical_language>

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:
<code>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()) { <START> LOG.info("buildVendorDiversitiesFromPmwFormCheckboxes, " + PaymentWorksConstants.FOREIGN_FORM_PROCESSING_NOT_IMPLEMENTED_LOG_MESSAGE); <END> } return kfsVendorSupplierDiversities; }</code><technical_language>sense empty stub method for processing in case of foreign form mode</technical_language>

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:
<code>private void processDeviceAuthDeniedResponse(Map<String, String> sessionAttribute) { String userCode = sessionAttribute.get(AuthorizeRequestParam.USER_CODE); DeviceAuthorizationCacheControl cacheData = deviceAuthorizationService.getDeviceAuthzByUserCode(userCode); if (cacheData != null) { <START> if (cacheData.getStatus() == DeviceAuthorizationStatus.PENDING) { <END> cacheData.setStatus(DeviceAuthorizationStatus.DENIED); deviceAuthorizationService.saveInCache(cacheData, true, false); deviceAuthorizationService.removeDeviceAuthRequestInCache(userCode, null); } } }</code><technical_language>&& 2 ifs</technical_language>

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:
<code>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) <START> boolean extended = CDebugUtils.getAttribute( <END> 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(); } }</code><technical_language>need revisited based decision launch --multi flag</technical_language>

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:
<code>public final X next() { if(!hasNext()) { throw new NoSuchElementException(); } <START> assert current != null; <END> X result = current; current = null; return result; }</code><technical_language>this class init current in constructor, do if (current == null) { throw new NoSuchElementException() }</technical_language>

Target:
public final X next() { if(current == null) { throw new NoSuchElementException(); } X result = current; fetchNext(); return result; }
Source:
<code>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)); } <START> if(boundDimFilter.getOrdering().equals(StringComparators.NUMERIC)) { <END> return input -> floatPredicateSupplier.get().applyFloat((float) input); } return input -> doesMatch(String.valueOf(input)); } }; }</code><technical_language>Space</technical_language>

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:
<code>public static List<String> getStringFromTargets(Path prjPath) { final List<String> classPathFiles = new ArrayList<>(); <START> searchTargetFiles(prjPath, <END> classPathFiles, JAVA_CLASS_EXT, DROOLS_EXT, GDROOLS_EXT, RDROOLS_EXT, XML_EXT, SCENARIO_EXT); return classPathFiles; }</code><technical_language>this idiom mutate a passed argument a method is counter intuitive, return collection? I this is a recursive thing, done. I find this confuse vs. reference behavior Java</technical_language>

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:
<code>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()) { <START> String traceLog = victim.getTrace() != null ? victim.getTrace().toString() : ""; END> 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(); } }</code><technical_language>NonNullUtils: nullToEmptyString(victim.getTrace())</technical_language>

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:
<code>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(); <START> openUrl(urlToOpen); <END> } }); 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(); }</code><technical_language>is handle this in listener unity side</technical_language>

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:
<code>public static Version create(String version) { Version v = null; if (version != null && <START> !version.isEmpty()) <END> { 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; }</code><technical_language>p2 Java 5 BREE String.isEmpty exist Java 6. version.length() > 0 instead</technical_language>

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:
<code>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, <START> pluginType) <END> && Objects.equals(agentConfiguration, other.agentConfiguration); }</code><technical_language>I guess forgot "other." prefix</technical_language>

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:
<code>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++; } <START> } <END> catch(Exception e){ System.out.println(e); } dbp = new DbParser(); foodName = "TURTLE,GREEN,RAW"; }</code><technical_language>revise this exception code</technical_language>

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:
<code>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()); } <START> return ServiceName.parse(param.getParamValue()); <END> } } final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); if (support.hasCapability(DEFAULT_TRACER_CAPABILITY_NAME)) { return DEFAULT_TRACER_CAPABILITY.getCapabilityServiceName(); } return null; }</code><technical_language>I do this. Capability service names internal details usable explicit configuration values</technical_language>

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:
<code>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"); } <START> }); <END> }</code><technical_language>@tmarzeion This code crashes app. NPE in getPatientID method due asyncs problems probably</technical_language>

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:
<code>public void whenInvalidCursorThenException() throws Exception { subscriptionBase.setInitialCursors(ImmutableList.of( new SubscriptionCursorWithoutToken(ET1, P0, ""), new SubscriptionCursorWithoutToken(ET2, P0, ""), new SubscriptionCursorWithoutToken(ET3, P0, "") )); <START> final NakadiCursor tmp = mock(NakadiCursor.class); <END> when(cursorConverter.convert((SubscriptionCursorWithoutToken) any())).thenReturn(tmp); doThrow(new InvalidCursorException(CursorError.INVALID_FORMAT)) .when(topicRepository).validateReadCursors(any()); subscriptionValidationService.validateSubscription(subscriptionBase, client); }</code><technical_language>give a nicer name, I tmp is a bad name</technical_language>

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:
<code>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); <START> panel.add(new JLabel("Mod origin: " + mod.getOriginSite())); <END> 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); } } } }</code><technical_language>instead move this "Go Mod Page" hyperlink, below, please? "Go < host > page"</technical_language>

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:
<code>public String topic() { <START> return String.valueOf(hnd.orderedTopic()); <END> }</code><technical_language>Pay attention methods of this class return null String, this method returns "null" String</technical_language>

Target:
public String topic() { return toStringSafe(hnd.orderedTopic()); }
Source:
<code>private static void multipartUpload(ServerSideMultipartManager multipart) { <START> String uploadObject = MantaClient.SEPARATOR + mantaUsername + "/stor/multipart"; <END> 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; } }</code><technical_language>separator for slashes in /stor/multipart string well</technical_language>

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:
<code>public ExecutionResponse execute(final Project project, final Execution execution) { try { return restTemplate.postForObject( EXECUTION_URI, notNull(execution, "execution"), ExecutionResponse.class, <START> notNull(project, "project").getId()); <END> } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to execute AFM", e); } }</code><technical_language>if project.getId is null</technical_language>

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:
<code>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()); <START> boolean isCacheEmpty = GridTestUtils.waitForCondition(() -> cache.isEmpty(), 5000); <END> assertTrue("Data cache is not empty [keys=" + cache.keySet() + ", node=" + g.localNode().id() + ']', isCacheEmpty); } }</code><technical_language>In worst case wait for NODE_CNT * 5 sec, this change w'd wait for 5 sec in total</technical_language>

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:
<code>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); <START> if (Boolean.parseBoolean(Config.getConfigProperty(ConfigProperty.PRINT_DEBUG_INFO))) { <END> DriverFactoryHelper.printDebugInfoForUser(driver); } return driver; }</code><technical_language>is a method getBoolConfigProperty in Config here</technical_language>

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:
<code>private static String getManagementRealmUrl(URL authUrl) { String scheme = "realm"; <START> if (authUrl.getProtocol().equals("https")) { <END> 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); } }</code><technical_language>equalsIgnoreCase for capital URL</technical_language>

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:
<code>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); <START> Converter conv = res instanceof Converter ? (Converter) res : null; <END> @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); }</code><technical_language>a MainResourceController.get implemented, I try replicate behavior</technical_language>

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:
<code>protected void tearDown() throws Exception { sessionResourceURI = null; <START> super.tearDown(); <END> }</code><technical_language>reset previous version of global callback</technical_language>

Target:
protected void tearDown() throws Exception { if (defaultUiCallback != null) { SiriusEditPlugin.getPlugin().setUiCallback(defaultUiCallback); } sessionResourceURI = null; super.tearDown(); }
Source:
<code>public Streamlet<R> withStream(String streamId) { <START> StreamletUtils.require(streamId != null && !streamId.isEmpty(), "streamId can't be empty"); <END> this.streamId = streamId; return this; }</code><technical_language>wondering case: if Bolt points invalid streamId (not matched parentStreamId of Spout/Bolt) **validation** required? (to cover this case **fail-fast** **warning message** due redundant Bolt)</technical_language>

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:
<code>public Optional<Long> getCounterValue(String key) { Long value = counters.get(key); if (value == null) { return Optional.empty(); } <START> return Optional.of(value); <END> }</code><technical_language>a simpler way: java return Optional.ofNullable(counters.get(key));</technical_language>

Target:
public Optional<Long> getCounterValue(String key) { return Optional.ofNullable(counters.get(key)); }
Source:
<code>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())); } <START> } catch (Exception e) { <END> log.error((String.format("Unable to update cartridge group [group-name] %s", serviceGroup.getName())), e); } }</code><technical_language>throw exception client</technical_language>

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:
<code>public void Execute(Campaign campaign, Unit unit) { if (isGM) { unit.startActivating(null, true); } else { if (!unit.isSelfCrewed() && null == techId) { return; } <START> unit.startActivating(campaign.getPerson(techId)); <END> } }</code><technical_language>is this Id</technical_language>

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:
<code>public void getInstanceAsync_nonLooperThreadShouldThrow() { Realm.getInstanceAsync(realmConfig, new Realm.Callback() { @Override public void onSuccess(Realm realm) { <START> } <END> }); }</code><technical_language>fail(); in onSuccess()</technical_language>

Target:
public void getInstanceAsync_nonLooperThreadShouldThrow() { Realm.getInstanceAsync(realmConfig, new Realm.Callback() { @Override public void onSuccess(Realm realm) { fail(); } }); }