auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void getCores(IDMContext dmc, final DataRequestMonitor<ICoreDMContext[]> rm) { if (!getSessionInitializationComplete()) { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Debug session not initialized yet", null)); return; } if (dmc instanceof ICPUDMContext) { final ICPUDMContext cpuDmc = (ICPUDMContext)dmc; getResourcesInformation(dmc, CPUResourceClass, new DataRequestMonitor<IResourcesInformation>(getExecutor(), rm) { @Override <START> @ConfinedToDsfExecutor("fExecutor") <END> protected void handleCompleted() { if (isSuccess()) { ICoreInfo[] cores = new CoreList(getData()).getCoreList(); rm.done(parseCoresInfoForCores(cpuDmc, cores)); } else { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, NOT_SUPPORTED, "Operation not supported", null)); } } }); } else { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid DMC type", null)); } }</code><technical_language>Replace fExecutor (which exist) getExecutor()</technical_language>

Target:
public void getCores(IDMContext dmc, final DataRequestMonitor<ICoreDMContext[]> rm) { if (!getSessionInitializationComplete()) { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Debug session not initialized yet", null)); return; } if (dmc instanceof ICPUDMContext) { final ICPUDMContext cpuDmc = (ICPUDMContext)dmc; if (coreListCache != null) { rm.done(parseCoresInfoForCores(cpuDmc, coreListCache)); return; } getResourcesInformation(dmc, CPUResourceClass, new DataRequestMonitor<IResourcesInformation>(getExecutor(), rm) { @Override @ConfinedToDsfExecutor("getExecutor()") protected void handleCompleted() { if (isSuccess()) { coreListCache = new CoreList(getData()).getCoreList(); rm.done(parseCoresInfoForCores(cpuDmc, coreListCache)); } else { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, NOT_SUPPORTED, "Operation not supported", null)); } } }); } else { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid DMC type", null)); } }
Source:
<code>private <T extends TEntityType.Builder<T>> T convert(org.eclipse.winery.model.tosca.yaml.TEntityType node, T builder) { builder.addDocumentation(node.getDescription()) .setDerivedFrom(node.getDerivedFrom()) .addTags(convertMetadata(node.getMetadata())) .setTargetNamespace(node.getMetadata().get("targetNamespace")); if (node.getVersion() != null) { TTag tag = new TTag(); tag.setName("version"); tag.setValue(node.getVersion().getVersion()); builder.addTags(tag); } if (!node.getProperties().isEmpty()) { WinerysPropertiesDefinition properties = new WinerysPropertiesDefinition(); PropertyDefinitionKVList propertyDefinitionKVList = new PropertyDefinitionKVList(); node.getProperties().forEach((name, property) -> { QName type = TypeConverter.INSTANCE.convert(property.getType()); propertyDefinitionKVList.add(new PropertyDefinitionKV(name, Optional.ofNullable(type.getPrefix()) .map(i -> i.concat(":")).orElse("") .concat(type.getLocalPart()))); }); WinerysPropertiesDefinition propertiesDefinition = new WinerysPropertiesDefinition(); propertiesDefinition.setPropertyDefinitionKVList(propertyDefinitionKVList); builder.addAny(propertiesDefinition); builder.setPropertiesDefinition(convertPropertyDefinition(builder.build().getIdFromIdOrNameField() + "_Properties")); } <START> return builder; <END> }</code><technical_language>This is a duplicate. introduced a WineryPropertiesDefinition variable properties top of if is unused</technical_language>

Target:
private <T extends TEntityType.Builder<T>> T convert(org.eclipse.winery.model.tosca.yaml.TEntityType node, T builder) { builder.addDocumentation(node.getDescription()) .setDerivedFrom(node.getDerivedFrom()) .addTags(convertMetadata(node.getMetadata())) .setTargetNamespace(node.getMetadata().get("targetNamespace")); if (node.getVersion() != null) { TTag tag = new TTag(); tag.setName("version"); tag.setValue(node.getVersion().getVersion()); builder.addTags(tag); } if (!node.getProperties().isEmpty()) { PropertyDefinitionKVList propertyDefinitionKVList = new PropertyDefinitionKVList(); node.getProperties().forEach((name, property) -> { QName type = TypeConverter.INSTANCE.convert(property.getType()); propertyDefinitionKVList.add(new PropertyDefinitionKV(name, Optional.ofNullable(type.getPrefix()) .map(i -> i.concat(":")).orElse("") .concat(type.getLocalPart()))); }); WinerysPropertiesDefinition propertiesDefinition = new WinerysPropertiesDefinition(); propertiesDefinition.setPropertyDefinitionKVList(propertyDefinitionKVList); builder.addAny(propertiesDefinition); builder.setPropertiesDefinition(convertPropertyDefinition(builder.build().getIdFromIdOrNameField() + "_Properties")); } return builder; }
Source:
<code>public DefaultConsistentHash union(DefaultConsistentHash dch2) { if (!hashFunction.equals(dch2.getHashFunction())) { throw new IllegalArgumentException("The consistent hash objects must have the same hash function"); } if (numSegments != dch2.getNumSegments()) { throw new IllegalArgumentException("The consistent hash objects must have the same number of segments"); } if (numOwners != dch2.getNumOwners()) { throw new IllegalArgumentException("The consistent hash objects must have the same number of owners"); } List<Address> unionMembers = new ArrayList<Address>(this.members); mergeLists(unionMembers, dch2.getMembers()); List<Address>[] unionSegmentOwners = new List[numSegments]; for (int i = 0; i < numSegments; i++) { unionSegmentOwners[i] = new ArrayList<Address>(locateOwnersForSegment(i)); mergeLists(unionSegmentOwners[i], dch2.locateOwnersForSegment(i)); } <START> return new DefaultConsistentHash(hashFunction, numOwners, numSegments, unionMembers, capacityFactors, unionSegmentOwners); <END> }</code><technical_language>union of capacityFactors</technical_language>

