auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String loadWorkDefinitionFromArtifact(String name) throws OseeCoreException { Artifact artifact = null; try { artifact = ArtifactQuery.getArtifactFromTypeAndNameNoException(AtsArtifactTypes.WorkDefinition, name, BranchManager.getCommonBranch()); if (artifact != null) { return loadWorkDefinitionFromArtifact(artifact); } } catch (OseeCoreException ex) { throw ex; } catch (Exception ex) { throw new OseeWrappedException(String.format("Error loading AtsDsl [%s] from Artifact", name), ex); } return null; }

Target:
private String loadWorkDefinitionFromArtifact(String name) throws OseeCoreException { Artifact artifact = ArtifactQuery.getArtifactFromTypeAndNameNoException(AtsArtifactTypes.WorkDefinition, name, BranchManager.getCommonBranch()); return loadWorkDefinitionFromArtifact(artifact); }
Source:
public boolean equals(Object obj) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } IterableMappingMethod other = (IterableMappingMethod) obj; if ( !getResultType().equals( other.getResultType() ) ) { return false; } if ( getSourceParameters().size() != other.getSourceParameters().size() ) { return false; } for ( int i = 0; i < getSourceParameters().size(); i++ ) { if ( !getSourceParameters().get( i ).getType().equals( other.getSourceParameters().get( i ) ) ) { return false; } List<Type> thisTypeParameters = getSourceParameters().get( i ).getType().getTypeParameters(); List<Type> otherTypeParameters = other.getSourceParameters().get( i ).getType().getTypeParameters(); if ( !thisTypeParameters.equals( otherTypeParameters ) ) { return false; } } if ( this.selectionParameters != null ) { if ( !this.selectionParameters.equals( other.selectionParameters ) ) { return false; } } else if ( other.selectionParameters != null ) { return false; } return isMapNullToDefault() == other.isMapNullToDefault(); }

Target:
public boolean equals(Object obj) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } IterableMappingMethod other = (IterableMappingMethod) obj; if ( !getResultType().equals( other.getResultType() ) ) { return false; } if ( getSourceParameters().size() != other.getSourceParameters().size() ) { return false; } for ( int i = 0; i < getSourceParameters().size(); i++ ) { if ( !getSourceParameters().get( i ).getType().equals( other.getSourceParameters().get( i ).getType() ) ) { return false; } List<Type> thisTypeParameters = getSourceParameters().get( i ).getType().getTypeParameters(); List<Type> otherTypeParameters = other.getSourceParameters().get( i ).getType().getTypeParameters(); if ( !thisTypeParameters.equals( otherTypeParameters ) ) { return false; } } if ( this.selectionParameters != null ) { if ( !this.selectionParameters.equals( other.selectionParameters ) ) { return false; } } else if ( other.selectionParameters != null ) { return false; } return isMapNullToDefault() == other.isMapNullToDefault(); }
Source:
private synchronized void init() { if(functionNames == null) { List<ProcessFactory> factories = new ArrayList<ProcessFactory>(Processors .getProcessFactories()); Collections.sort(factories, FACTORY_COMPARATOR); processToFunction = new HashMap<Name,FunctionName>(); functionNames = new ArrayList<FunctionName>(); for (ProcessFactory factory : factories) { if( !factory.isAvailable() ) continue; for (Name processName : factory.getNames()) { try { Map<String, Parameter<?>> resultInfo = factory.getResultInfo(processName, null); Parameter<?> result = getPrimary(resultInfo); if (result != null) { Map<String, Parameter<?>> parameterInfo = factory.getParameterInfo(processName); List<String> argumentNames = new ArrayList<String>(parameterInfo.keySet()); List<org.opengis.parameter.Parameter<?>> args = new ArrayList<org.opengis.parameter.Parameter<?>>( argumentNames.size() ); for(String argumentName : argumentNames ){ args.add( parameterInfo.get(argumentName)); } FunctionName functionName = new FunctionNameImpl(processName, result, args); functionNames.add(functionName); processToFunction.put(processName, functionName); } } catch (Throwable unavailable){ Logger log = Logger.getLogger(factory.getClass().getName()); log.finer( "Process "+ processName + " unavailable:"+unavailable); continue; } } } functionNames.add(ParameterFunction.NAME); } }

Target:
private synchronized void init() { if(functionNames == null) { List<ProcessFactory> factories = new ArrayList<ProcessFactory>(Processors .getProcessFactories()); Collections.sort(factories, FACTORY_COMPARATOR); processToFunction = new HashMap<Name,FunctionName>(); functionNames = new ArrayList<FunctionName>(); for (ProcessFactory factory : factories) { if (!factory.isAvailable()) { continue; } for (Name processName : factory.getNames()) { try { Map<String, Parameter<?>> resultInfo = factory.getResultInfo(processName, null); Parameter<?> result = getPrimary(resultInfo); if (result != null) { Map<String, Parameter<?>> parameterInfo = factory.getParameterInfo(processName); List<String> argumentNames = new ArrayList<String>(parameterInfo.keySet()); List<org.opengis.parameter.Parameter<?>> args = new ArrayList<org.opengis.parameter.Parameter<?>>( argumentNames.size() ); for(String argumentName : argumentNames ){ args.add( parameterInfo.get(argumentName)); } FunctionName functionName = new FunctionNameImpl(processName, result, args); functionNames.add(functionName); processToFunction.put(processName, functionName); } } catch (Throwable unavailable) { Logger log = Logger.getLogger(factory.getClass().getName()); log.finer("Process " + processName + " unavailable:" + unavailable); continue; } } } functionNames.add(ParameterFunction.NAME); } }
Source:
public long hashByteBuffer(ByteBuffer input) { input.flip(); return LongHashFunction.xx(0).hashBytes(input); }

Target:
public long hashByteBuffer(ByteBuffer input) { return LongHashFunction.xx(0).hashBytes(input); }
Source:
public static Map<String, Set<String>> getRequirementValuesMap(Iterable<IAnalysisRequirementProvider> providers) { Map<String, Set<String>> valuesByType = new HashMap<>(); for (IAnalysisRequirementProvider provider : providers) { for (TmfAnalysisRequirement requirement : provider.getAnalysisRequirements()) { Set<String> values = valuesByType.get(requirement.getType()); if (values == null) { values = new HashSet<>(); } values.addAll(requirement.getValues()); valuesByType.put(requirement.getType(), values); } } return valuesByType; }

