auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void configure() { bind(RequestScopePropagator.class).to(GuiceRequestScopePropagator.class); bind(HttpRequestContext.class); if (wantSSL) { install(new RequireSslFilter.Module()); } install(new RunAsFilter.Module()); switch (authConfig.getAuthType()) { case HTTP_GITHUB: install(new HttpGitHubOAuthModule()); case HTTP: case HTTP_LDAP: install(new HttpAuthModule(authConfig)); break; case CLIENT_SSL_CERT_LDAP: install(new HttpsClientSslCertModule()); break; case LDAP: case LDAP_BIND: install(new LdapAuthModule()); break; case DEVELOPMENT_BECOME_ANY_ACCOUNT: install(new BecomeAnyAccountModule()); break; case OPENID: case OPENID_SSO: case CUSTOM_EXTENSION: break; default: throw new ProvisionException("Unsupported loginType: " + authConfig.getAuthType()); } install(new UrlModule(urlConfig, uiOptions)); install(new UiRpcModule()); install(new GerritRequestModule()); install(new GitOverHttpServlet.Module()); bind(GitWebConfig.class).toInstance(gitWebConfig); if (gitWebConfig.getGitwebCGI() != null) { install(new GitWebModule()); } bind(ContactStore.class).toProvider(ContactStoreProvider.class).in( SINGLETON); bind(GerritConfigProvider.class); bind(GerritConfig.class).toProvider(GerritConfigProvider.class); DynamicSet.setOf(binder(), WebUiPlugin.class); install(new AsyncReceiveCommits.Module()); bind(SocketAddress.class).annotatedWith(RemotePeer.class).toProvider( HttpRemotePeerProvider.class).in(RequestScoped.class); listener().toInstance(registerInParentInjectors()); }

Target:
protected void configure() { bind(RequestScopePropagator.class).to(GuiceRequestScopePropagator.class); bind(HttpRequestContext.class); if (wantSSL) { install(new RequireSslFilter.Module()); } install(new RunAsFilter.Module()); switch (authConfig.getAuthType()) { case OAUTH_GITHUB: install(new HttpGitHubOAuthModule()); case HTTP: case HTTP_LDAP: install(new HttpAuthModule(authConfig)); break; case CLIENT_SSL_CERT_LDAP: install(new HttpsClientSslCertModule()); break; case LDAP: case LDAP_BIND: install(new LdapAuthModule()); break; case DEVELOPMENT_BECOME_ANY_ACCOUNT: install(new BecomeAnyAccountModule()); break; case OPENID: case OPENID_SSO: case CUSTOM_EXTENSION: break; default: throw new ProvisionException("Unsupported loginType: " + authConfig.getAuthType()); } install(new UrlModule(urlConfig, uiOptions)); install(new UiRpcModule()); install(new GerritRequestModule()); install(new GitOverHttpServlet.Module()); bind(GitWebConfig.class).toInstance(gitWebConfig); if (gitWebConfig.getGitwebCGI() != null) { install(new GitWebModule()); } bind(ContactStore.class).toProvider(ContactStoreProvider.class).in( SINGLETON); bind(GerritConfigProvider.class); bind(GerritConfig.class).toProvider(GerritConfigProvider.class); DynamicSet.setOf(binder(), WebUiPlugin.class); install(new AsyncReceiveCommits.Module()); bind(SocketAddress.class).annotatedWith(RemotePeer.class).toProvider( HttpRemotePeerProvider.class).in(RequestScoped.class); listener().toInstance(registerInParentInjectors()); }
Source:
private boolean isBAMFile(final InputStream stream) throws IOException { if (!BlockCompressedInputStream.isValidFile(stream)) { return false; } final int buffSize = BlockCompressedStreamConstants.MAX_COMPRESSED_BLOCK_SIZE; stream.mark(buffSize); final byte[] buffer = new byte[buffSize]; readBytes(stream, buffer, 0, buffSize); stream.reset(); final byte[] magicBuf = new byte[4]; BlockCompressedInputStream bcis = new BlockCompressedInputStream(new ByteArrayInputStream(buffer), false); final int magicLength = readBytes(bcis, magicBuf, 0, 4); bcis.close(); return magicLength == BAMFileConstants.BAM_MAGIC.length && Arrays.equals(BAMFileConstants.BAM_MAGIC, magicBuf); }

Target:
private boolean isBAMFile(final InputStream stream) throws IOException { if (!BlockCompressedInputStream.isValidFile(stream)) { return false; } final int buffSize = BlockCompressedStreamConstants.MAX_COMPRESSED_BLOCK_SIZE; stream.mark(buffSize); final byte[] buffer = new byte[buffSize]; readBytes(stream, buffer, 0, buffSize); stream.reset(); final byte[] magicBuf = new byte[4]; final BlockCompressedInputStream bcis = new BlockCompressedInputStream(new ByteArrayInputStream(buffer), false); final int magicLength = readBytes(bcis, magicBuf, 0, 4); bcis.close(); return magicLength == BAMFileConstants.BAM_MAGIC.length && Arrays.equals(BAMFileConstants.BAM_MAGIC, magicBuf); }
Source:
public void teleport(EntityPlayer p) throws GridAccessException { List<TileTeleporter> tps = new ArrayList<TileTeleporter>(); for (IGridNode gn : gridProxy.getGrid().getMachines( TileTeleporter.class)) { TileTeleporter tt = (TileTeleporter) gn.getMachine(); if (freq == tt.freq && tt != this) tps.add(tt); } if (tps.size() > 1 || tps.size() < 1) return; TileTeleporter tt = tps.get(0); boolean dimTravel = p.worldObj != tt.worldObj; double distance = Math.abs(xCoord - tt.xCoord) + Math.abs(yCoord - tt.yCoord) + Math.abs(zCoord - tt.zCoord); double drain = AEConfig.instance.teleporter_getDrain(distance, dimTravel); if (drain > 0 && gridProxy.getEnergy().getStoredPower() >= drain) { System.out.println(gridProxy.getEnergy().extractAEPower(drain, Actionable.MODULATE, PowerMultiplier.CONFIG)); if (p.worldObj != tt.worldObj) p.travelToDimension(tt.worldObj.provider.dimensionId); p.mountEntity(null); p.setPositionAndUpdate(tt.xCoord + 0.5, tt.yCoord + 1, tt.zCoord + 0.5); p.worldObj.playSoundEffect(p.posX, p.posY, p.posZ, "mob.endermen.portal", 1F, 1F); return; } }