Target:
public DefaultConsistentHash union(DefaultConsistentHash dch2) { if (!hashFunction.equals(dch2.getHashFunction())) { throw new IllegalArgumentException("The consistent hash objects must have the same hash function"); } if (numSegments != dch2.getNumSegments()) { throw new IllegalArgumentException("The consistent hash objects must have the same number of segments"); } if (numOwners != dch2.getNumOwners()) { throw new IllegalArgumentException("The consistent hash objects must have the same number of owners"); } List<Address> unionMembers = new ArrayList<Address>(this.members); mergeLists(unionMembers, dch2.getMembers()); List<Address>[] unionSegmentOwners = new List[numSegments]; for (int i = 0; i < numSegments; i++) { unionSegmentOwners[i] = new ArrayList<Address>(locateOwnersForSegment(i)); mergeLists(unionSegmentOwners[i], dch2.locateOwnersForSegment(i)); } Map<Address, Float> unionCapacityFactors = null; if (this.capacityFactors != null || dch2.capacityFactors != null) { unionCapacityFactors = new HashMap<Address, Float>(); if (this.capacityFactors != null) { unionCapacityFactors.putAll(this.capacityFactors); } else { for (Address node : this.members) { unionCapacityFactors.put(node, 1.0f); } } if (dch2.capacityFactors != null) { unionCapacityFactors.putAll(dch2.capacityFactors); } else { for (Address node : dch2.members) { unionCapacityFactors.put(node, 1.0f); } } } return new DefaultConsistentHash(hashFunction, numOwners, numSegments, unionMembers, unionCapacityFactors, unionSegmentOwners); }
Source:
<code>public void dispose() { <START> treeViewerManager.dispose(); <END> treeViewerManager = null; if (refreshAtOpeningActivator != null) { getSite().getPage().removePartListener(refreshAtOpeningActivator); } refreshAtOpeningActivator = null; super.dispose(); if (getAdapterFactory() instanceof IDisposable) { ((IDisposable) getAdapterFactory()).dispose(); } }</code><technical_language>is treeViewerManager disposed ? in DTreeEditor in parent AbstractDTreeEditor</technical_language>

Target:
public void dispose() { if (refreshAtOpeningActivator != null) { getSite().getPage().removePartListener(refreshAtOpeningActivator); } refreshAtOpeningActivator = null; super.dispose(); if (getAdapterFactory() instanceof IDisposable) { ((IDisposable) getAdapterFactory()).dispose(); } }
Source:
<code>protected AbstractQualifierPolymorphism( ProcessingEnvironment env, AnnotatedTypeFactory factory) { this.atypeFactory = factory; this.qualHierarchy = factory.getQualifierHierarchy(); this.topQuals = new AnnotationMirrorSet(qualHierarchy.getTopAnnotations()); <START> this.completer = <END> new SimpleAnnotatedTypeScanner<>( (type, p) -> { polyQuals.forEach( (poly, top) -> { if (type.hasAnnotation(poly)) { type.removeAnnotation(poly); if (type.getKind() != TypeKind.TYPEVAR && type.getKind() != TypeKind.WILDCARD) { type.addAnnotation( this.qualHierarchy.getBottomAnnotation( top)); } } }); return null; }); this.replacer = new SimpleAnnotatedTypeScanner<>( (type, map) -> { replace(type, map); return null; }); }</code><technical_language>for completer I I separate non-anonymous class. lambda contains a nested lambda get's hard read</technical_language>

Target:
protected AbstractQualifierPolymorphism( ProcessingEnvironment env, AnnotatedTypeFactory factory) { this.atypeFactory = factory; this.qualHierarchy = factory.getQualifierHierarchy(); this.topQuals = new AnnotationMirrorSet(qualHierarchy.getTopAnnotations()); this.completer = new SimpleAnnotatedTypeScanner<>( (type, p) -> { for (Map.Entry<AnnotationMirror, AnnotationMirror> entry : polyQuals.entrySet()) { AnnotationMirror poly = entry.getKey(); AnnotationMirror top = entry.getValue(); if (type.hasAnnotation(poly)) { type.removeAnnotation(poly); if (type.getKind() != TypeKind.TYPEVAR && type.getKind() != TypeKind.WILDCARD) { type.addAnnotation( this.qualHierarchy.getBottomAnnotation(top)); } } } return null; }); this.replacer = new SimpleAnnotatedTypeScanner<>( (type, map) -> { replace(type, map); return null; }); }
Source:
<code>public Object evaluate(Object feature) { String arg0; JSONObject arg1; try { arg0 = getExpression(0).evaluate(feature, String.class); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function mbGet argument #0 - expected type String"); } try { arg1 = getExpression(1).evaluate(feature, JSONObject.class); } catch (Exception e) { throw new IllegalArgumentException( <START> "Filter Function problem for function mbGet argument #1 - expected type JSONObject"); <END> } return arg1.get(arg0); }</code><technical_language>mbGet in exceptions - want double check this for functions changed names</technical_language>

Target:
public Object evaluate(Object feature) { String arg0; JSONObject arg1; try { arg0 = getExpression(0).evaluate(feature, String.class); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function \"get\" argument #0 - expected type String"); } try { arg1 = getExpression(1).evaluate(feature, JSONObject.class); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function \"get\" argument #1 - expected type JSONObject"); } return arg1.get(arg0); }
Source:
<code>public static Certificate buildCertificate(final String content) throws CertificateException { <START> assert content != null; <END> final BufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(content.getBytes())); final CertificateFactory cf = CertificateFactory.getInstance("X.509"); return cf.generateCertificate(bis); }</code><technical_language>run assertions enabled, please consider converting assert Preconditions.checkArgument. Also, check content is blank null</technical_language>

Target:
public static Certificate buildCertificate(final String content) throws CertificateException { Preconditions.checkNotNull(content, "Certificate content cannot be null"); final BufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(content.getBytes())); final CertificateFactory cf = CertificateFactory.getInstance("X.509"); return cf.generateCertificate(bis); }
Source:
<code><START> public HdfsSplitInfo(final String inputPath, final InputSplit inputSplit, final String inputFormatClassName) { <END> this.inputPath = inputPath; this.inputSplit = inputSplit; this.inputFormatClassName = inputFormatClassName; }</code><technical_language>a builder instead of a public constructor is</technical_language>