Target:
public static SetMultimap<String, String> getRequirementValuesMap(Iterable<IAnalysisRequirementProvider> providers) { SetMultimap<String, String> valuesByType = HashMultimap.create(); for (IAnalysisRequirementProvider provider : providers) { for (TmfAnalysisRequirement requirement : provider.getAnalysisRequirements()) { valuesByType.putAll(requirement.getType(), requirement.getValues()); } } return valuesByType; }
Source:
private void createSmallBamToOutputStream(final OutputStream outputStream,boolean binary) { final SAMFileWriterFactory factory = new SAMFileWriterFactory(); factory.setCreateIndex(false); factory.setCreateMd5File(false); final File wontBeUsed = new File("wontBeUsed.tmp"); final int maxRecsInRam = 271828; factory.setMaxRecordsInRam(maxRecsInRam); factory.setTempDirectory(wontBeUsed); final SAMFileHeader header = new SAMFileHeader(); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); header.addSequence(new SAMSequenceRecord("chr1", 123)); final SAMFileWriter writer = (binary? factory.makeBAMWriter(header, false, outputStream): factory.makeSAMWriter(header, false, outputStream) ); Assert.assertEquals(maxRecsInRam, ((SAMFileWriterImpl) writer).getMaxRecordsInRam()); Assert.assertEquals(wontBeUsed, ((SAMFileWriterImpl) writer).getTempDirectory()); fillSmallBam(writer); writer.close(); }

Target:
private void createSmallBamToOutputStream(final OutputStream outputStream,boolean binary) { final SAMFileWriterFactory factory = new SAMFileWriterFactory(); factory.setCreateIndex(false); factory.setCreateMd5File(false); final SAMFileHeader header = new SAMFileHeader(); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); header.addSequence(new SAMSequenceRecord("chr1", 123)); final SAMFileWriter writer = (binary? factory.makeBAMWriter(header, false, outputStream): factory.makeSAMWriter(header, false, outputStream) ); fillSmallBam(writer); writer.close(); }
Source:
@Test public void connectNodeShouldSucceedOnMaster() throws Exception { final Computer masterComputer = j.jenkins.get().getComputer(""); CLICommandInvoker.Result result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); }

Target:
@Test public void connectNodeShouldSucceedOnMaster() throws Exception { final Computer masterComputer = j.jenkins.getComputer(""); CLICommandInvoker.Result result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); }
Source:
public void testExpirationMaxIdleInExec() throws Exception { if (cache.getCacheConfiguration().clustering().cacheMode().isClustered()) { return; } for (int i = 0; i < SIZE; i++) { cache.put("key-" + i, "value-" + i,-1, null, 1, TimeUnit.MILLISECONDS); } timeService.advance(2); for (int i = 0; i < SIZE; i++) { cache.getAdvancedCache().getDataContainer().executeTask(KeyFilter.ACCEPT_ALL_FILTER, (k, ice) -> { throw new RuntimeException("No task should be executed on expired entry"); }); } }

Target:
public void testExpirationMaxIdleInExec() throws Exception { for (int i = 0; i < SIZE; i++) { cache.put("key-" + i, "value-" + i,-1, null, 1, TimeUnit.MILLISECONDS); } timeService.advance(2); if (cache.getCacheConfiguration().clustering().cacheMode().isClustered()) { AtomicInteger invocationCount = new AtomicInteger(); cache.getAdvancedCache().getDataContainer().executeTask(KeyFilter.ACCEPT_ALL_FILTER, (k, ice) -> invocationCount.incrementAndGet()); assertEquals(SIZE, invocationCount.get()); } else { cache.getAdvancedCache().getDataContainer().executeTask(KeyFilter.ACCEPT_ALL_FILTER, (k, ice) -> { throw new RuntimeException("No task should be executed on expired entry"); }); } }
Source:
public void addRequestable( IAEFluidStack option ) { if( this.isStackNull( option ) ) { return; } final IAEFluidStack st = this.getFluidRecord( option ); if( st != null ) { st.setCountRequestable( st.getCountRequestable() + option.getCountRequestable() ); return; } final IAEFluidStack opt = option.copy(); opt.setStackSize( 0 ); opt.setCraftable( false ); opt.setCountRequestable( opt.getCountRequestable() ); this.putFluidRecord( opt ); }

Target:
public void addRequestable( IAEFluidStack option ) { if( option == null ) { return; } final IAEFluidStack st = this.getFluidRecord( option ); if( st != null ) { st.setCountRequestable( st.getCountRequestable() + option.getCountRequestable() ); return; } final IAEFluidStack opt = option.copy(); opt.setStackSize( 0 ); opt.setCraftable( false ); opt.setCountRequestable( option.getCountRequestable() ); this.putFluidRecord( opt ); }
Source:
public static void addProfileDataToNic(Map<String, Object> struct, VM vm, VmDevice vmDevice, VmNic nic) { VnicProfile vnicProfile = null; Network network = null; String networkName = ""; List<VNIC_PROFILE_PROPERTIES> unsupportedFeatures = new ArrayList<>(); if (nic.getVnicProfileId() != null) { vnicProfile = DbFacade.getInstance().getVnicProfileDao().get(nic.getVnicProfileId()); if (vnicProfile != null) { network = DbFacade.getInstance().getNetworkDao().get(vnicProfile.getNetworkId()); networkName = network.getName(); log.debugFormat("VNIC {0} is using profile {1} on network {2}", nic.getName(), vnicProfile, networkName); if (!addQosForDevice(struct, vnicProfile, vm.getVdsGroupCompatibilityVersion())) { unsupportedFeatures.add(VNIC_PROFILE_PROPERTIES.NETWORK_QOS); } } } struct.put(VdsProperties.NETWORK, networkName); if (!addPortMirroringToVmInterface(struct, vnicProfile, vm.getVdsGroupCompatibilityVersion(), network == null ? Collections.<String> emptyList() : Collections.singletonList(networkName))) { unsupportedFeatures.add(VNIC_PROFILE_PROPERTIES.PORT_MIRRORING); } if (!addCustomPropertiesForDevice(struct, vm, vmDevice, vm.getVdsGroupCompatibilityVersion(), getVnicCustomProperties(vnicProfile))) { unsupportedFeatures.add(VNIC_PROFILE_PROPERTIES.CUSTOM_PROPERTIES); } if (!unsupportedFeatures.isEmpty()) { reportUnsupportedVnicProfileFeatures(vm, nic, vnicProfile, unsupportedFeatures); } }