Target:
public void teleport( EntityPlayer p ) throws GridAccessException { TileTeleporter tt; List<TileTeleporter> tps = new ArrayList<TileTeleporter>(); for (IGridNode gn : gridProxy.getGrid().getMachines( TileTeleporter.class )) { tt = (TileTeleporter) gn.getMachine(); if ( !output && tt != this && tt.output && freq == tt.freq ) { teleportTo( p, tt ); } if ( output && !tt.output && freq == tt.freq ) { tps.add( tt ); } } if ( !tps.isEmpty() ) { tt = tps.get( new Random().nextInt( tps.size() ) ); teleportTo( p, tt ); } }
Source:
public Wiki createWiki(String wikiType, String owner) throws WikiException { Wiki wiki = new Wiki(wikiType, owner); wiki.setPermissions(getWikiDefaultPermissions(wikiType, owner)); WikiPreferences wikiPreferences = new WikiPreferences(); WikiPreferencesSyntax wikiPreferencesSyntax = new WikiPreferencesSyntax(); wikiPreferencesSyntax.setDefaultSyntax(getDefaultWikiSyntaxId()); wikiPreferences.setWikiPreferencesSyntax(wikiPreferencesSyntax); wiki.setPreferences(wikiPreferences); Wiki createdWiki = dataStorage.createWiki(wiki); StringBuilder sb = new StringBuilder("= Welcome to "); String spaceName = owner; if(wikiType.equals(PortalConfig.GROUP_TYPE)) { try { spaceName = getSpaceNameByGroupId(owner); } catch(Exception e) { if (LOG.isDebugEnabled()) { LOG.debug("Can't get Space name by group ID : " + owner, e); } } } sb.append(spaceName).append(" ="); createdWiki.getWikiHome().setContent(sb.toString()); updatePage(createdWiki.getWikiHome(), PageUpdateType.EDIT_PAGE_CONTENT); for(WikiTemplatePagePlugin templatePlugin : templatePagePlugins_) { if (templatePlugin != null && templatePlugin.getTemplates() != null) { for (Template template : templatePlugin.getTemplates()) { try { InputStream templateInputStream = configManager.getInputStream(template.getSourceFilePath()); template.setContent(IOUtils.toString(templateInputStream)); dataStorage.createTemplatePage(createdWiki, template); } catch(Exception e) { log.error("Cannot init template " + template.getName() + " - Cause : " + e.getMessage(), e); } } } } return createdWiki; }

Target:
public Wiki createWiki(String wikiType, String owner) throws WikiException { Wiki wiki = new Wiki(wikiType, owner); wiki.setPermissions(getWikiDefaultPermissions(wikiType, owner)); WikiPreferences wikiPreferences = new WikiPreferences(); WikiPreferencesSyntax wikiPreferencesSyntax = new WikiPreferencesSyntax(); wikiPreferencesSyntax.setDefaultSyntax(getDefaultWikiSyntaxId()); wikiPreferences.setWikiPreferencesSyntax(wikiPreferencesSyntax); wiki.setPreferences(wikiPreferences); Wiki createdWiki = dataStorage.createWiki(wiki); StringBuilder sb = new StringBuilder("= Welcome to "); String wikiLabel = owner; if(wikiType.equals(PortalConfig.GROUP_TYPE)) { wikiLabel = getSpaceNameByGroupId(owner); } sb.append(wikiLabel).append(" ="); createdWiki.getWikiHome().setContent(sb.toString()); updatePage(createdWiki.getWikiHome(), null); for(WikiTemplatePagePlugin templatePlugin : templatePagePlugins_) { if (templatePlugin != null && templatePlugin.getTemplates() != null) { for (Template template : templatePlugin.getTemplates()) { try { InputStream templateInputStream = configManager.getInputStream(template.getSourceFilePath()); template.setContent(IOUtils.toString(templateInputStream)); dataStorage.createTemplatePage(createdWiki, template); } catch(Exception e) { log.error("Cannot init template " + template.getName() + " - Cause : " + e.getMessage(), e); } } } } return createdWiki; }
Source:
public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { logger.debug("skip project as configured"); return; } try { DependencyResolver dependencyResolver = new DependencyResolver(project, repositorySession, resolver, system, scopes.stream() .map(Scope::name) .collect(Collectors.toList())); FileSetRepository fileSetRepository = dependencyResolver.getFileSetRepository(project.getName(), bundles.getFiles(project.getBasedir()), useMavenDependencies); if (exporter == null) { exporter = bundlesOnly ? RunbundlesExporter.RUNBUNDLES : ExecutableJarExporter.EXECUTABLE_JAR; } Properties beanProperties = new BeanProperties(); beanProperties.put("project", project); beanProperties.put("settings", settings); Properties mavenProperties = new Properties(beanProperties); mavenProperties.putAll(project.getProperties()); Processor processor = new Processor(mavenProperties, false); for (File runFile : bndruns.getFiles(project.getBasedir(), "*.bndrun")) { export(runFile, fileSetRepository, processor); } } catch (Exception e) { throw new MojoExecutionException(e.getMessage(), e); } if (errors > 0) throw new MojoFailureException(errors + " errors found"); }

Target:
public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { logger.debug("skip project as configured"); return; } try { DependencyResolver dependencyResolver = new DependencyResolver(project, repositorySession, resolver, system, scopes); FileSetRepository fileSetRepository = dependencyResolver.getFileSetRepository(project.getName(), bundles.getFiles(project.getBasedir()), useMavenDependencies); if (exporter == null) { exporter = bundlesOnly ? RunbundlesExporter.RUNBUNDLES : ExecutableJarExporter.EXECUTABLE_JAR; } Properties beanProperties = new BeanProperties(); beanProperties.put("project", project); beanProperties.put("settings", settings); Properties mavenProperties = new Properties(beanProperties); mavenProperties.putAll(project.getProperties()); Processor processor = new Processor(mavenProperties, false); for (File runFile : bndruns.getFiles(project.getBasedir(), "*.bndrun")) { export(runFile, fileSetRepository, processor); } } catch (Exception e) { throw new MojoExecutionException(e.getMessage(), e); } if (errors > 0) throw new MojoFailureException(errors + " errors found"); }
Source:
public void testConfigurationCloseImportedProjects() throws Exception { String location = ImportTestUtils.copyDataLocation("ImportExistingProjectsWizardTestRebuildProject"); File file = new File(location); SmartImportWizard wizard = new SmartImportWizard(); wizard.setInitialImportSource(file); proceedSmartImportWizard(wizard, page -> page.setCloseProjectsAfterImport(true)); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); try { assertEquals(2, projects.length); IProject rootProject = ResourcesPlugin.getWorkspace().getRoot() .getProject("ImportExistingProjectsWizardTestRebuildProject"); assertTrue("Missing test project", rootProject.exists()); assertFalse("Test project should be closed after import", rootProject.isAccessible()); } finally { ImportTestUtils.deleteWorkspaceProjects(projects); } }