Target:
private HdfsSplitInfo(final String inputPath, final InputSplit inputSplit, final String inputFormatClassName) { this.inputPath = inputPath; this.inputSplit = inputSplit; this.inputFormatClassName = inputFormatClassName; }
Source:
<code>public String sendUpdateDescriptionOperation(String userid, Collection<PID> pids) { Element contentEl = createAtomEntry(userid, pids.iterator().next(), <START> CDRActions.UPDATE_MODS); <END> Element updateEl = new Element("updateMods", CDR_MESSAGE_NS); contentEl.addContent(updateEl); Element subjects = new Element("subjects", CDR_MESSAGE_NS); updateEl.addContent(subjects); for (PID sub : pids) { subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.getRepositoryPath())); } Document msg = contentEl.getDocument(); sendMessage(msg); return getMessageId(msg); }</code><technical_language>Mind if this action UPDATE_DESCRIPTION match of rest of naming, this is effectively api for external consumption</technical_language>

Target:
public String sendUpdateDescriptionOperation(String userid, Collection<PID> pids) { Element contentEl = createAtomEntry(userid, pids.iterator().next(), CDRActions.UPDATE_DESCRIPTION); Element updateEl = new Element(CDRActions.UPDATE_DESCRIPTION.getName(), CDR_MESSAGE_NS); contentEl.addContent(updateEl); Element subjects = new Element("subjects", CDR_MESSAGE_NS); updateEl.addContent(subjects); for (PID sub : pids) { subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.getRepositoryPath())); } Document msg = contentEl.getDocument(); sendMessage(msg); return getMessageId(msg); }
Source:
<code><START> public Set<Integer> getAlts() { <END> Set<Integer> states = new HashSet<Integer>(); for (ATNConfig c : configs) { states.add(c.alt); } return states; }</code><technical_language>This return a BitSet</technical_language>

Target:
public BitSet getAlts() { BitSet alts = new BitSet(); for (ATNConfig config : configs) { alts.set(config.alt); } return alts; }
Source:
<code>public void initializeFrom(ILaunchConfiguration configuration) { final ILaunchConfiguration config = configuration; final ILaunchConfigurationTab[] tabs = getTabs(); <START> BusyIndicator.showWhile(Display.getCurrent(), () -> { <END> try { if (config instanceof ILaunchConfigurationWorkingCopy) { checkBackwardCompatibility((ILaunchConfigurationWorkingCopy) config); } } catch (CoreException e) { } for (ILaunchConfigurationTab tab : tabs) { tab.initializeFrom(config); } }); }</code><technical_language>Loading/saving files blocked UI thread dissapointing. This needs reimplemented</technical_language>

Target:
public void initializeFrom(ILaunchConfiguration configuration) { final ILaunchConfiguration config = configuration; BusyIndicator.showWhile(Display.getCurrent(), () -> { try { if (config instanceof ILaunchConfigurationWorkingCopy) { BundleLauncherHelper.migrateOsgiLaunchConfiguration(config); } } catch (CoreException e) { } super.initializeFrom(configuration); }); }
Source:
<code>private void initProtobufMetadataManager(GlobalConfiguration globalCfg, GlobalComponentRegistry gcr, BasicComponentRegistry bcr) { ProtobufMetadataManagerImpl protobufMetadataManager = new ProtobufMetadataManagerImpl(); bcr.registerComponent(ProtobufMetadataManager.class, protobufMetadataManager, true).running(); if (globalCfg.globalJmxStatistics().enabled()) { registerProtobufMetadataManagerMBean(protobufMetadataManager, gcr); } SerializationContext serCtx = protobufMetadataManager.getSerializationContext(); ClassLoader classLoader = globalCfg.classLoader(); <START> processProtostreamSerializationContextInitializers(classLoader, serCtx); <END> processSerializationContextInitializer(globalCfg.serialization().contextInitializer(), serCtx); EncoderRegistry encoderRegistry = gcr.getComponent(EncoderRegistry.class); encoderRegistry.registerWrapper(ProtobufWrapper.INSTANCE); encoderRegistry.registerTranscoder(new ProtostreamJsonTranscoder(serCtx)); encoderRegistry.registerTranscoder(new ProtostreamTextTranscoder(serCtx)); encoderRegistry.registerTranscoder(new ProtostreamObjectTranscoder(serCtx, classLoader)); }</code><technical_language>I a null check is needed here. A CI run a NPE <LINK_0> org.infinispan.query.remote.impl.LifecycleManager.processSerializationContextInitializer(LifecycleManager.java:142)</technical_language>

Target:
private void initProtobufMetadataManager(GlobalConfiguration globalCfg, GlobalComponentRegistry gcr, BasicComponentRegistry bcr) { ProtobufMetadataManagerImpl protobufMetadataManager = new ProtobufMetadataManagerImpl(); bcr.registerComponent(ProtobufMetadataManager.class, protobufMetadataManager, true).running(); if (globalCfg.globalJmxStatistics().enabled()) { registerProtobufMetadataManagerMBean(protobufMetadataManager, gcr); } SerializationContext serCtx = protobufMetadataManager.getSerializationContext(); ClassLoader classLoader = globalCfg.classLoader(); processSerializationContextInitializer(globalCfg.serialization().contextInitializer(), serCtx); processProtostreamSerializationContextInitializers(classLoader, serCtx); EncoderRegistry encoderRegistry = gcr.getComponent(EncoderRegistry.class); encoderRegistry.registerWrapper(ProtobufWrapper.INSTANCE); encoderRegistry.registerTranscoder(new ProtostreamJsonTranscoder(serCtx)); encoderRegistry.registerTranscoder(new ProtostreamTextTranscoder(serCtx)); encoderRegistry.registerTranscoder(new ProtostreamObjectTranscoder(serCtx, classLoader)); }
Source:
<code>public void sendVerificationmail(User user, String url) { <START> String message = "Please click on the following link to complete your registration: <a href=\"" + <END> url + "\">" + url; sendMail(user.getEmail(), user.getUsername(), "Confirm your registration", message); }</code><technical_language><a is closed </a>. Intended? for method below</technical_language>

Target:
public void sendVerificationmail(User user, String url) { String message = "Please click on the following link to complete your registration: <a href=\"" + url + "\">" + url + "</a>"; sendMail(user.getEmail(), user.getUsername(), "Confirm your registration", message); }
Source:
<code>public String getJMXUrl() { ServerDelegate sd = (ServerDelegate)server.loadAdapter(ServerDelegate.class, null); int port = -1; <START> if( !(sd instanceof IManagementPortProvider)) <END> port = IJBossToolingConstants.AS7_MANAGEMENT_PORT_DEFAULT_PORT; else { port = ((IManagementPortProvider)sd).getManagementPort(); } String url = "service:jmx:remoting-jmx://" + server.getHost() + ":" + port; return url; }</code><technical_language>java if (sd instanceof IManagementPortProvider) { port = ((IManagementPortProvider)sd).getManagementPort(); } else { port = IJBossToolingConstants.AS7_MANAGEMENT_PORT_DEFAULT_PORT; } do better, it</technical_language>