Target:
public static void addProfileDataToNic(Map<String, Object> struct, VM vm, VmDevice vmDevice, VmNic nic) { VnicProfile vnicProfile = null; Network network = null; String networkName = ""; List<VNIC_PROFILE_PROPERTIES> unsupportedFeatures = new ArrayList<>(); if (nic.getVnicProfileId() != null) { vnicProfile = DbFacade.getInstance().getVnicProfileDao().get(nic.getVnicProfileId()); if (vnicProfile != null) { network = DbFacade.getInstance().getNetworkDao().get(vnicProfile.getNetworkId()); networkName = network.getName(); log.debugFormat("VNIC {0} is using profile {1} on network {2}", nic.getName(), vnicProfile, networkName); if (!addQosForDevice(struct, vnicProfile, vm.getVdsGroupCompatibilityVersion())) { unsupportedFeatures.add(VNIC_PROFILE_PROPERTIES.NETWORK_QOS); } } } struct.put(VdsProperties.NETWORK, networkName); if (!addPortMirroringToVmInterface(struct, vnicProfile, vm.getVdsGroupCompatibilityVersion(), network)) { unsupportedFeatures.add(VNIC_PROFILE_PROPERTIES.PORT_MIRRORING); } if (!addCustomPropertiesForDevice(struct, vm, vmDevice, vm.getVdsGroupCompatibilityVersion(), getVnicCustomProperties(vnicProfile))) { unsupportedFeatures.add(VNIC_PROFILE_PROPERTIES.CUSTOM_PROPERTIES); } if (!unsupportedFeatures.isEmpty()) { reportUnsupportedVnicProfileFeatures(vm, nic, vnicProfile, unsupportedFeatures); } }
Source:
public static void createMockFile(String filePathToRead, String filePathToCreate, int sizeInKB) { String fileContentToBeWritten = ""; BufferedReader br = null; try { br = new BufferedReader(new FileReader(filePathToRead)); StringBuilder sb = new StringBuilder(); String line = br.readLine(); while (line != null) { sb.append(line); sb.append('\n'); line = br.readLine(); } fileContentToBeWritten = sb.toString(); } catch (FileNotFoundException e) { log.error("File to read sample string to create text file to send is not found", e); } catch (IOException e) { log.error("Error in reading sample file to create text file to send", e); } finally { try { if (br != null) { br.close(); } } catch (IOException e) { log.error("Error while closing buffered reader", e); } } if (deleteRandomFile(filePathToCreate)) { log.info("File requested to create already exists. Deleting file... " + filePathToCreate); } try { File fileToCreate = new File(filePathToCreate); boolean createFileSuccess = fileToCreate.createNewFile(); if (createFileSuccess) { log.info("Successfully created a file to append content for sending at " + filePathToCreate); } BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filePathToCreate)); PrintWriter printWriter = new PrintWriter(bufferedWriter); for (int count = 0; count < sizeInKB; count++) { printWriter.append(fileContentToBeWritten); } printWriter.flush(); printWriter.close(); } catch (IOException e) { log.error("Error. File to print received messages is not provided", e); } }

Target:
public static void createMockFile(String filePathToRead, String filePathToCreate, int sizeInKB) { String fileContentToBeWritten = ""; BufferedReader br = null; try { br = new BufferedReader(new FileReader(filePathToRead)); StringBuilder sb = new StringBuilder(); String line = br.readLine(); while (line != null) { sb.append(line); sb.append('\n'); line = br.readLine(); } fileContentToBeWritten = sb.toString(); } catch (FileNotFoundException e) { log.error("File to read sample string to create text file to send is not found", e); } catch (IOException e) { log.error("Error in reading sample file to create text file to send", e); } finally { try { if (br != null) { br.close(); } } catch (IOException e) { log.error("Error while closing buffered reader", e); } } if (deleteRandomFile(filePathToCreate)) { log.info("File requested to create already exists. Deleted file: " + filePathToCreate); } try { File fileToCreate = new File(filePathToCreate); boolean createFileSuccess = fileToCreate.createNewFile(); if (createFileSuccess) { log.info("Successfully created a file to append content for sending at " + filePathToCreate); } BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filePathToCreate)); PrintWriter printWriter = new PrintWriter(bufferedWriter); for (int count = 0; count < sizeInKB; count++) { printWriter.append(fileContentToBeWritten); } printWriter.flush(); printWriter.close(); } catch (IOException e) { log.error("Error. File to print received messages is not provided", e); } }
Source:
private void handleWifiP2pAction(Intent intent) { if (mConfig.isWifiP2pLegacyTetheringMode()) return; final WifiP2pInfo p2pInfo = (WifiP2pInfo) intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_INFO); final WifiP2pGroup group = (WifiP2pGroup) intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_GROUP); if (VDBG) { Log.d(TAG, "WifiP2pAction: P2pInfo: " + p2pInfo + " Group: " + group); } synchronized (Tethering.this.mPublicSync) { if (p2pInfo != null && group != null && group.isGroupOwner() && !TextUtils.isEmpty(group.getInterface())) { if (!TextUtils.isEmpty(mWifiP2pTetherInterface)) { if (mWifiP2pTetherInterface.equals(group.getInterface())) { return; } else { Log.w(TAG, "P2P tethered interface " + mWifiP2pTetherInterface + "is different from current interface " + group.getInterface() + ", re-tether it"); disableWifiP2pIpServingLocked(mWifiP2pTetherInterface); } } mWifiP2pTetherInterface = group.getInterface(); enableWifiIpServingLocked(mWifiP2pTetherInterface, IFACE_IP_MODE_LOCAL_ONLY); } else if (group == null && !TextUtils.isEmpty(mWifiP2pTetherInterface)) { disableWifiP2pIpServingLocked(mWifiP2pTetherInterface); mWifiP2pTetherInterface = null; } } }