Target:
public void testConfigurationCloseImportedProjects() throws Exception { String location = ImportTestUtils.copyDataLocation("ImportExistingProjectsWizardTestRebuildProject"); File file = new File(location); SmartImportWizard wizard = new SmartImportWizard(); wizard.setInitialImportSource(file); proceedSmartImportWizard(wizard, page -> page.setCloseProjectsAfterImport(true)); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); try { assertEquals(2, projects.length); IProject rootProject = ResourcesPlugin.getWorkspace().getRoot() .getProject("ImportExistingProjectsWizardTestRebuildProject"); assertTrue("Missing test project", rootProject.exists()); assertFalse("Test project should be closed after import", rootProject.isOpen()); } finally { ImportTestUtils.deleteWorkspaceProjects(projects); } }
Source:
public static void stopAll() { IConsole ic[] = ConsolePlugin.getDefault().getConsoleManager().getConsoles(); ScriptConsole console; for(int i=0; i<ic.length; i++) { if (ic[i] instanceof ScriptConsole){ console = (ScriptConsole)ic[i]; if(console.isRunning()) console.stop(); } } }

Target:
public static void stopAll() { IConsole ic[] = ConsolePlugin.getDefault().getConsoleManager().getConsoles(); ScriptConsole console; for(int i=0; i<ic.length; i++) { if (ic[i] instanceof ScriptConsole){ console = (ScriptConsole)ic[i]; if(console.isRunning()){ console.stop(); } } } }
Source:
private boolean containsSequenceNumber(Collection<Message<?>> messages, Integer messageSequenceNumber) { for (Message<?> member : messages) { Object sequenceNumber = member.getHeaders().get( IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER); if (sequenceNumber instanceof Integer) { Integer memberSequenceNumber = (Integer) sequenceNumber; if (messageSequenceNumber.equals(memberSequenceNumber)) { return true; } } else { throw new IllegalArgumentException("Expected Integer for sequenceNumber header"); } } return false; }

Target:
private boolean containsSequenceNumber(Collection<Message<?>> messages, Integer messageSequenceNumber) { for (Message<?> member : messages) { if (messageSequenceNumber.equals(member.getHeaders().get( IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, Integer.class))) { return true; } } return false; }
Source:
@Override public boolean contains(Object o) { if (!(o instanceof Map.Entry) || ((Map.Entry) o).getKey() == null) return false; Map.Entry that = (Map.Entry) o; for (int i = 0; i < toIndex; i += 2) { if (that.getKey().equals(array[i]) && equal(that.getValue(), array[i + 1])) return true; } return false; }

Target:
@Override public boolean contains(Object o) { if (!(o instanceof Map.Entry) || ((Map.Entry) o).getKey() == null) return false; Map.Entry that = (Map.Entry) o; int i = arrayIndexOfKey(that.getKey()); if (i == -1) return false; return value(i + 1).equals(that.getValue()); }
Source:
public static boolean isDistinctFrom( @OperatorDependency(operator = EQUAL, returnType = StandardTypes.BOOLEAN, argumentTypes = {"K", "K"}) MethodHandle keyEqualsFunction, @OperatorDependency(operator = HASH_CODE, returnType = StandardTypes.BIGINT, argumentTypes = {"K"}) MethodHandle keyHashcodeFunction, @OperatorDependency(operator = IS_DISTINCT_FROM, returnType = StandardTypes.BOOLEAN, argumentTypes = {"V", "V"}) MethodHandle valueDistinctFromFunction, @TypeParameter("K") Type keyType, @TypeParameter("V") Type valueType, @SqlNullable @SqlType("map(K,V)") Block leftMapBlock, @IsNull boolean leftMapNull, @SqlNullable @SqlType("map(K,V)") Block rightMapBlock, @IsNull boolean rightMapNull) { if (leftMapNull != rightMapNull) { return true; } if (leftMapNull) { return false; } return !MapGenericEquality.genericEqual( keyEqualsFunction, keyHashcodeFunction, keyType, leftMapBlock, rightMapBlock, (leftMapIndex, rightMapIndex) -> { Object leftValue = readNativeValue(valueType, leftMapBlock, leftMapIndex); boolean leftNull = leftValue == null; if (leftNull) { leftValue = defaultValue(valueType.getJavaType()); } Object rightValue = readNativeValue(valueType, rightMapBlock, rightMapIndex); boolean rightNull = rightValue == null; if (rightNull) { rightValue = defaultValue(valueType.getJavaType()); } return !(boolean) valueDistinctFromFunction.invoke(leftValue, leftNull, rightValue, rightNull); }); }

Target:
public static boolean isDistinctFrom( @OperatorDependency(operator = EQUAL, returnType = StandardTypes.BOOLEAN, argumentTypes = {"K", "K"}) MethodHandle keyEqualsFunction, @OperatorDependency(operator = HASH_CODE, returnType = StandardTypes.BIGINT, argumentTypes = {"K"}) MethodHandle keyHashcodeFunction, @OperatorDependency(operator = IS_DISTINCT_FROM, returnType = StandardTypes.BOOLEAN, argumentTypes = {"V", "V"}) MethodHandle valueDistinctFromFunction, @TypeParameter("K") Type keyType, @TypeParameter("V") Type valueType, @SqlNullable @SqlType("map(K,V)") Block leftMapBlock, @IsNull boolean leftMapNull, @SqlNullable @SqlType("map(K,V)") Block rightMapBlock, @IsNull boolean rightMapNull) { if (leftMapNull != rightMapNull) { return true; } if (leftMapNull) { return false; } return !MapGenericEquality.genericEqual( keyType, leftMapBlock, rightMapBlock, (leftMapIndex, rightMapIndex) -> { Object leftValue = readNativeValue(valueType, leftMapBlock, leftMapIndex); boolean leftNull = leftValue == null; if (leftNull) { leftValue = defaultValue(valueType.getJavaType()); } Object rightValue = readNativeValue(valueType, rightMapBlock, rightMapIndex); boolean rightNull = rightValue == null; if (rightNull) { rightValue = defaultValue(valueType.getJavaType()); } return !(boolean) valueDistinctFromFunction.invoke(leftValue, leftNull, rightValue, rightNull); }); }
Source:
protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(getCacheMode(), true); builder.clustering().stateTransfer().chunkSize(200).sync().replTimeout(45, TimeUnit.SECONDS); createClusteredCaches(4, cacheName(), builder); }