Target:
public String getJMXUrl() { return getJMXUrl(IJBossToolingConstants.AS7_MANAGEMENT_PORT_DEFAULT_PORT, "service:jmx:remoting-jmx"); }
Source:
<code>public int getMaxConversationDelay() { <START> return sessions.get(resolveCurrentSessionKey()).maxConversationDelay; <END> }</code><technical_language>This method sessions.get(botname).get(username) instead of needing resolve current session, get sessions for bot specific session for a user</technical_language>

Target:
public int getMaxConversationDelay() { return sessions.get(getCurrentBotName()).get(getCurrentUserName()).maxConversationDelay; }
Source:
<code>public void throwsIfBigIntegerHasMoreThan127Bits() { <START> BigInteger bigInt = BigInteger.valueOf(2).pow(128); <END> LockRefreshToken token = new LockRefreshToken(bigInt, 0L); assertThatThrownBy(() -> LockTokenConverter.toTokenV2(token)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("too many bits"); }</code><technical_language>nit: I power 127 (to test 128 case)</technical_language>

Target:
public void throwsIfBigIntegerHasMoreThan127Bits() { BigInteger bigInt = BigInteger.valueOf(2).pow(127); LockRefreshToken token = new LockRefreshToken(bigInt, 0L); assertThatThrownBy(() -> LockTokenConverter.toTokenV2(token)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("too many bits"); }
Source:
<code>public ItemStackSnapshot getExemplaryResult() { <START> return exemplaryResult; <END> }</code><technical_language>this</technical_language>

Target:
public ItemStackSnapshot getExemplaryResult() { return this.exemplaryResult; }
Source:
<code><START> public void before() throws Exception { <END> mConf.set(PropertyKey.USER_CLIENT_CACHE_PAGE_SIZE, PAGE_SIZE_BYTES); mConf.set(PropertyKey.USER_CLIENT_CACHE_SIZE, CACHE_SIZE_BYTES); mFileContext = Mockito.mock(FileSystemContext.class); when(mFileContext.getClusterConf()).thenReturn(mConf); when(mFileContext.getPathConf(any())).thenReturn(mConf); when(mFileContext.getUriValidationEnabled()).thenReturn(true); mMetaStore = new HashSetMetaStore(); mPageStore = new HashMapPageStore(); mEvictor = new FIFOEvictor(mMetaStore); mCacheManager = new LocalCacheManager(mFileContext, mMetaStore, mPageStore, mEvictor); }</code><technical_language>is this needed</technical_language>

Target:
public void before() { mConf.set(PropertyKey.USER_CLIENT_CACHE_PAGE_SIZE, PAGE_SIZE_BYTES); mConf.set(PropertyKey.USER_CLIENT_CACHE_SIZE, CACHE_SIZE_BYTES); mMetaStore = new HashSetMetaStore(); mPageStore = new HashMapPageStore(); mEvictor = new FIFOEvictor(mMetaStore); mCacheManager = new LocalCacheManager(mConf, mMetaStore, mPageStore, mEvictor); }
Source:
<code>public void endLatency(Object id, String service, Throwable er) { if(startTimestampPerId.containsKey(id)) { long elapsed = (System.nanoTime() - startTimestampPerId.get(id)) / 1000000; sendLatency(elapsed, service, er); <START> } <END> }</code><technical_language>else - send exception event riemann trigger alert in pajarduty</technical_language>

Target:
public void endLatency(Object id, String service, Throwable er) { if(startTimestampPerId.containsKey(id)) { long elapsed = NANOSECONDS.toMillis(System.nanoTime() - startTimestampPerId.get(id)); sendLatency(elapsed, service, er); startTimestampPerId.remove(id); } else { try { connection.getClient().event().description("Storm Latency Hash-Map doesn't contain received key.").service(service).tags("uncaught-exception"); } catch (Throwable t) { logger.warn("Riemann error during send : " + t.getStackTrace()); } } }
Source:
<code>public String getString() { <START> return "IF"; <END> }</code><technical_language>I other implementations returning actual String representation of operation, result String. double check that</technical_language>

Target:
public String getString() { return lazyParams.get(0).getString(); }
Source:
<code>public void setupUserStoreFromDefaultConfig() { <START> SmartStoreLogger.d(TAG, "Setting up user store using config sound in res/raw/userstore.json"); <END> setupStoreFromConfig(getSmartStore(), R.raw.userstore); }</code><technical_language>Minor typo: guessing meant _found in_</technical_language>

Target:
public void setupUserStoreFromDefaultConfig() { SmartStoreLogger.d(TAG, "Setting up user store using config found in res/raw/userstore.json"); setupStoreFromConfig(getSmartStore(), R.raw.userstore); }
Source:
<code>@Test public void updateViewWithRenamedClass() throws Exception { ListView tv = new ListView("tView"); j.jenkins.addView(tv); j.jenkins.XSTREAM2.addCompatibilityAlias("org.acme.old.Foo", ListView.class); final CLICommandInvoker.Result result = command .authorizedTo(View.READ, View.CONFIGURE, Jenkins.READ) .withStdin(this.getClass().getResourceAsStream("/hudson/cli/testview-foo.xml")) .invokeWithArgs("tView"); <START> assertThat(result, failedWith(0)); <END> }</code><technical_language>succeeded() succeededSilently()</technical_language>

Target:
@Test public void updateViewWithRenamedClass() throws Exception { ListView tv = new ListView("tView"); j.jenkins.addView(tv); j.jenkins.XSTREAM2.addCompatibilityAlias("org.acme.old.Foo", ListView.class); final CLICommandInvoker.Result result = command .authorizedTo(View.READ, View.CONFIGURE, Jenkins.READ) .withStdin(this.getClass().getResourceAsStream("/hudson/cli/testview-foo.xml")) .invokeWithArgs("tView"); assertThat(result, succeededSilently()); }
Source:
<code>public boolean remove(K key) { checkAvailable(); R record = null; boolean removed = false; try { record = removeRecord(key); if (record != null && record.getRecordState() == READ_PERMITTED) { removed = true; <START> nearCacheStats.incrementInvalidations(); <END> nearCacheStats.decrementOwnedEntryCount(); } onRemove(key, record, removed); return record != null; } catch (Throwable error) { onRemoveError(key, record, removed, error); throw rethrow(error); } finally { nearCacheStats.incrementReceivedInvalidations(); } }</code><technical_language>Should't call this incrementEntryRemovalCount? Other reasons call this remove method expirations</technical_language>

Target:
public boolean remove(K key) { checkAvailable(); R record = null; boolean removed = false; try { record = removeRecord(key); if (record != null && record.getRecordState() == READ_PERMITTED) { removed = true; nearCacheStats.decrementOwnedEntryCount(); } onRemove(key, record, removed); return record != null; } catch (Throwable error) { onRemoveError(key, record, removed, error); throw rethrow(error); } }
Source:
<code>public void testIt() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(ModifierOrderCheck.class); final String[] expected = { "14:10: " + getCheckMessage(MSG_MODIFIER_ORDER, "final"), "18:12: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), "24:14: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), "34:13: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation2"), "39:13: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation2"), "49:35: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation4"), "157:14: " + getCheckMessage(MSG_MODIFIER_ORDER, "default"), }; <START> verify(checkConfig, getPath("InputModifierIt.java"), expected); <END> }</code><technical_language>Test is named ModifierOrderCheckTest files start InputModifierOrder. Please change. inputs for this class follow pattern. I others aren't. Class names of inputs file name</technical_language>