Target:
private void handleWifiP2pAction(Intent intent) { if (mConfig.isWifiP2pLegacyTetheringMode()) return; final WifiP2pInfo p2pInfo = (WifiP2pInfo) intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_INFO); final WifiP2pGroup group = (WifiP2pGroup) intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_GROUP); if (VDBG) { Log.d(TAG, "WifiP2pAction: P2pInfo: " + p2pInfo + " Group: " + group); } synchronized (Tethering.this.mPublicSync) { if (p2pInfo != null && group != null && group.isGroupOwner() && !TextUtils.isEmpty(group.getInterface())) { if (!TextUtils.isEmpty(mWifiP2pTetherInterface)) { if (mWifiP2pTetherInterface.equals(group.getInterface())) { return; } else { mLog.w("P2P tethered interface " + mWifiP2pTetherInterface + "is different from current interface " + group.getInterface() + ", re-tether it"); disableWifiP2pIpServingLocked(mWifiP2pTetherInterface); } } mWifiP2pTetherInterface = group.getInterface(); enableWifiIpServingLocked(mWifiP2pTetherInterface, IFACE_IP_MODE_LOCAL_ONLY); } else if (group == null && !TextUtils.isEmpty(mWifiP2pTetherInterface)) { disableWifiP2pIpServingLocked(mWifiP2pTetherInterface); mWifiP2pTetherInterface = null; } } }
Source:
private void handleCreateAccountResult(CompatCreateAccountResult result) { boolean authManagerEnabled = result.isAuthManagerResult(); if (result.getAuthManagerCreateAccountResult() instanceof AMCreateAccountSuccessResult || result.getLegacyCreateAccountResult() instanceof CreateAccountSuccessResult) { return; } assertThat(result, authManagerEnabled ? instanceOf(AMCreateAccountCaptchaResult.class) : instanceOf(CreateAccountCaptchaResult.class)); CaptchaResult captchaResult = authManagerEnabled ? ((AMCreateAccountCaptchaResult) result.getAuthManagerCreateAccountResult()).getCaptchaResult() : ((CreateAccountCaptchaResult) result.getLegacyCreateAccountResult()).getCaptchaResult(); assertThat(captchaResult, notNullValue()); assertThat(captchaResult.getCaptchaId(), not(isEmptyOrNullString())); String expectedCaptchaUrlPrefix = WikipediaApp.getInstance().getSite().scheme() + "://test.wikipedia.org/w/index.php?title=Special:Captcha/image"; assertThat(captchaResult.getCaptchaUrl(TEST_WIKI), startsWith(expectedCaptchaUrlPrefix)); }

Target:
private void handleCreateAccountResult(CompatCreateAccountResult result) { if (result instanceof AMCreateAccountSuccessResult || result instanceof CreateAccountSuccessResult) { return; } assertThat(result, instanceOf(CreateAccountCaptchaResult.class)); CaptchaResult captchaResult = ((CreateAccountCaptchaResult) result).getCaptchaResult(); assertThat(captchaResult, notNullValue()); assertThat(captchaResult.getCaptchaId(), not(isEmptyOrNullString())); String expectedCaptchaUrlPrefix = WikipediaApp.getInstance().getSite().scheme() + "://test.wikipedia.org/w/index.php?title=Special:Captcha/image"; assertThat(captchaResult.getCaptchaUrl(TEST_WIKI), startsWith(expectedCaptchaUrlPrefix)); }
Source:
void receiveHeader(PacketLineIn pckIn, boolean stateless) throws IOException { try { version = parseHeader(pckIn, VERSION); if (!version.equals(VERSION_0_1)) { throw new IOException(MessageFormat.format( JGitText.get().pushCertificateInvalidFieldValue, VERSION, version)); } String pusherStr = parseHeader(pckIn, PUSHER); pusher = RawParseUtils.parsePersonIdent(pusherStr); if (pusher == null) { throw new IOException(MessageFormat.format( JGitText.get().pushCertificateInvalidFieldValue, PUSHER, pusherStr)); } pushee = parseHeader(pckIn, PUSHEE); receivedNonce = parseHeader(pckIn, NONCE); if (!pckIn.readString().isEmpty()) { throw new IOException( JGitText.get().pushCertificateInvalidHeader); } } catch (EOFException eof) { throw new IOException( JGitText.get().pushCertificateInvalidHeader, eof); } nonceStatus = nonceGenerator.verify(receivedNonce, sentNonce(), db, stateless, nonceSlopLimit); }

Target:
public void receiveHeader(PacketLineIn pckIn, boolean stateless) throws IOException { try { version = parseHeader(pckIn, VERSION); if (!version.equals(VERSION_0_1)) { throw new IOException(MessageFormat.format( JGitText.get().pushCertificateInvalidFieldValue, VERSION, version)); } String pusherStr = parseHeader(pckIn, PUSHER); pusher = RawParseUtils.parsePersonIdent(pusherStr); if (pusher == null) { throw new IOException(MessageFormat.format( JGitText.get().pushCertificateInvalidFieldValue, PUSHER, pusherStr)); } pushee = parseHeader(pckIn, PUSHEE); receivedNonce = parseHeader(pckIn, NONCE); if (!pckIn.readString().isEmpty()) { throw new IOException( JGitText.get().pushCertificateInvalidHeader); } } catch (EOFException eof) { throw new IOException( JGitText.get().pushCertificateInvalidHeader, eof); } nonceStatus = nonceGenerator != null ? nonceGenerator.verify( receivedNonce, sentNonce(), db, stateless, nonceSlopLimit) : NonceStatus.UNSOLICITED; }
Source:
public void start() { if (!lifecycleLock.canStart()) { throw new ISE("can't start."); } try { notifierThread = Execs.makeThread( "CoordinatorBasicAuthenticatorCacheNotifier-notifierThread", () -> { while (!Thread.interrupted()) { try { LOG.debug("Waiting for cache update notification"); Set<String> authenticatorsToUpdateSnapshot; HashMap<String, byte[]> serializedUserMapsSnapshot; synchronized (authenticatorsToUpdate) { if (authenticatorsToUpdate.isEmpty()) { authenticatorsToUpdate.wait(); } authenticatorsToUpdateSnapshot = new HashSet<>(authenticatorsToUpdate); serializedUserMapsSnapshot = new HashMap<String, byte[]>(serializedMaps); authenticatorsToUpdate.clear(); serializedMaps.clear(); } LOG.debug("Sending cache update notifications"); for (String authenticator : authenticatorsToUpdateSnapshot) { BasicAuthDBConfig authenticatorConfig = authenticatorConfigMap.get(authenticator); if (!authenticatorConfig.isEnableCacheNotifications()) { continue; } List<ListenableFuture<StatusResponseHolder>> futures = sendUpdate( authenticator, serializedUserMapsSnapshot.get(authenticator) ); for (ListenableFuture<StatusResponseHolder> future : futures) { try { StatusResponseHolder srh = future.get( authenticatorConfig.getCacheNotificationTimeout(), TimeUnit.MILLISECONDS ); LOG.debug("Got status: " + srh.getStatus()); } catch (Exception e) { LOG.makeAlert("Failed to get response for cache notification.").emit(); } } } LOG.debug("Received responses for cache update notifications."); } catch (Throwable t) { LOG.makeAlert(t, "Error occured while handling updates for cachedUserMaps.").emit(); } } }, true ); notifierThread.start(); lifecycleLock.started(); } finally { lifecycleLock.exitStart(); } }