Target:
protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(getCacheMode(), true); builder.clustering().stateTransfer().sync().replTimeout(45, TimeUnit.SECONDS); createClusteredCaches(4, cacheName(), builder); }
Source:
public String toString() { return "TimeseriesQuery{" + "dataSource='" + getDataSource() + '\'' + ", querySegmentSpec=" + getQuerySegmentSpec() + ", virtualColumns=" + virtualColumns + ", descending=" + isDescending() + ", dimFilter=" + dimFilter + ", granularity='" + granularity + '\'' + ", aggregatorSpecs=" + aggregatorSpecs + ", postAggregatorSpecs=" + postAggregatorSpecs + ", context=" + getContext() + '}'; }

Target:
public String toString() { return "TimeseriesQuery{" + "dataSource='" + getDataSource() + '\'' + ", querySegmentSpec=" + getQuerySegmentSpec() + ", descending=" + isDescending() + ", virtualColumns=" + virtualColumns + ", dimFilter=" + dimFilter + ", granularity='" + granularity + '\'' + ", aggregatorSpecs=" + aggregatorSpecs + ", postAggregatorSpecs=" + postAggregatorSpecs + ", context=" + getContext() + '}'; }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_add_new_user_brick, container, false); addLabel = view.findViewById(R.id.add_label); addInput = view.findViewById(R.id.add_input); addLabel.setOnClickListener(v -> handleAddLabel()); addInput.setOnClickListener(v -> handleAddInput()); ((AppCompatActivity) getActivity()) .getSupportActionBar().setTitle(R.string.brick_add_new_user_brick); return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_add_new_user_brick, container, false); addLabel = view.findViewById(R.id.add_label); addInput = view.findViewById(R.id.add_input); addLabel.setOnClickListener(v -> handleAddLabel()); addInput.setOnClickListener(v -> handleAddInput()); AppCompatActivity appCompatActivity = (AppCompatActivity) getActivity(); if (appCompatActivity != null && appCompatActivity.getSupportActionBar() != null) { appCompatActivity.getSupportActionBar().setTitle(R.string.brick_add_new_user_brick); } return view; }
Source:
private Integer getPrecedenceLevel(RouterErrorCode routerErrorCode) { switch (routerErrorCode) { case BlobDeleted: return 1; case BlobExpired: return 2; case AmbryUnavailable: return 3; case UnexpectedInternalError: return 4; case OperationTimedOut: return 5; case BlobDoesNotExist: return 6; default: return Integer.MIN_VALUE; } }

Target:
private Integer getPrecedenceLevel(RouterErrorCode routerErrorCode) { switch (routerErrorCode) { case BlobDeleted: return 1; case BlobExpired: return 2; case RangeNotSatisfiable: return 3; case AmbryUnavailable: return 4; case UnexpectedInternalError: return 5; case OperationTimedOut: return 6; case BlobDoesNotExist: return 7; default: return Integer.MIN_VALUE; } }
Source:
protected void doRemove(String id) throws ServerException { final EntityManager manager = managerProvider.get(); final UserImpl user = manager.find(UserImpl.class, id); if (user != null) { manager.remove(user); manager.flush(); } }

Target:
protected void doRemove(String id) { final EntityManager manager = managerProvider.get(); final UserImpl user = manager.find(UserImpl.class, id); if (user != null) { manager.remove(user); manager.flush(); } }
Source:
public AzureCloudInstanceInformation parseCloudInstanceInformation(List<String> responses) { AzureCloudInstanceInformation azureCloudInstanceInformation = null; if (responses.size() > 1) { throw new HelixException("Multiple responses are not supported for Azure now"); } String response = responses.get(0); ObjectMapper mapper = new ObjectMapper(); try { JsonNode jsonNode = mapper.readTree(response); JsonNode computeNode = jsonNode.path(COMPUTE); if (!computeNode.isMissingNode()) { String vmName = computeNode.path(INSTANCE_NAME).getTextValue(); String platformFaultDomain = computeNode.path(DOMAIN).getTextValue(); String vmssName = computeNode.path(INSTANCE_SET_NAME).getValueAsText(); String azureTopology = AzureConstants.AZURE_TOPOLOGY; String[] parts = azureTopology.trim().split("/"); if (parts.length != 2) { throw new HelixException("Invalid Azure topology definition: " + azureTopology); } String domain = parts[0] + "=" + platformFaultDomain + "," + parts[1] + "="; AzureCloudInstanceInformation.Builder builder = new AzureCloudInstanceInformation.Builder(); builder.setInstanceName(vmName).setFaultDomain(domain) .setInstanceSetName(vmssName); azureCloudInstanceInformation = builder.build(); } } catch (IOException e) { throw new HelixException(String.format("Error in parsing cloud instance information: {}", response, e)); } return azureCloudInstanceInformation; }

Target:
public AzureCloudInstanceInformation parseCloudInstanceInformation(List<String> responses) { AzureCloudInstanceInformation azureCloudInstanceInformation = null; if (responses.size() > 1) { throw new HelixException("Multiple responses are not supported for Azure now"); } String response = responses.get(0); ObjectMapper mapper = new ObjectMapper(); try { JsonNode jsonNode = mapper.readTree(response); JsonNode computeNode = jsonNode.path(COMPUTE); if (!computeNode.isMissingNode()) { String vmName = computeNode.path(INSTANCE_NAME).getTextValue(); String platformFaultDomain = computeNode.path(DOMAIN).getTextValue(); String vmssName = computeNode.path(INSTANCE_SET_NAME).getValueAsText(); String azureTopology = AzureConstants.AZURE_TOPOLOGY; String[] parts = azureTopology.trim().split("/"); String domain = parts[0] + "=" + platformFaultDomain + "," + parts[1] + "="; AzureCloudInstanceInformation.Builder builder = new AzureCloudInstanceInformation.Builder(); builder.setInstanceName(vmName).setFaultDomain(domain) .setInstanceSetName(vmssName); azureCloudInstanceInformation = builder.build(); } } catch (IOException e) { throw new HelixException(String.format("Error in parsing cloud instance information: {}", response, e)); } return azureCloudInstanceInformation; }
Source:
public List<PatchSetApproval> copyVetosToLatestPatchSet(Change change) throws OrmException, IOException { PatchSet.Id source; if (change.getNumberOfPatchSets() > 1) { source = new PatchSet.Id(change.getId(), change.getNumberOfPatchSets() - 1); } else { throw new IOException("Previous patch set could not be found"); } PatchSet.Id dest = change.currPatchSetId(); ResultSet<PatchSetApproval> patchSetApprovals = db.patchSetApprovals().byPatchSet(source); for (PatchSetApproval a : patchSetApprovals) { if (!ApprovalCategory.SUBMIT.equals(a.getCategoryId())) { final ApprovalType type = approvalTypes.byId(a.getCategoryId()); if (type.getCategory().isCopyMinScore() && type.isMaxNegative(a)) { db.patchSetApprovals().insert( Collections.singleton(new PatchSetApproval(dest, a))); } } } return patchSetApprovals.toList(); }