Target:
public void testIt() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(ModifierOrderCheck.class); final String[] expected = { "14:10: " + getCheckMessage(MSG_MODIFIER_ORDER, "final"), "18:12: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), "24:14: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), "34:13: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation2"), "39:13: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation2"), "49:35: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MyAnnotation4"), "157:14: " + getCheckMessage(MSG_MODIFIER_ORDER, "default"), }; verify(checkConfig, getPath("InputModifierOrderIt.java"), expected); }
Source:
<code>public void initialize() { driver.initialize(this); formBuilder.addFormItem(new FormItem(constants.namePoolGeneral(), name, 0, 0)); formBuilder.addFormItem(new FormItem(constants.descriptionPoolGeneral(), description, 1, 0)); formBuilder.addFormItem(new FormItem(constants.templatePoolGeneral(), template, 2, 0)); formBuilder.addFormItem(new FormItem(constants.osPoolGeneral(), oS, 3, 0)); formBuilder.addFormItem(new FormItem(constants.graphicsProtocol(), graphicsType, 4, 0)); formBuilder.addFormItem(new FormItem(constants.videoType(), defaultDisplayType, 5, 0)); formBuilder.addFormItem(new FormItem(constants.definedMemPoolGeneral(), definedMemory, 0, 1)); formBuilder.addFormItem(new FormItem(constants.physMemGaurPoolGeneral(), minAllocatedMemory, 1, 1)); WidgetTooltip cpuInfoWithTooltip = new WidgetTooltip(cpuInfo); <START> cpuInfoWithTooltip.setText(constants.numOfCpuCoresTooltipPoolGeneral()); <END> formBuilder.addFormItem(new FormItem(constants.numOfCpuCoresPoolGeneral(), cpuInfoWithTooltip, 2, 1)); formBuilder.addFormItem(new FormItem(constants.numOfMonitorsPoolGeneral(), monitorCount, 3, 1)); formBuilder.addFormItem(new FormItem(constants.usbPolicyPoolGeneral(), usbPolicy, 4, 1)); formBuilder.addFormItem(new FormItem(constants.runOnPoolGeneral(), defaultHost, 0, 2)); }</code><technical_language>similar</technical_language>

Target:
public void initialize() { driver.initialize(this); formBuilder.addFormItem(new FormItem(constants.namePoolGeneral(), name, 0, 0)); formBuilder.addFormItem(new FormItem(constants.descriptionPoolGeneral(), description, 1, 0)); formBuilder.addFormItem(new FormItem(constants.templatePoolGeneral(), template, 2, 0)); formBuilder.addFormItem(new FormItem(constants.osPoolGeneral(), oS, 3, 0)); formBuilder.addFormItem(new FormItem(constants.graphicsProtocol(), graphicsType, 4, 0)); formBuilder.addFormItem(new FormItem(constants.videoType(), defaultDisplayType, 5, 0)); formBuilder.addFormItem(new FormItem(constants.definedMemPoolGeneral(), definedMemory, 0, 1)); formBuilder.addFormItem(new FormItem(constants.physMemGaurPoolGeneral(), minAllocatedMemory, 1, 1)); WidgetTooltip cpuInfoWithTooltip = new WidgetTooltip(cpuInfo); cpuInfoWithTooltip.setHtml(templates.numOfCpuCoresTooltip()); formBuilder.addFormItem(new FormItem(constants.numOfCpuCoresPoolGeneral(), cpuInfoWithTooltip, 2, 1)); formBuilder.addFormItem(new FormItem(constants.numOfMonitorsPoolGeneral(), monitorCount, 3, 1)); formBuilder.addFormItem(new FormItem(constants.usbPolicyPoolGeneral(), usbPolicy, 4, 1)); formBuilder.addFormItem(new FormItem(constants.runOnPoolGeneral(), defaultHost, 0, 2)); }
Source:
<code>public void setIntermediateData(Collection<IntermediateEntry> partitions) { <START> for (IntermediateEntry i: partitions) { <END> if (i.getPullHost().getPort() == 0) { int a= 1; } } this.intermediateData = new ArrayList<IntermediateEntry>(partitions); }</code><technical_language>unused codes. please remove this</technical_language>