Target:
public void start() { if (!lifecycleLock.canStart()) { throw new ISE("can't start."); } try { cacheNotifier.start(); lifecycleLock.started(); } finally { lifecycleLock.exitStart(); } }
Source:
public void close() { final FSDataInputStream inLocal = in; if (inLocal != null) { synchronized (inLocal) { in = null; } } }

Target:
public void close() { if (!closed) { synchronized (in) { closed = true; } } }
Source:
public static List<JiraSite> getSitesFromFolders(ItemGroup itemGroup) { List<JiraSite> result = new ArrayList<>(); while (itemGroup != null) { if (itemGroup instanceof AbstractFolder<?>) { AbstractFolder<?> folder = (AbstractFolder<?>) itemGroup; JiraFolderProperty jiraFolderProperty = folder.getProperties() .get(JiraFolderProperty.class); if (jiraFolderProperty != null && jiraFolderProperty.getSites().length != 0) { result.addAll(Arrays.asList(jiraFolderProperty.getSites())); } itemGroup = folder.getParent(); } if (!(itemGroup instanceof AbstractFolder<?>)) { itemGroup = null; } } return result; }

Target:
public static List<JiraSite> getSitesFromFolders(ItemGroup itemGroup) { List<JiraSite> result = new ArrayList<>(); while (itemGroup instanceof AbstractFolder<?>) { AbstractFolder<?> folder = (AbstractFolder<?>) itemGroup; JiraFolderProperty jiraFolderProperty = folder.getProperties() .get(JiraFolderProperty.class); if (jiraFolderProperty != null && jiraFolderProperty.getSites().length != 0) { result.addAll(Arrays.asList(jiraFolderProperty.getSites())); } itemGroup = folder.getParent(); } return result; }
Source:
INode toFile(UGIResolver ugi, BlockResolver blk, BlockAliasMap.Writer<FileRegion> out) throws IOException { final FileStatus s = getFileStatus(); final AclStatus aclStatus = getAclStatus(); long permissions = ugi.getPermissionsProto(s, aclStatus); INodeFile.Builder b = INodeFile.newBuilder() .setReplication(blk.getReplication(s)) .setModificationTime(s.getModificationTime()) .setAccessTime(s.getAccessTime()) .setPreferredBlockSize(blk.preferredBlockSize(s)) .setPermission(permissions) .setStoragePolicyID(HdfsConstants.PROVIDED_STORAGE_POLICY_ID); PathHandle pathHandle = null; if (fs != null) { try { pathHandle = fs.getPathHandle(s, Options.HandleOpt.exact()); } catch (UnsupportedOperationException e) { LOG.warn( "Exact path handle not supported by filesystem " + fs.toString()); } } if (aclStatus != null) { throw new UnsupportedOperationException( "Acls not supported by ImageWriter"); } long off = 0L; for (BlockProto block : blk.resolve(s)) { b.addBlocks(block); writeBlock(block.getBlockId(), off, block.getNumBytes(), block.getGenStamp(), pathHandle, out); off += block.getNumBytes(); } INode.Builder ib = INode.newBuilder() .setType(INode.Type.FILE) .setId(id) .setName(ByteString.copyFrom(string2Bytes(s.getPath().getName()))) .setFile(b); return ib.build(); }

Target:
INode toFile(UGIResolver ugi, BlockResolver blk, BlockAliasMap.Writer<FileRegion> out) throws IOException { final FileStatus s = getFileStatus(); final AclStatus aclStatus = getAclStatus(); long permissions = ugi.getPermissionsProto(s, aclStatus); INodeFile.Builder b = INodeFile.newBuilder() .setReplication(blk.getReplication(s)) .setModificationTime(s.getModificationTime()) .setAccessTime(s.getAccessTime()) .setPreferredBlockSize(blk.preferredBlockSize(s)) .setPermission(permissions) .setStoragePolicyID(HdfsConstants.PROVIDED_STORAGE_POLICY_ID); PathHandle pathHandle = null; if (fs != null) { try { pathHandle = fs.getPathHandle(s, Options.HandleOpt.exact()); } catch (UnsupportedOperationException e) { LOG.warn( "Exact path handle not supported by filesystem " + fs.toString()); } } if (aclStatus != null) { throw new UnsupportedOperationException( "ACLs not supported by ImageWriter"); } long off = 0L; for (BlockProto block : blk.resolve(s)) { b.addBlocks(block); writeBlock(block.getBlockId(), off, block.getNumBytes(), block.getGenStamp(), pathHandle, out); off += block.getNumBytes(); } INode.Builder ib = INode.newBuilder() .setType(INode.Type.FILE) .setId(id) .setName(ByteString.copyFrom(string2Bytes(s.getPath().getName()))) .setFile(b); return ib.build(); }
Source:
private String normalize(String input) { return pattern.matcher(input).replaceAll("-"); }

Target:
private String normalize(String input) { String normalized = pattern.matcher(input).replaceAll("-"); while (normalized.startsWith("-")) { normalized = normalized.substring(1); } while (normalized.endsWith("-")) { normalized = normalized.substring(0, normalized.length() - 1); } return normalized; }
Source:
public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); final byte[][] intervalsBytes = new byte[intervals.size()][]; int intervalsBytesSize = 0; int index = 0; for (Interval interval : intervals) { intervalsBytes[index] = StringUtils.toUtf8(interval.toString()); intervalsBytesSize += intervalsBytes[index].length + 1; ++index; } byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); ByteBuffer filterCacheKey = ByteBuffer.allocate(3 + dimensionBytes.length + intervalsBytesSize + extractionFnBytes.length) .put(DimFilterUtils.INTERVAL_CACHE_ID) .put(dimensionBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(extractionFnBytes) .put(DimFilterUtils.STRING_SEPARATOR); for (byte[] bytes : intervalsBytes) { filterCacheKey.put(bytes) .put((byte) 0xFF); } return filterCacheKey.array(); }