Target:
public List<PatchSetApproval> copyVetosToLatestPatchSet(Change change) throws OrmException, IOException { PatchSet.Id source; if (change.getNumberOfPatchSets() > 1) { source = new PatchSet.Id(change.getId(), change.getNumberOfPatchSets() - 1); } else { throw new IOException("Previous patch set could not be found"); } PatchSet.Id dest = change.currPatchSetId(); List<PatchSetApproval> patchSetApprovals = db.patchSetApprovals().byPatchSet(source).toList(); for (PatchSetApproval a : patchSetApprovals) { if (!ApprovalCategory.SUBMIT.equals(a.getCategoryId())) { final ApprovalType type = approvalTypes.byId(a.getCategoryId()); if (type.getCategory().isCopyMinScore() && type.isMaxNegative(a)) { db.patchSetApprovals().insert( Collections.singleton(new PatchSetApproval(dest, a))); } } } return patchSetApprovals; }
Source:
private boolean validateKeyTypeIsHashable(TypeInformation<?> type) { try { return (type instanceof PojoTypeInfo) ? !type.getTypeClass().getMethod("hashCode").getDeclaringClass().equals(Object.class) : !(type instanceof PrimitiveArrayTypeInfo || type instanceof BasicArrayTypeInfo || type instanceof ObjectArrayTypeInfo || type instanceof EnumTypeInfo); } catch (NoSuchMethodException ignored) { } return false; }

Target:
private boolean validateKeyTypeIsHashable(TypeInformation<?> type) { try { return (type instanceof PojoTypeInfo) ? !type.getTypeClass().getMethod("hashCode").getDeclaringClass().equals(Object.class) : !(isArrayType(type) || isEnumType(type)); } catch (NoSuchMethodException ignored) { } return false; }
Source:
private CoapObserveRelation observeAndWait(Request request, CoapHandler handler) { Endpoint outEndpoint = getEffectiveEndpoint(request); CoapObserveRelation relation = new CoapObserveRelation(request, outEndpoint); ObserveMessageObserverImpl messageObserver = new ObserveMessageObserverImpl(handler, relation); request.addMessageObserver(messageObserver); NotificationListener notificationListener = new Adapter(messageObserver, request); outEndpoint.addNotificationListener(notificationListener); messageObserver.setNotificationListener(notificationListener); relation.setNotificationListener(notificationListener); CoapResponse response = synchronous(request, outEndpoint); if (response == null || !response.advanced().getOptions().hasObserve()) relation.setCanceled(true); relation.setCurrent(response); return relation; }

Target:
private CoapObserveRelation observeAndWait(Request request, CoapHandler handler) { Endpoint outEndpoint = getEffectiveEndpoint(request); CoapObserveRelation relation = new CoapObserveRelation(request, outEndpoint); ObserveMessageObserverImpl messageObserver = new ObserveMessageObserverImpl(handler, relation); request.addMessageObserver(messageObserver); NotificationListener notificationListener = new Adapter(messageObserver, request); outEndpoint.addNotificationListener(notificationListener); relation.setNotificationListener(notificationListener); CoapResponse response = synchronous(request, outEndpoint); if (response == null || !response.advanced().getOptions().hasObserve()) relation.setCanceled(true); relation.setCurrent(response); return relation; }
Source:
public AxisService findService(MessageContext mc) throws AxisFault { AxisService service = mc.getAxisService(); if (service == null) { String to = mc.getTo().getAddress(); if (to.startsWith(mc.getConfigurationContext().getServiceContextPath())) { int tenantDelimiterIndex = to.indexOf("/t/"); if (tenantDelimiterIndex != -1) { getService(mc); } } else if (to.startsWith("/t/")) { getService(mc); } } return service; }

Target:
public AxisService findService(MessageContext mc) throws AxisFault { AxisService service = mc.getAxisService(); if (service == null) { String to = mc.getTo().getAddress(); if (to.startsWith(mc.getConfigurationContext().getServiceContextPath())) { int tenantDelimiterIndex = to.indexOf(TENANT_PATH); if (tenantDelimiterIndex != -1) { getService(mc); } } else if (to.startsWith(TENANT_PATH)) { getService(mc); } } return service; }
Source:
public void run() { for (TimeGraphEntry entry : fZoomEntryList) { if (getMonitor().isCanceled()) { return; } if (entry == null) { break; } zoom(entry, getMonitor()); } List<ILinkEvent> events = getLinkList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor()); if (events != null) { fTimeGraphWrapper.getTimeGraphViewer().setLinks(events); redraw(); } List<IMarkerEvent> markers = getViewMarkerList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor()); List<IMarkerEvent> traceMarkers = getTraceMarkerList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor()); markers.addAll(traceMarkers); fTimeGraphWrapper.getTimeGraphViewer().getTimeGraphControl().setMarkers(markers); redraw(); }

Target:
public void run() { for (TimeGraphEntry entry : fZoomEntryList) { if (getMonitor().isCanceled()) { return; } if (entry == null) { break; } zoom(entry, getMonitor()); } List<ILinkEvent> events = getLinkList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor()); if (events != null) { fTimeGraphWrapper.getTimeGraphViewer().setLinks(events); redraw(); } List<IMarkerEvent> markers = new ArrayList<>(getViewMarkerList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor())); markers.addAll(getTraceMarkerList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor())); fTimeGraphWrapper.getTimeGraphViewer().getTimeGraphControl().setMarkers(markers); redraw(); }
Source:
private static String removeQueryPrefix(final String luceneQuery){ final String cleanedUpQuery; if(luceneQuery.startsWith("query_")){ cleanedUpQuery = luceneQuery.replace( "query_", StringPool.BLANK); } else { cleanedUpQuery = luceneQuery; } return cleanedUpQuery; }