Target:
public void setIntermediateData(Collection<IntermediateEntry> partitions) { this.intermediateData = new ArrayList<IntermediateEntry>(partitions); }
Source:
<code>public void run() { List<VDSGroup> vdsGroups = DbFacade.getInstance().getVdsGroupDao().getTrustedClusters(); List<String> vdsNames = new ArrayList<String>(); List<String> curVdsNames = new ArrayList<String>(); int i=0; boolean secondStageFlag =true; List<AttestationValue> valueList = new ArrayList<AttestationValue> (); if (vdsGroups == null || vdsGroups.size()==0) { return; } for (VDSGroup vdsGroup: vdsGroups){ vdss = DbFacade.getInstance().getVdsDao().getAllForVdsGroup(vdsGroup.getId()); if (vdss == null || vdss.size() == 0){ <START> break; <END> } for (VDS vds: vdss){ vdsNames.add(vds.getHostName()); } } while(vdsNames.size()>0 && i<2 && secondStageFlag){ if (vdsNames.size() <=attestationFirstStageSize){ curVdsNames = vdsNames; secondStageFlag=false; }else{ curVdsNames=(i==0)?vdsNames.subList(i, attestationFirstStageSize) :vdsNames.subList(attestationFirstStageSize, vdsNames.size()); } valueList = AttestationService.getInstance().attestHosts(curVdsNames); updateCache(valueList); i++; } }</code><technical_language>'continue' 'break'</technical_language>

Target:
public void run() { List<VDSGroup> vdsGroups = DbFacade.getInstance().getVdsGroupDao().getTrustedClusters(); List<String> vdsNames = new ArrayList<String>(); List<String> curVdsNames = new ArrayList<String>(); int i=0; boolean secondStageFlag =true; List<AttestationValue> valueList = new ArrayList<AttestationValue> (); if (vdsGroups == null || vdsGroups.size()==0) { return; } for (VDSGroup vdsGroup: vdsGroups){ vdss = DbFacade.getInstance().getVdsDao().getAllForVdsGroup(vdsGroup.getId()); if (vdss == null || vdss.size() == 0){ continue; } for (VDS vds: vdss){ vdsNames.add(vds.getHostName()); } } while(vdsNames.size()>0 && i<2 && secondStageFlag){ if (vdsNames.size() <=attestationFirstStageSize){ curVdsNames = vdsNames; secondStageFlag=false; }else{ curVdsNames=(i==0)?vdsNames.subList(i, attestationFirstStageSize) :vdsNames.subList(attestationFirstStageSize, vdsNames.size()); } valueList = AttestationService.getInstance().attestHosts(curVdsNames); updateCache(valueList); i++; } }
Source:
<code>public ScheduleTableView(Context context, AttributeSet attrs, @AttrRes int defStyleAttr, @StyleRes int defStyleRes) { <START> super(context, attrs, defStyleAttr); <END> TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ScheduleTableView, defStyleAttr, defStyleRes); int itemsPaddingHorizontal = a.getDimensionPixelSize(R.styleable.ScheduleTableView_itemsPaddingHorizontal, 0); int itemsPaddingVertical = a.getDimensionPixelSize(R.styleable.ScheduleTableView_itemsPaddingVertical, 0); int rowHeightPx = a.getDimensionPixelSize(R.styleable.ScheduleTableView_rowHeight, 0); int timeSlotUnitWidthPx = a.getDimensionPixelSize(R.styleable.ScheduleTableView_timeSlotUnitWidth, 0); int timeSlotDurationMinutes = a.getInt(R.styleable.ScheduleTableView_timeSlotUnitDurationMinutes, 0); a.recycle(); int timeSlotDurationMilliseconds = timeSlotDurationMinutes * 60 * 1000; adapter = new ScheduleTableAdapter(context); setHasFixedSize(true); addItemDecoration(new TableItemPaddingDecoration(itemsPaddingHorizontal, itemsPaddingVertical)); setLayoutManager( new TableLayoutManager( rowHeightPx, timeSlotUnitWidthPx, timeSlotDurationMilliseconds, itemsPaddingHorizontal, itemsPaddingVertical)); setAdapter(adapter); }</code><technical_language>Is this right super() call here</technical_language>

Target:
public ScheduleTableView(Context context, AttributeSet attrs, @AttrRes int defStyleAttr, @StyleRes int defStyleRes) { super(context, attrs, defStyleAttr); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ScheduleTableView, defStyleAttr, defStyleRes); int itemsPaddingHorizontal = a.getDimensionPixelSize(R.styleable.ScheduleTableView_itemsPaddingHorizontal, 0); int itemsPaddingVertical = a.getDimensionPixelSize(R.styleable.ScheduleTableView_itemsPaddingVertical, 0); int rowHeightPx = a.getDimensionPixelSize(R.styleable.ScheduleTableView_rowHeight, 0); int timeSlotUnitWidthPx = a.getDimensionPixelSize(R.styleable.ScheduleTableView_timeSlotUnitWidth, 0); int timeSlotDurationMinutes = a.getInt(R.styleable.ScheduleTableView_timeSlotUnitDurationMinutes, 0); a.recycle(); int timeSlotDurationMilliseconds = (int) TimeUnit.MINUTES.toMillis(timeSlotDurationMinutes); adapter = new ScheduleTableAdapter(context); setHasFixedSize(true); addItemDecoration(new TableItemPaddingDecoration(itemsPaddingHorizontal, itemsPaddingVertical)); setLayoutManager( new TableLayoutManager( rowHeightPx, timeSlotUnitWidthPx, timeSlotDurationMilliseconds, itemsPaddingHorizontal, itemsPaddingVertical)); setAdapter(adapter); }
Source:
<code>public int getNumThreads() { getReadLock().lock(); try { <START> if (m_config.getNumThreads() <= 0) { <END> return m_config.getNumThreads(); } else { return Runtime.getRuntime().availableProcessors() * 2; } } finally { getReadLock().unlock(); } }</code><technical_language>I this condition opposite</technical_language>

Target:
public int getNumThreads() { getReadLock().lock(); try { if (m_config.getNumThreads() <= 0) { return Runtime.getRuntime().availableProcessors() * 2; } else { return m_config.getNumThreads(); } } finally { getReadLock().unlock(); } }
Source:
<code>public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Entry<String, DockerContainerConfig> containerEntry : internalEnv.getContainers().entrySet()) { DockerContainerConfig value = containerEntry.getValue(); List<String> newVolumes = new ArrayList<>(); for (String volume : value.getVolumes()) { String[] volumeSourceTarget = volume.split(":"); <START> if (VolumeNames.matches(volumeSourceTarget[0], "projects", identity.getWorkspaceId())) { <END> newVolumes.add(getProjectsVolumeSpec(identity.getWorkspaceId(), volumeSourceTarget[1])); } else { newVolumes.add(volume); } } value.setVolumes(newVolumes); } }</code><technical_language>projects public constant of ProjectsVolumeForWsAgentProvisioner class</technical_language>