Target:
public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); int intervalsBytesSize = intervalLongs.size() * Longs.BYTES * 2 + intervalLongs.size(); ByteBuffer filterCacheKey = ByteBuffer.allocate(3 + dimensionBytes.length + intervalsBytesSize + extractionFnBytes.length) .put(DimFilterUtils.INTERVAL_CACHE_ID) .put(dimensionBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(extractionFnBytes) .put(DimFilterUtils.STRING_SEPARATOR); for (Pair<Long, Long> interval : intervalLongs) { filterCacheKey.put(Longs.toByteArray(interval.lhs)) .put(Longs.toByteArray(interval.rhs)) .put((byte) 0xFF); } return filterCacheKey.array(); }
Source:
public String getShortName() { return "projectactivity"; }

Target:
public String getShortName() { return "activity"; }
Source:
public ConcurrentDocumentClient(ISarosSession sarosSession) { this.sarosSession = sarosSession; this.jupiterClient = new JupiterClient(sarosSession); this.deletedResources = new CopyOnWriteArraySet<>(); }

Target:
public ConcurrentDocumentClient(ISarosSession sarosSession) { this.sarosSession = sarosSession; this.jupiterClient = new JupiterClient(sarosSession); this.resourceActivityFilter = new ResourceActivityFilter(sarosSession, this::reset); }
Source:
public void emit(T tuple) { if (operatorThread != null && Thread.currentThread() != operatorThread) { throw new IllegalStateException("emit() not called from operator thread!, currentThread=" + Thread.currentThread() + ", operatorThread=" + operatorThread); } sink.put(tuple); }

Target:
public void emit(T tuple) { if (operatorThread != null && Thread.currentThread() != operatorThread) { throw new IllegalStateException("Current thread " + Thread.currentThread().getName() + " is different from the operator thread " + operatorThread.getName()); } sink.put(tuple); }
Source:
public Object compute(Map<String, Object> values) { Iterator<PostAggregator> fieldsIter = fields.iterator(); Double retVal = NullHandling.useDefaultValuesForNull() ? DimensionHandlerUtils.ZERO_DOUBLE : null; if (fieldsIter.hasNext()) { Number nextVal = (Number) fieldsIter.next().compute(values); if (nextVal == null) { return null; } retVal = nextVal.doubleValue(); while (fieldsIter.hasNext()) { nextVal = (Number) fieldsIter.next().compute(values); if (nextVal == null) { return null; } retVal = op.compute(retVal, (nextVal).doubleValue()); } } return retVal; }

Target:
public Object compute(Map<String, Object> values) { Iterator<PostAggregator> fieldsIter = fields.iterator(); Double retVal = NullHandling.defaultDoubleValue(); if (fieldsIter.hasNext()) { Number nextVal = (Number) fieldsIter.next().compute(values); if (nextVal == null) { return null; } retVal = nextVal.doubleValue(); while (fieldsIter.hasNext()) { nextVal = (Number) fieldsIter.next().compute(values); if (nextVal == null) { return null; } retVal = op.compute(retVal, (nextVal).doubleValue()); } } return retVal; }
Source:
public ParametersList(MethodTree methodTree) { parameterNames = new ArrayList<>(); parameterTypes = new ArrayList<>(); List<Symbol> symbolListOfParameters = methodTree.parameters().stream().map(VariableTree::symbol).collect(Collectors.toList()); parameterNames.addAll(symbolListOfParameters.stream().map(parameter -> parameter.name().toLowerCase(Locale.ENGLISH)).collect(Collectors.toList())); parameterTypes.addAll(symbolListOfParameters.stream().map(Symbol::type).collect(Collectors.toList())); }

Target:
public ParametersList(MethodTree methodTree) { parameterNames = new ArrayList<>(); parameterTypes = new ArrayList<>(); methodTree.parameters().stream().map(VariableTree::symbol).forEach(symbol -> { parameterNames.add(symbol.name().toLowerCase(Locale.ENGLISH)); parameterTypes.add(symbol.type()); }); }
Source:
public SubTabDiskGeneralView(DetailModelProvider<DiskListModel, DiskGeneralModel> modelProvider) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); Driver.driver.initialize(this); formBuilder = new FormBuilder(formPanel, 1, 6); formBuilder.setColumnsWidth("300px"); formBuilder.addFormItem(new FormItem(constants.aliasDisk(), alias, 0, 0)); formBuilder.addFormItem(new FormItem(constants.descriptionDisk(), description, 1, 0)); formBuilder.addFormItem(new FormItem(constants.idDisk(), diskId, 2, 0)); formBuilder.addFormItem(new FormItem(constants.lunIdSanStorage(), lunId, 3, 0) { @Override public boolean isVisible() { return getDetailModel().isLun(); } }); formBuilder.addFormItem(new FormItem(constants.diskAlignment(), alignment, 2, 0)); formBuilder.addFormItem(new FormItem(constants.quota(), quotaName, 4, 0) { @Override public boolean isVisible() { return getDetailModel().isQuotaAvailable(); } }); }

Target:
public SubTabDiskGeneralView(DetailModelProvider<DiskListModel, DiskGeneralModel> modelProvider) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); driver.initialize(this); formBuilder = new FormBuilder(formPanel, 1, 6); formBuilder.addFormItem(new FormItem(constants.aliasDisk(), alias, 0, 0)); formBuilder.addFormItem(new FormItem(constants.descriptionDisk(), description, 1, 0)); formBuilder.addFormItem(new FormItem(constants.idDisk(), diskId, 2, 0)); formBuilder.addFormItem(new FormItem(constants.diskAlignment(), alignment, 3, 0)); formBuilder.addFormItem(new FormItem(constants.lunIdSanStorage(), lunId, 4, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isLun(); } }); formBuilder.addFormItem(new FormItem(constants.quota(), quotaName, 5, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isQuotaAvailable(); } }); }
Source:
public static List<Point> getPointsFromTarget(ConnectionEditPart edgeEditPart) throws IllegalArgumentException { if (edgeEditPart.getModel() instanceof Edge && edgeEditPart.getFigure() instanceof Connection) { List<Point> result = Lists.newArrayList(); Edge gmfEdge = (Edge) edgeEditPart.getModel(); Connection connectionFigure = (Connection) edgeEditPart.getFigure(); Point tgtAnchorLoc = connectionFigure.getTargetAnchor().getReferencePoint(); connectionFigure.translateToRelative(tgtAnchorLoc); RelativeBendpoints bp = (RelativeBendpoints) gmfEdge.getBendpoints(); for (int i = 0; i < bp.getPoints().size(); i++) { RelativeBendpoint rbp = (RelativeBendpoint) bp.getPoints().get(i); Point fromSrc = tgtAnchorLoc.getTranslated(rbp.getTargetX(), rbp.getTargetY()); result.add(fromSrc); } return result; } throw new IllegalArgumentException( "The model of the edgeEditPart should be a org.eclipse.gmf.runtime.notation.Edge and the figure of this edgeEditPart should be a org.eclipse.draw2d.Connection."); }