Target:
private static String removeQueryPrefix(final String luceneQuery) { return (luceneQuery.startsWith("query_") ? luceneQuery.replace("query_", StringPool.BLANK) : luceneQuery ); }
Source:
public static String getDateString(Context context, Date date) { String month = DateUtils.getMonthString(date.getMonth() + Calendar.JANUARY, DateUtils.LENGTH_MEDIUM); String value; if ("ko".equals(Locale.getDefault().getLanguage()) || Locale.US.equals(Locale.getDefault()) || "BZ".equals(Locale.getDefault().getCountry()) || Locale.CANADA.equals(Locale.getDefault()) || "KE".equals(Locale.getDefault().getCountry()) || "MN".equals(Locale.getDefault().getCountry()) || "zh".equals(Locale.getDefault().getLanguage()) || "ja".equals(Locale.getDefault().getLanguage())) value = "'#' d yyyy"; else value = "d '#' yyyy"; String standardDate = new SimpleDateFormat(value).format(date).replace("#", month); if (standardDate.length() < 5) return standardDate; if ("zh".equals(Locale.getDefault().getLanguage()) || "ja".equals(Locale.getDefault().getLanguage())) return new StringBuilder(standardDate).insert(standardDate.length()-5, "\u65E5").toString(); else if ("ko".equals(Locale.getDefault().getLanguage())) return new StringBuilder(standardDate).insert(standardDate.length()-5, "\uC77C").toString(); else return standardDate; }

Target:
public static String getDateString(Context context, Date date) { String month = DateUtils.getMonthString(date.getMonth() + Calendar.JANUARY, DateUtils.LENGTH_MEDIUM); String value; String standardDate; Locale locale = Locale.getDefault(); if (arrayBinaryContains(locale.getLanguage(), "ja", "ko", "zh") || arrayBinaryContains(locale.getCountry(), "BZ", "CA", "KE", "MN" ,"US")) value = "'#' d'$' yyyy"; else value = "d'$' '#' yyyy"; if (arrayBinaryContains(locale.getLanguage(), "ja", "zh")){ standardDate = new SimpleDateFormat(value).format(date).replace("#", month).replace("$", "\u65E5"); }else if ("ko".equals(Locale.getDefault().getLanguage())){ standardDate = new SimpleDateFormat(value).format(date).replace("#", month).replace("$", "\uC77C"); }else{ standardDate = new SimpleDateFormat(value).format(date).replace("#", month).replace("$", ""); } return standardDate;}
Source:
@Theory public void testWidth(@TestedOn(ints = {WIDTH_DP_XL, WIDTH_DP_L}) int widthDp, @NonNull FontScale fontScale) { setUp(widthDp, LayoutDirection.LOCALE, fontScale, Theme.LIGHT); subject = new DescriptionEditSuccessView(ctx()); snap(subject); }

Target:
@Theory public void testWidth(@TestedOn(ints = {WIDTH_DP_XL, WIDTH_DP_L}) int widthDp, @NonNull FontScale fontScale) { setUp(widthDp, LayoutDirection.LOCALE, fontScale, Theme.LIGHT); snap(subject); }
Source:
public Response cloneVm(Action action) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity( org.ovirt.engine.core.common.businessentities.VM.class, VdcQueryType.GetVmByVmId, new IdQueryParameters(guid), "VM: id=" + guid); String newName = ""; if (action.isSetVm() && action.getVm().isSetName()) { newName = action.getVm().getName(); } CloneVmParameters cloneVmParameters = new CloneVmParameters(vm, newName); cloneVmParameters.setMakeCreatorExplicitOwner(isFiltered()); Response response = doAction(VdcActionType.CloneVm, cloneVmParameters, action); return response; }

Target:
public Response cloneVm(Action action) { validateParameters(action, "vm.name"); org.ovirt.engine.core.common.businessentities.VM vm = getEntity( org.ovirt.engine.core.common.businessentities.VM.class, VdcQueryType.GetVmByVmId, new IdQueryParameters(guid), "VM: id=" + guid); CloneVmParameters cloneVmParameters = new CloneVmParameters(vm, action.getVm().getName()); cloneVmParameters.setMakeCreatorExplicitOwner(isFiltered()); Response response = doAction(VdcActionType.CloneVm, cloneVmParameters, action); return response; }
Source:
public void setHostname(String hostname, ResponseCodeValidator validator) { hostPinger = HostPinger.withCustomEndpointAndValidation(this, hostname, validator); currentNetworkStatusRetriever = new CurrentNetworkStatusRetriever(MerlinsBeard.from(this.getApplicationContext()), hostPinger); }