Target:
public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Entry<String, DockerContainerConfig> containerEntry : internalEnv.getContainers().entrySet()) { DockerContainerConfig value = containerEntry.getValue(); List<String> newVolumes = new ArrayList<>(); for (String volume : value.getVolumes()) { String[] volumeSourceTarget = volume.split(":"); if (VolumeNames.matches( volumeSourceTarget[0], ProjectsVolumeForWsAgentProvisioner.PROJECTS_VOLUME_NAME, identity.getWorkspaceId())) { newVolumes.add(getProjectsVolumeSpec(identity.getWorkspaceId(), volumeSourceTarget[1])); } else { newVolumes.add(volume); } } value.setVolumes(newVolumes); } }
Source:
<code>public final LogEventRequestType transformResponseToAuditMsg(T request, K response, AssertionType assertion, NhinTargetSystemType target, String direction, String _interface, boolean isRequesting, Properties webContextProperties, String serviceName) { setRequest(request); setAssertion(assertion); AuditMessageType auditMsg = createBaseAuditMessage(assertion, target, isRequesting, webContextProperties, serviceName); auditMsg = getParticipantObjectIdentificationForResponse(request, response, assertion, auditMsg); String userID = getUserId(auditMsg.getActiveParticipant()); AssertionHelper assertionHelper = new AssertionHelper(); if (StringUtils.isEmpty(userID)){ <START> userID = assertionHelper.extractUserName(assertion); <END> LOG.debug("Extract userName from assertion: {}", userID); } return buildLogEventRequestType(auditMsg, direction, getMessageCommunityId(assertion, target, isRequesting), serviceName, assertion, auditMsg.getEventIdentification().getEventID().getDisplayName(), auditMsg.getEventIdentification().getEventOutcomeIndicator(), auditMsg.getEventIdentification().getEventDateTime(), userID); }</code><technical_language>create assertionHelper inline (e.g., new AssertionHelper().extractUserName(assertion)) -- this cleans a bit, more importantly, short-circuits construction of object needed</technical_language>

Target:
public final LogEventRequestType transformResponseToAuditMsg(T request, K response, AssertionType assertion, NhinTargetSystemType target, String direction, String _interface, boolean isRequesting, Properties webContextProperties, String serviceName) { setRequest(request); setAssertion(assertion); AuditMessageType auditMsg = createBaseAuditMessage(assertion, target, isRequesting, webContextProperties, serviceName); auditMsg = getParticipantObjectIdentificationForResponse(request, response, assertion, auditMsg); String userID = getUserId(auditMsg.getActiveParticipant()); if (StringUtils.isEmpty(userID)){ userID = new AssertionHelper().extractUserName(assertion); LOG.debug("Extract userName from assertion: {}", userID); } return buildLogEventRequestType(auditMsg, direction, getMessageCommunityId(assertion, target, isRequesting), serviceName, assertion, auditMsg.getEventIdentification().getEventID().getDisplayName(), auditMsg.getEventIdentification().getEventOutcomeIndicator(), auditMsg.getEventIdentification().getEventDateTime(), userID); }
Source:
<code>private void submitNetworkConfiguration(List<String> modifiedInterfaceNames, NetworkConfiguration networkConfiguration) throws KuraException { <START> double timeout = 30; END> this.pendingNetworkConfigurationChange = true; if (modifiedInterfaceNames != null && !modifiedInterfaceNames.isEmpty()) { networkConfiguration.setModifiedInterfaceNames(modifiedInterfaceNames); logger.debug("Set modified interface names: {}", modifiedInterfaceNames.toString()); } this.networkConfigurationService.setNetworkConfiguration(networkConfiguration); this.configurationService.snapshot(); while (this.pendingNetworkConfigurationChange && timeout > 0) { timeout -= 0.5; try { Thread.sleep(500); } catch (InterruptedException e) { } } if (this.pendingNetworkConfigurationChange) { logger.warn("Did not receive a network configuration change event"); this.pendingNetworkConfigurationChange = false; } }</code><technical_language>float</technical_language>

Target:
private void submitNetworkConfiguration(List<String> modifiedInterfaceNames, NetworkConfiguration networkConfiguration) throws KuraException { short timeout = 30000; final short sleep = 500; this.pendingNetworkConfigurationChange = true; if (modifiedInterfaceNames != null && !modifiedInterfaceNames.isEmpty()) { networkConfiguration.setModifiedInterfaceNames(modifiedInterfaceNames); logger.debug("Set modified interface names: {}", modifiedInterfaceNames.toString()); } this.networkConfigurationService.setNetworkConfiguration(networkConfiguration); this.configurationService.snapshot(); while (this.pendingNetworkConfigurationChange && timeout > 0) { timeout -= sleep; try { Thread.sleep(sleep); } catch (InterruptedException e) { } } if (this.pendingNetworkConfigurationChange) { logger.warn("Did not receive a network configuration change event"); this.pendingNetworkConfigurationChange = false; } }
Source:
<code>protected PageableResult doSearch(RequestContext context) { IdentifierSourceService identifierSourceService = Context.getService(IdentifierSourceService.class); UserService service = Context.getUserService(); String source = context.getRequest().getParameter("source"); String fromDate = context.getRequest().getParameter("fromDate"); String toDate = context.getRequest().getParameter("toDate"); String identifier = context.getRequest().getParameter("identifier"); String comment = context.getRequest().getParameter("comment"); String generatedBy = context.getRequest().getParameter("generatedBy"); <START> List<LogEntry> logEntries = new ArrayList<LogEntry>(); <END> IdentifierSource logSource = source != null ? identifierSourceService.getIdentifierSourceByUuid(source) : null; Date dateFrom = fromDate != null ? (Date) ConversionUtil.convert(fromDate, Date.class) : null; Date dateTo = toDate != null ? (Date) ConversionUtil.convert(toDate, Date.class) : null; User user = generatedBy != null ? service.getUserByUuid(generatedBy) : null; if (logSource == null && identifier == null && comment == null && dateFrom == null && dateTo == null && user == null) { return new EmptySearchResult(); } logEntries = identifierSourceService.getLogEntries(logSource, dateFrom, dateTo, identifier, user, comment); return new NeedsPaging<LogEntry>(logEntries, context); }</code><technical_language>Yo do need declaration. do point assigning actual value</technical_language>