Target:
public static List<Point> getPointsFromTarget(ConnectionEditPart edgeEditPart) throws IllegalArgumentException { if (edgeEditPart.getModel() instanceof Edge && edgeEditPart.getFigure() instanceof Connection) { List<Point> result = Lists.newArrayList(); Edge gmfEdge = (Edge) edgeEditPart.getModel(); Connection connectionFigure = (Connection) edgeEditPart.getFigure(); Point tgtAnchorLoc = connectionFigure.getTargetAnchor().getReferencePoint(); connectionFigure.translateToRelative(tgtAnchorLoc); RelativeBendpoints bp = (RelativeBendpoints) gmfEdge.getBendpoints(); for (int i = 0; i < bp.getPoints().size(); i++) { RelativeBendpoint rbp = (RelativeBendpoint) bp.getPoints().get(i); Point fromTgt = tgtAnchorLoc.getTranslated(rbp.getTargetX(), rbp.getTargetY()); result.add(fromTgt); } return result; } throw new IllegalArgumentException( "The model of the edgeEditPart should be a org.eclipse.gmf.runtime.notation.Edge and the figure of this edgeEditPart should be a org.eclipse.draw2d.Connection."); }
Source:
public MailMessage setTo(String to) { this.to = Arrays.asList(to); return this; }

Target:
public MailMessage setTo(String to) { this.to = asList(to); return this; }
Source:
private Schema getSchema() { try { return Schema.parseJson(schema); } catch (IOException e) { throw new IllegalArgumentException( String.format("Unable to parse schema '%s'. Reason: %s", schema, e.getMessage())); } }

Target:
private Schema getSchema() { try { return Schema.parseJson(schema); } catch (IOException e) { throw new IllegalArgumentException(String.format("Unable to parse schema '%s'. Reason: %s", schema, e.getMessage()), e); } }
Source:
public void fetchEapAuthentications() throws Exception { final List<AuthEntry> encodings = Lists.newArrayList(new AuthEntry(CREDENTIAL_TYPE, Type.EAP_SIM)); final List<AuthenticationEntryDTO> list = Lists.newArrayList(new AuthenticationEntryDTO("CREDENTIAL_TYPE", Lists.newArrayList("EAP_SIM"))); context.checking(new Expectations() {{ oneOf(authenticationCatalog).findAll(); will(returnValue(encodings)); }}); Reply<?> reply = endpoint.fetchEapAuthentications(); assertThat(reply, contains(list)); assertThat(reply, isOk()); }

Target:
public void fetchEapAuthentications() throws Exception { final List<AuthEntry> auths = Lists.newArrayList(new AuthEntry(CREDENTIAL_TYPE, Type.EAP_SIM)); final List<AuthEntryDTO> list = Lists.newArrayList(new AuthEntryDTO("CREDENTIAL_TYPE", Lists.newArrayList("EAP_SIM"))); context.checking(new Expectations() {{ oneOf(authenticationCatalog).findAll(); will(returnValue(auths)); }}); Reply<?> reply = endpoint.fetchEapAuthentications(); assertThat(reply, contains(list)); assertThat(reply, isOk()); }
Source:
public void sendMessage(OutboundHandler.SendContext sendContext) { try { channel.eventLoop().execute(() -> { final BytesReference bytesReference; try { bytesReference = sendContext.get(); } catch (IOException e) { sendContext.onFailure(e); return; } channel.writeAndFlush(Netty4Utils.toByteBuf(bytesReference), addPromise(sendContext, channel)); }); } catch (RejectedExecutionException e) { sendContext.onFailure(new TransportException("Cannot send message, event loop is shutting down.")); } }

Target:
public void sendMessage(OutboundHandler.SendContext sendContext) { channel.writeAndFlush(sendContext, addPromise(sendContext, channel)); if (channel.eventLoop().isShutdown()) { sendContext.onFailure(new TransportException("Cannot send message, event loop is shutting down.")); } }
Source:
public <Q, I, U> SubscriptionQueryResult<QueryResponseMessage<I>, SubscriptionQueryUpdateMessage<U>> subscriptionQuery( SubscriptionQueryMessage<Q, I, U> query, int updateBufferSize) { if (queryUpdateEmitter.queryUpdateHandlerRegistered(query)) { throw new IllegalArgumentException("There is already a subscription with the given message identifier"); } MonoWrapper<QueryResponseMessage<I>> initialResult = MonoWrapper.create(monoSink -> query(query) .thenAccept(monoSink::success) .exceptionally(t -> { logger.error(format("An error happened while trying to report an initial result. Query: %s", query), t); monoSink.error(t.getCause()); return null; })); UpdateHandlerRegistration<U> updateHandlerRegistration = queryUpdateEmitter .registerUpdateHandler(query, updateBufferSize); return new DefaultSubscriptionQueryResult<>(initialResult.getMono(), updateHandlerRegistration.getUpdates(), updateHandlerRegistration.getRegistration()); }