Target:
public void setHostname(String hostname, ResponseCodeValidator validator) { hostPinger = buildHostPinger(hostname, validator); }
Source:
private static Object evaluate( TokenKind op, Object x, Object y, Environment env, Location location, boolean isAugmented) throws EvalException, InterruptedException { try { switch (op) { case AND: return EvalUtils.toBoolean(x) ? y : x; case OR: return EvalUtils.toBoolean(x) ? x : y; case PLUS: return plus(x, y, env, location, isAugmented); case PIPE: return pipe(x, y, env, location); case AMPERSAND: return (Integer) x & (Integer) y; case CARET: return (Integer) x ^ (Integer) y; case GREATER_GREATER: return (Integer) x >> (Integer) y; case LESS_LESS: return (Integer) x << (Integer) y; case MINUS: return minus(x, y, location); case STAR: return mult(x, y, env, location); case SLASH: throw new EvalException( location, "The `/` operator is not allowed. Please use the ` + "division."); case SLASH_SLASH: return divide(x, y, location); case PERCENT: return percent(x, y, location); case EQUALS_EQUALS: return x.equals(y); case NOT_EQUALS: return !x.equals(y); case LESS: return compare(x, y, location) < 0; case LESS_EQUALS: return compare(x, y, location) <= 0; case GREATER: return compare(x, y, location) > 0; case GREATER_EQUALS: return compare(x, y, location) >= 0; case IN: return in(x, y, env, location); case NOT_IN: return !in(x, y, env, location); default: throw new AssertionError("Unsupported binary operator: " + op); } } catch (ArithmeticException e) { throw new EvalException(location, e.getMessage()); } }

Target:
private static Object evaluate( TokenKind op, Object x, Object y, Environment env, Location location, boolean isAugmented) throws EvalException, InterruptedException { try { switch (op) { case AND: return EvalUtils.toBoolean(x) ? y : x; case OR: return EvalUtils.toBoolean(x) ? x : y; case PLUS: return plus(x, y, env, location, isAugmented); case PIPE: return pipe(x, y, env, location); case AMPERSAND: return and(x, y, location); case CARET: return xor(x, y, location); case GREATER_GREATER: return rightShift(x, y, location); case LESS_LESS: return leftShift(x, y, location); case MINUS: return minus(x, y, location); case STAR: return mult(x, y, env, location); case SLASH: throw new EvalException( location, "The `/` operator is not allowed. Please use the ` + "division."); case SLASH_SLASH: return divide(x, y, location); case PERCENT: return percent(x, y, location); case EQUALS_EQUALS: return x.equals(y); case NOT_EQUALS: return !x.equals(y); case LESS: return compare(x, y, location) < 0; case LESS_EQUALS: return compare(x, y, location) <= 0; case GREATER: return compare(x, y, location) > 0; case GREATER_EQUALS: return compare(x, y, location) >= 0; case IN: return in(x, y, env, location); case NOT_IN: return !in(x, y, env, location); default: throw new AssertionError("Unsupported binary operator: " + op); } } catch (ArithmeticException e) { throw new EvalException(location, e.getMessage()); } }
Source:
public StartIdentifiedAtlasDbTransactionResponse startIdentifiedAtlasDbTransaction( StartIdentifiedAtlasDbTransactionRequest request) { long startTime = System.nanoTime(); LeasableStartIdentifiedAtlasDbTransactionResponse leasableResponse = delegate.leasableStartIdentifiedAtlasDbTransaction(request); StartIdentifiedAtlasDbTransactionResponse response = leasableResponse.getStartTransactionResponse(); Optional<Duration> leasePeriod = leasableResponse.getLeasePeriod(); updateLockLeases(response.immutableTimestamp().getLock(), startTime, leasePeriod); return response; }

Target:
public StartIdentifiedAtlasDbTransactionResponse startIdentifiedAtlasDbTransaction( StartIdentifiedAtlasDbTransactionRequest request) { LeasableStartIdentifiedAtlasDbTransactionResponse leasableResponse = delegate.startAtlasDbTransactionV3(request); StartIdentifiedAtlasDbTransactionResponse response = leasableResponse.getStartTransactionResponse(); Lease lease = leasableResponse.getLease(); LeasedLockToken leasedLockToken = LeasedLockToken.of(response.immutableTimestamp().getLock(), lease); long immutableTs = response.immutableTimestamp().getImmutableTimestamp(); return ImmutableStartIdentifiedAtlasDbTransactionResponse.of( ImmutableLockImmutableTimestampResponse.of(immutableTs, leasedLockToken), response.startTimestampAndPartition()); }
Source:
public void disableGoToSleep() { if (configuration.isPreventsSleep() && System.currentTimeMillis() - lastDontSleepCall > 40000) { LOGGER.trace("Disable the PC sleeping mode"); Kernel32.INSTANCE.SetThreadExecutionState(Kernel32.ES_SYSTEM_REQUIRED | Kernel32.ES_CONTINUOUS); lastDontSleepCall = System.currentTimeMillis(); } }

Target:
public void disableGoToSleep() { if (configuration.isPreventsSleep() && System.currentTimeMillis() - lastDontSleepCall > 40000) { LOGGER.trace("Enable Windows sleep mode prevention"); Kernel32.INSTANCE.SetThreadExecutionState(Kernel32.ES_CONTINUOUS|Kernel32.ES_AWAYMODE_REQUIRED); lastDontSleepCall = System.currentTimeMillis(); } }
Source:
public Styler getStyler() { if (!fCanExecute) { return new Styler() { @Override public void applyStyles(TextStyle textStyle) { textStyle.strikeout = true; } }; } return null; }

Target:
public Styler getStyler() { if (!fCanExecute) { return ANALYSIS_CANT_EXECUTE_STYLER; } return null; }
Source:
public void dispose() { super.dispose(); IDebugContextManager contextManager = DebugContextManager.getDefault(); IDebugContextService contextService = contextManager .getContextService(getSite().getWorkbenchWindow()); contextService.removeDebugContextListener(fDebugContextListener); setDebugContext((IDMVMContext)null); }

Target:
public void dispose() { super.dispose(); IDebugContextManager contextManager = DebugUITools.getDebugContextManager(); IDebugContextService contextService = contextManager .getContextService(getSite().getWorkbenchWindow()); contextService.removeDebugContextListener(fDebugContextListener); setDebugContext((IDMContext)null); DsfSession.removeSessionEndedListener(this); }
Source:
public MessageMonitor<? extends Message<?>> registerComponentWithDefaultTags(Class<?> componentType, String componentName) { if (EventProcessor.class.isAssignableFrom(componentType)) { return registerEventProcessor(EVENT_PROCESSOR_METRICS_NAME, message -> Tags.of(TagsUtil.PAYLOAD_TYPE_TAG, message.getPayloadType().getSimpleName(), TagsUtil.PROCESSOR_NAME_TAG, componentName)); } if (CommandBus.class.isAssignableFrom(componentType)) { return registerCommandBus(componentName, message -> Tags .of(TagsUtil.PAYLOAD_TYPE_TAG, message.getPayloadType().getSimpleName())); } if (EventBus.class.isAssignableFrom(componentType)) { return registerEventBus(componentName, message -> Tags .of(TagsUtil.PAYLOAD_TYPE_TAG, message.getPayloadType().getSimpleName())); } if (QueryBus.class.isAssignableFrom(componentType)) { return registerQueryBus(componentName, message -> Tags .of(TagsUtil.PAYLOAD_TYPE_TAG, message.getPayloadType().getSimpleName())); } logger.warn("Cannot provide MessageMonitor for component of type [{}]. Returning No-Op instance.", componentName, componentType.getSimpleName()); return NoOpMessageMonitor.instance(); }

Target:
public MessageMonitor<? extends Message<?>> registerComponentWithDefaultTags(Class<?> componentType, String componentName) { if (EventProcessor.class.isAssignableFrom(componentType)) { return registerEventProcessor(EVENT_PROCESSOR_METRICS_NAME, message -> Tags.of(TagsUtil.PAYLOAD_TYPE_TAG, message.getPayloadType().getSimpleName(), TagsUtil.PROCESSOR_NAME_TAG, componentName)); } if (CommandBus.class.isAssignableFrom(componentType)) { return registerCommandBus(componentName, TagsUtil.PAYLOAD_TYPE_TAGGER_FUNCTION); } if (EventBus.class.isAssignableFrom(componentType)) { return registerEventBus(componentName, TagsUtil.PAYLOAD_TYPE_TAGGER_FUNCTION); } if (QueryBus.class.isAssignableFrom(componentType)) { return registerQueryBus(componentName, TagsUtil.PAYLOAD_TYPE_TAGGER_FUNCTION); } logger.warn("Cannot provide MessageMonitor for component of type [{}]. Returning No-Op instance.", componentName, componentType.getSimpleName()); return NoOpMessageMonitor.instance(); }
Source:
private static Map<String, String> getPropertiesFromFile(String filePath, int index) throws ShellArgumentException { Map<String, String> properties = new HashMap<String, String>(); File f = new File(filePath); try { BufferedReader br = new BufferedReader(new FileReader(f)); String line; int indexLine = 0; try { while ((line = br.readLine()) != null) { if (line.contains("=")) { String[] keyValue = line.split("="); if (keyValue.length == 2) { properties.put(keyValue[0], keyValue[1]); } else { System.out.println(Messages.i18n.format( "InvalidArgMsg.propertiesFile.error.reading.line", indexLine)); } } indexLine++; } br.close(); } catch (IOException ioe) { throw new ShellArgumentException(index, Messages.i18n.format("InvalidArgMsg.propertiesFile.error.reading") + ": " + ioe.getMessage()); } } catch (FileNotFoundException fnfe) { throw new ShellArgumentException(index, Messages.i18n.format("InvalidArgMsg.propertiesFile.not.exist")); } return properties; }

Target:
private static Map<String, String> getPropertiesFromFile(String filePath, int index) throws ShellArgumentException { Map<String, String> properties = new HashMap<String, String>(); File f = new File(filePath); Properties props = new Properties(); try { props.load(new FileInputStream(f)); } catch (FileNotFoundException e) { throw new ShellArgumentException(index, Messages.i18n.format("InvalidArgMsg.propertiesFile.not.exist")); } catch (IOException e) { throw new ShellArgumentException(index, Messages.i18n.format("InvalidArgMsg.propertiesFile.error.reading") + ": " + e.getMessage()); } for (final String name : props.stringPropertyNames()){ properties.put(name, props.getProperty(name)); } return properties; }
Source:
private RateAccrualPeriod( LocalDate startDate, LocalDate endDate, LocalDate unadjustedStartDate, LocalDate unadjustedEndDate, double yearFraction, RateObservation rateObservation, double gearing, double spread, NegativeRateMethod negativeRateMethod) { ArgChecker.notNull(startDate, "startDate"); ArgChecker.notNull(endDate, "endDate"); ArgChecker.notNegative(yearFraction, "yearFraction"); ArgChecker.notNull(rateObservation, "rateObservation"); ArgChecker.notNull(negativeRateMethod, "negativeRateMethod"); this.startDate = startDate; this.endDate = endDate; this.unadjustedStartDate = Objects.firstNonNull(unadjustedStartDate, startDate); this.unadjustedEndDate = Objects.firstNonNull(unadjustedEndDate, endDate); this.yearFraction = yearFraction; this.rateObservation = rateObservation; this.gearing = gearing; this.spread = spread; this.negativeRateMethod = negativeRateMethod; ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); ArgChecker.inOrderNotEqual( this.unadjustedStartDate, this.unadjustedEndDate, "unadjustedStartDate", "unadjustedEndDate"); }

Target:
private RateAccrualPeriod( LocalDate startDate, LocalDate endDate, LocalDate unadjustedStartDate, LocalDate unadjustedEndDate, double yearFraction, RateObservation rateObservation, double gearing, double spread, NegativeRateMethod negativeRateMethod) { this.startDate = ArgChecker.notNull(startDate, "startDate"); this.endDate = ArgChecker.notNull(endDate, "endDate"); this.unadjustedStartDate = Objects.firstNonNull(unadjustedStartDate, startDate); this.unadjustedEndDate = Objects.firstNonNull(unadjustedEndDate, endDate); this.yearFraction = ArgChecker.notNegative(yearFraction, "yearFraction"); this.rateObservation = ArgChecker.notNull(rateObservation, "rateObservation"); this.gearing = gearing; this.spread = spread; this.negativeRateMethod = ArgChecker.notNull(negativeRateMethod, "negativeRateMethod"); ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); ArgChecker.inOrderNotEqual( this.unadjustedStartDate, this.unadjustedEndDate, "unadjustedStartDate", "unadjustedEndDate"); }
Source:
public void setOverrides(CompatibilityChangeConfig overrides, String packageName) { mCompatConfig.addOverrides(overrides, packageName, mOverrideValidator); killPackage(packageName); }

Target:
public void setOverrides(CompatibilityChangeConfig overrides, String packageName) throws RemoteException, SecurityException { mCompatConfig.addOverrides(overrides, packageName, mOverrideValidator); killPackage(packageName); }
Source:
public void set_project_homepage() { OrganizationDto organization = db.organizations().insert(); ComponentDto project = new ComponentDbTester(db).insertComponent(ComponentTesting.newPrivateProjectDto(organization)); UserDto user = db.users().insertUser(); session.logIn(user); ws.newRequest() .setMethod("POST") .setParam(PARAM_TYPE, PROJECT.toString()) .setParam(PARAM_VALUE, project.getKey()) .execute(); UserDto actual = db.getDbClient().userDao().selectByLogin(db.getSession(), user.getLogin()); assertThat(actual).isNotNull(); assertThat(actual.getHomepageType()).isEqualTo(PROJECT.toString()); assertThat(actual.getHomepageValue()).isEqualTo(project.uuid()); }

Target:
public void set_project_homepage() { OrganizationDto organization = db.organizations().insert(); ComponentDto project = new ComponentDbTester(db).insertComponent(newPrivateProjectDto(organization)); UserDto user = db.users().insertUser(); userSession.logIn(user); ws.newRequest() .setMethod("POST") .setParam(PARAM_TYPE, PROJECT.toString()) .setParam(PARAM_PARAMETER, project.getKey()) .execute(); UserDto actual = db.getDbClient().userDao().selectByLogin(db.getSession(), user.getLogin()); assertThat(actual).isNotNull(); assertThat(actual.getHomepageType()).isEqualTo(PROJECT.toString()); assertThat(actual.getHomepageValue()).isEqualTo(project.uuid()); }