Target:
protected PageableResult doSearch(RequestContext context) { IdentifierSourceService identifierSourceService = Context.getService(IdentifierSourceService.class); UserService service = Context.getUserService(); String source = context.getRequest().getParameter("source"); String fromDate = context.getRequest().getParameter("fromDate"); String toDate = context.getRequest().getParameter("toDate"); String identifier = context.getRequest().getParameter("identifier"); String comment = context.getRequest().getParameter("comment"); String generatedBy = context.getRequest().getParameter("generatedBy"); IdentifierSource logSource = source != null ? identifierSourceService.getIdentifierSourceByUuid(source) : null; Date dateFrom = fromDate != null ? (Date) ConversionUtil.convert(fromDate, Date.class) : null; Date dateTo = toDate != null ? (Date) ConversionUtil.convert(toDate, Date.class) : null; User user = generatedBy != null ? service.getUserByUuid(generatedBy) : null; if (logSource == null && identifier == null && comment == null && dateFrom == null && dateTo == null && user == null) { return new EmptySearchResult(); } List<LogEntry> logEntries = identifierSourceService.getLogEntries(logSource, dateFrom, dateTo, identifier, user, comment); return new NeedsPaging<LogEntry>(logEntries, context); }
Source:
<code>private ValidationResult validate( ValidationResult validationResult ) { if ( StringUtils.isEmpty( this.nameTextField.getText() ) ) { final String nameCaption = Messages.getString( "ParameterDialog.Name" ); validationResult.addValidationMessage( new ValidationMessage( ValidationMessage.Severity.ERROR, Messages .getString( "ParameterDialog.ValueMustBeSetMessage", nameCaption ) ) ); } if ( this.dataFormatField.getText().contains( "Y" ) && !this.dataFormatField.getText().contains( "ww" ) ) { final String dataFormatCaption = Messages.getString( "ParameterDialog.DataFormat" ); validationResult.addValidationMessage( new ValidationMessage( ValidationMessage.Severity.ERROR, Messages <START> .getString( "ParameterDialog.InvalidDateFormatPatter", dataFormatCaption ) ) ); <END> } return validationResult; }</code><technical_language>is 'n' missing end of 'pattern'</technical_language>

Target:
private ValidationResult validate( ValidationResult validationResult ) { if ( StringUtils.isEmpty( this.nameTextField.getText() ) ) { final String nameCaption = Messages.getString( "ParameterDialog.Name" ); validationResult.addValidationMessage( new ValidationMessage( ValidationMessage.Severity.ERROR, Messages .getString( "ParameterDialog.ValueMustBeSetMessage", nameCaption ) ) ); } if ( this.dataFormatField.getText().contains( "Y" ) && !this.dataFormatField.getText().contains( "ww" ) ) { final String dataFormatCaption = Messages.getString( "ParameterDialog.DataFormat" ); validationResult.addValidationMessage( new ValidationMessage( ValidationMessage.Severity.ERROR, Messages .getString( "ParameterDialog.InvalidDateFormatPattern", dataFormatCaption ) ) ); } return validationResult; }
Source:
<code>public DiscoveryServiceEvent(DiscoveryServiceEventType type, String clusterId) { this.type = type; <START> this.remoteSiteInfo = new ClusterDescriptor(clusterId, LogReplicationClusterInfo.ClusterRole.STANDBY); <END> }</code><technical_language>rename remoteSiteInfo remoteClusterInfo? consistent</technical_language>

Target:
public DiscoveryServiceEvent(DiscoveryServiceEventType type, String clusterId) { this.type = type; remoteClusterInfo = new ClusterDescriptor(clusterId, LogReplicationClusterInfo.ClusterRole.STANDBY); }
Source:
<code><START> public void setSwitchAuthorityRole(String switchAuthorityRole) { <END> this.switchAuthorityRole = switchAuthorityRole; }</code><technical_language>a problem thanks for fast fix! FYI...We try assertion for setter a property a default value. some older setters follow this convention. if default of property is null, is need for assertion</technical_language>

Target:
public void setSwitchAuthorityRole(String switchAuthorityRole) { Assert.notNull(switchAuthorityRole, "switchAuthorityRole cannot be null"); this.switchAuthorityRole = switchAuthorityRole; }
Source:
<code><START> public void update(Library library) throws IOException { <END> Library updatedLibrary = get(library.getId()); authorizationManager.throwIfNotWritable(updatedLibrary); applyChanges(updatedLibrary, library); setChangeDetails(updatedLibrary); loadChildEntities(updatedLibrary); save(updatedLibrary); }</code><technical_language>alias validated</technical_language>

Target:
public void update(Library library) throws IOException { Library updatedLibrary = get(library.getId()); authorizationManager.throwIfNotWritable(updatedLibrary); applyChanges(updatedLibrary, library); validateAliasOrThrow(updatedLibrary); setChangeDetails(updatedLibrary); loadChildEntities(updatedLibrary); save(updatedLibrary); }
Source:
<code>private BaseWebInspector connect(WebkitPage webkitPage) { for (WebkitPage page : getPages()) { if (page.equals(webkitPage)) { WebInspector inspector = new WebInspector(null, webkitPage.getPageId(), protocol, bundleId, connectionKey, session); protocol.attachToPage(page.getPageId()); boolean ok = created.add(inspector); if (ok) { protocol.addListener(inspector); } <START> for (MessageListener l : protocol.getListeners()) { <END> if (l instanceof ConnectListener) { ((ConnectListener) l).onConnect(inspector); } } return inspector; } } throw new WebDriverException("Cannot connect to page " + webkitPage + ".Cannot find it."); }</code><technical_language>Delegate this protocol -- add onConnect(inspector) protocol do there. need getListeners</technical_language>

Target:
private BaseWebInspector connect(WebkitPage webkitPage) { for (WebkitPage page : getPages()) { if (page.equals(webkitPage)) { protocol.attachToPage(page.getPageId()); WebInspector inspector = new WebInspector( null, webkitPage.getPageId(), protocol, bundleId, connectionKey, session); protocol.addListener(inspector); return inspector; } } throw new WebDriverException("Cannot connect to page " + webkitPage + ".Cannot find it."); }