Target:
public <Q, I, U> SubscriptionQueryResult<QueryResponseMessage<I>, SubscriptionQueryUpdateMessage<U>> subscriptionQuery( SubscriptionQueryMessage<Q, I, U> query, int updateBufferSize) { if (queryUpdateEmitter.queryUpdateHandlerRegistered(query)) { throw new IllegalArgumentException("There is already a subscription with the given message identifier"); } MonoWrapper<QueryResponseMessage<I>> initialResult = getInitialResultMono(query); UpdateHandlerRegistration<U> updateHandlerRegistration = queryUpdateEmitter .registerUpdateHandler(query, updateBufferSize); return getSubscriptionQueryResult(initialResult, updateHandlerRegistration); }
Source:
protected void run() throws Exception { try (Git git = new Git(db)) { if (command == null) { RemoteListCommand cmd = git.remoteList(); List<RemoteConfig> remotes = cmd.call(); print(remotes); } else if ("add".equals(command)) { RemoteAddCommand cmd = git.remoteAdd(); cmd.setName(name); cmd.setUri(new URIish(uri)); cmd.call(); } else if ("remove".equals(command) || "rm".equals(command)) { RemoteRemoveCommand cmd = git.remoteRemove(); cmd.setName(name); cmd.call(); } else if ("set-url".equals(command)) { RemoteSetUrlCommand cmd = git.remoteSetUrl(); cmd.setName(name); cmd.setUri(new URIish(uri)); cmd.setPush(push); cmd.call(); } else if ("update".equals(command)) { Fetch fetch = new Fetch(); fetch.init(db, gitdir); StringWriter osw = new StringWriter(); fetch.outw = new ThrowingPrintWriter(osw); StringWriter esw = new StringWriter(); fetch.errw = new ThrowingPrintWriter(esw); List<String> fetchArgs = new ArrayList<>(); if (verbose) fetchArgs.add("--verbose"); if (prune) fetchArgs.add("--prune"); if (name != null) fetchArgs.add(name); fetch.execute(fetchArgs.toArray(new String[fetchArgs.size()])); fetch.outw.flush(); fetch.errw.flush(); outw.println(osw.toString()); errw.println(esw.toString()); } else { throw new JGitInternalException(MessageFormat .format(CLIText.get().unknownSubcommand, command)); } } }

Target:
protected void run() throws Exception { try (Git git = new Git(db)) { if (command == null) { RemoteListCommand cmd = git.remoteList(); List<RemoteConfig> remotes = cmd.call(); print(remotes); } else if ("add".equals(command)) { RemoteAddCommand cmd = git.remoteAdd(); cmd.setName(name); cmd.setUri(new URIish(uri)); cmd.call(); } else if ("remove".equals(command) || "rm".equals(command)) { RemoteRemoveCommand cmd = git.remoteRemove(); cmd.setName(name); cmd.call(); } else if ("set-url".equals(command)) { RemoteSetUrlCommand cmd = git.remoteSetUrl(); cmd.setName(name); cmd.setUri(new URIish(uri)); cmd.setPush(push); cmd.call(); } else if ("update".equals(command)) { Fetch fetch = new Fetch(); fetch.init(db, gitdir); StringWriter osw = new StringWriter(); fetch.outw = new ThrowingPrintWriter(osw); StringWriter esw = new StringWriter(); fetch.errw = new ThrowingPrintWriter(esw); List<String> fetchArgs = new ArrayList<>(); if (verbose) { fetchArgs.add("--verbose"); } if (prune) { fetchArgs.add("--prune"); } if (name != null) { fetchArgs.add(name); } fetch.execute(fetchArgs.toArray(new String[fetchArgs.size()])); fetch.outw.flush(); fetch.errw.flush(); outw.println(osw.toString()); errw.println(esw.toString()); } else { throw new JGitInternalException(MessageFormat .format(CLIText.get().unknownSubcommand, command)); } } }
Source:
public void installEdition(Set<String> pluginKeys) { Optional<UpdateCenter> updateCenter = updateCenterMatrixFactory.getUpdateCenter(true); Set<Release> pluginsToInstall = new HashSet<>(); if (updateCenter.isPresent()) { for (String pluginKey : pluginKeys) { pluginsToInstall.addAll(updateCenter.get().findInstallablePlugins(pluginKey, Version.create(""))); } } pluginsToInstall.forEach(super::download); }

Target:
public void installEdition(Set<String> pluginKeys) { Optional<UpdateCenter> updateCenter = updateCenterMatrixFactory.getUpdateCenter(true); if (updateCenter.isPresent()) { Set<Release> pluginsToInstall = new HashSet<>(); for (String pluginKey : pluginKeys) { pluginsToInstall.addAll(updateCenter.get().findInstallablePlugins(pluginKey, Version.create(""))); } for (Release r : pluginsToInstall) { super.download(r); } } }
Source:
public List<VmTemplate> getVmTemplatesByIds(List<Guid> templatesIds) { return getCallsHandler().executeReadList("GetVmTemplatesByIds", VMTemplateRowMapper.instance, getCustomMapSqlParameterSource().addValue("vms_tremplates_ids", StringUtils.join(templatesIds,','))); }

Target:
public List<VmTemplate> getVmTemplatesByIds(List<Guid> templatesIds) { return getCallsHandler().executeReadList("GetVmTemplatesByIds", VMTemplateRowMapper.instance, getCustomMapSqlParameterSource().addValue("vm_templates_ids", StringUtils.join(templatesIds,','))); }
Source:
protected void executeCommand() { setStoragePoolId(getNetwork().getDataCenterId()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void> () { @Override public Void runInTransaction() { removeVnicProfiles(); getCompensationContext().snapshotEntity(getNetwork()); getNetworkDAO().remove(getNetwork().getId()); getCompensationContext().stateChanged(); return null; } }); if (getNetwork().isExternal()) { if (getParameters().isRemoveFromNetworkProvider()) { removeExternalNetwork(); } } else { if (NetworkUtils.isLabeled(getNetwork()) && NetworkHelper.setupNetworkSupported(getStoragePool().getcompatibility_version())) { removeNetworkFromHosts(); } } setSucceeded(true); }

Target:
protected void executeCommand() { setStoragePoolId(getNetwork().getDataCenterId()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void> () { @Override public Void runInTransaction() { removeVnicProfiles(); getCompensationContext().snapshotEntity(getNetwork()); getNetworkDAO().remove(getNetwork().getId()); getCompensationContext().stateChanged(); return null; } }); if (getNetwork().isExternal()) { if (getParameters().isRemoveFromNetworkProvider()) { removeExternalNetwork(); } } if (NetworkHelper.shouldNetworkBeRemovedFromHosts(getNetwork(), getStoragePool().getcompatibility_version())) { removeNetworkFromHosts(); } setSucceeded(true); }
Source:
public Collection<IRemoteTest> split(int shardCountHint) { if (shardCountHint <= 1 || mIsSharded) { return null; } Collection<IRemoteTest> tests = new ArrayList<>(); for (int i = 0; i < shardCountHint; i++) { tests.add(getTestShard(shardCountHint, i)); } return tests; }

Target:
public Collection<IRemoteTest> split(int shardCountHint) { if (shardCountHint <= 1 || mIsSharded) { return null; } Collection<IRemoteTest> tests = new ArrayList<>(); for (int i = 0; i < shardCountHint; i++) { tests.add(getTestShard(shardCountHint, i)); } mIsSharded = true; return tests; }