auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void processFiltered(File file, FileText fileText) { final File dir = fileText.getFile().getParentFile(); final boolean isDirChecked = !directoriesChecked.add(dir); if (!isDirChecked) { final File packageInfo = new File(dir, "package-info.java"); final File packageHtml = new File(dir, "package.html"); if (packageInfo.exists()) { if (packageHtml.exists()) { log(0, MSG_LEGACY_PACKAGE_HTML); } } else if (!allowLegacy || !packageHtml.exists()) { log(0, MSG_PACKAGE_INFO); } } }

Target:
protected void processFiltered(File file, FileText fileText) throws CheckstyleException { final File dir; try { dir = file.getCanonicalFile().getParentFile(); } catch (IOException ex) { throw new CheckstyleException( "Exception while getting canonical path to file " + file.getPath(), ex); } final boolean isDirChecked = !directoriesChecked.add(dir); if (!isDirChecked) { final File packageInfo = new File(dir, "package-info.java"); final File packageHtml = new File(dir, "package.html"); if (packageInfo.exists()) { if (packageHtml.exists()) { log(0, MSG_LEGACY_PACKAGE_HTML); } } else if (!allowLegacy || !packageHtml.exists()) { log(0, MSG_PACKAGE_INFO); } } }
Source:
public static synchronized NotebookAuthorization init(ZeppelinConfiguration config) { if (instance == null) { instance = new NotebookAuthorization(); conf = config; filePath = conf.getNotebookAuthorizationPath(); GsonBuilder builder = new GsonBuilder(); builder.setPrettyPrinting(); gson = builder.create(); try { loadFromFile(); } catch (IOException e) { LOG.error("Error loading NotebookAuthorization", e); } } return instance; }

Target:
public static NotebookAuthorization init(ZeppelinConfiguration config) { if (instance == null) { instance = new NotebookAuthorization(); conf = config; filePath = conf.getNotebookAuthorizationPath(); GsonBuilder builder = new GsonBuilder(); builder.setPrettyPrinting(); gson = builder.create(); try { loadFromFile(); } catch (IOException e) { LOG.error("Error loading NotebookAuthorization", e); } } return instance; }
Source:
public IBuildServer getServer() { if (parent != null) { return parent.getServer(); } if (server != null && ((EObject) server).eIsProxy()) { InternalEObject oldServer = (InternalEObject) server; server = (IBuildServer) eResolveProxy(oldServer); if (server != oldServer) { if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.RESOLVE, BuildPackage.BUILD_PLAN__SERVER, oldServer, server)); } } } return server; }

Target:
public IBuildServer getServer() { if (server != null && ((EObject) server).eIsProxy()) { InternalEObject oldServer = (InternalEObject) server; server = (IBuildServer) eResolveProxy(oldServer); if (server != oldServer) { if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.RESOLVE, BuildPackage.BUILD_PLAN__SERVER, oldServer, server)); } } } return server; }
Source:
public ElasticTimeOutStrategy(String timeoutPercentage, String timeoutMinutesElasticDefault, String numberOfBuilds) { this.timeoutPercentage = timeoutPercentage; this.timeoutMinutesElasticDefault = timeoutMinutesElasticDefault; this.numberOfBuilds = numberOfBuilds; }

Target:
public ElasticTimeOutStrategy(String timeoutPercentage, String timeoutMinutesElasticDefault, String numberOfBuilds) { this(timeoutPercentage, timeoutMinutesElasticDefault, numberOfBuilds, false); }
Source:
public void test_execute_and_closeListener () { AtomicBoolean hasClosed = new AtomicBoolean(false); browser.setText("You should not see this page, it should have been closed by javascript"); browser.addCloseWindowListener(e -> { hasClosed.set(true); }); browser.execute("window.close()"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (hasClosed.get()) { disposedIntentionally = true; return; } } System.out.println("not passed."); fail("Either browser.execute() did not work (if you still see the html page) or closeListener Was not triggered if " + "browser looks disposed, but test still fails."); }

Target:
public void test_execute_and_closeListener () { AtomicBoolean hasClosed = new AtomicBoolean(false); browser.setText("You should not see this page, it should have been closed by javascript"); browser.addCloseWindowListener(e -> { hasClosed.set(true); }); browser.execute("window.close()"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (hasClosed.get()) { disposedIntentionally = true; return; } } fail("Either browser.execute() did not work (if you still see the html page) or closeListener Was not triggered if " + "browser looks disposed, but test still fails."); }
Source:
public String getIpv4DefaultGateway() { String dest = "0.0.0.0/0"; return getNextHop(dest); }

Target:
public String getIpv4DefaultGateway() { return getNextHop(IPV4_DEFAULT_DEST); }
Source:
private void parse8(int nameStart, int valueStart, int valueEnd) { if (header.regionMatches(true, nameStart, CookieHeaderNames.HTTPONLY, 0, 8)) { httpOnly = true; } else if (header.regionMatches(true, nameStart, CookieHeaderNames.SAMESITE, 0, 8)) { String sameSiteValue = computeValue(valueStart, valueEnd); try { sameSite = SameSite.of(sameSiteValue); } catch (IllegalArgumentException e) { if (logger.isDebugEnabled()) { logger.debug("Skipping SameSite attribute because value '{}' is invalid", sameSiteValue); } } } }

Target:
private void parse8(int nameStart, int valueStart, int valueEnd) { if (header.regionMatches(true, nameStart, CookieHeaderNames.HTTPONLY, 0, 8)) { httpOnly = true; } else if (header.regionMatches(true, nameStart, CookieHeaderNames.SAMESITE, 0, 8)) { sameSite = SameSite.of(computeValue(valueStart, valueEnd)); } }
Source:
public CommandResult<V> allow(final C context, final Command<C, V> command) { if (null != getDelegate()) { final CommandResult<V> r = getDelegate().allow(context, command); postAllow(context, command, r); return r; } return null; }

Target:
public CommandResult<V> allow(final C context, final Command<C, V> command) { if (null != getDelegate()) { preAllow(context, command); final CommandResult<V> result = getDelegate().allow(context, command); postAllow(context, command, result); return result; } return null; }
Source:
ElasticsearchTableDescriptionSupplier(ElasticsearchConnectorConfig config, JsonCodec<ElasticsearchTableDescription> codec) { this.codec = requireNonNull(codec, "codec is null"); this.config = requireNonNull(config, "config is null"); }

Target:
ElasticsearchTableDescriptionSupplier(ElasticsearchConnectorConfig config, JsonCodec<ElasticsearchTableDescription> codec) { this.config = requireNonNull(config, "config is null"); this.codec = requireNonNull(codec, "codec is null"); }
Source:
public void createReportDirectory() { File dir = new File(directory); if (dir.exists() && !dir.isDirectory()) { throw new IllegalArgumentException(dir.getAbsolutePath() + " is not a directory"); } else if (!dir.exists()) { dir.mkdirs(); } }

Target:
public void createReportDirectory() { File dir = new File(directory); dir.mkdirs(); }
Source:
public void updateTiles(IAECluster cl, World w, WorldCoord min, WorldCoord max) { byte num = 0; byte ringNum = 0; QuantumCluster c = (QuantumCluster) cl; for (int x = min.x; x <= max.x; x++) { for (int y = min.y; y <= max.y; y++) { for (int z = min.z; z <= max.z; z++) { TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( x, y, z ); byte flags = 0; num++; if ( num == 5 ) { flags = (num); c.setCenter( te ); } else { if ( num == 1 || num == 3 || num == 7 || num == 9 ) flags = (byte) (tqb.corner | num); else flags = (num); c.Ring[ringNum++] = te; } te.updateStatus( c, flags, true ); } } } }

Target:
public void updateTiles(IAECluster cl, World w, WorldCoord min, WorldCoord max) { byte num = 0; byte ringNum = 0; QuantumCluster c = (QuantumCluster) cl; for (int x = min.x; x <= max.x; x++) { for (int y = min.y; y <= max.y; y++) { for (int z = min.z; z <= max.z; z++) { TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( x, y, z ); byte flags = 0; num++; if ( num == 5 ) { flags = num; c.setCenter( te ); } else { if ( num == 1 || num == 3 || num == 7 || num == 9 ) flags = (byte) (tqb.corner | num); else flags = num; c.Ring[ringNum++] = te; } te.updateStatus( c, flags, true ); } } } }
Source:
public boolean isWakeupEvent(ITmfEvent event) { String eventName = event.getName(); ITmfTrace trace = event.getTrace(); IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(event.getTrace()); String wakeupEventName = NonNullUtils.nullToEmptyString(fWakeupEventMap.get(trace)); if (eventLayout instanceof LttngEventLayout) { LttngEventLayout layoutDefault = (LttngEventLayout) eventLayout; if (wakeupEventName.equals(layoutDefault.eventSchedProcessTTWU())) { return eventName.equals(layoutDefault.eventSchedProcessTTWU()); } } if (eventLayout instanceof Lttng28EventLayout) { Lttng28EventLayout layout28 = (Lttng28EventLayout) eventLayout; if (wakeupEventName.equals(layout28.eventSchedProcessWaking())) { return (eventName.equals(layout28.eventSchedProcessWaking()) || eventName.equals(layout28.eventSchedProcessWakeupNew())); } } return false; }

Target:
public boolean isWakeupEvent(ITmfEvent event) { String eventName = event.getName(); ITmfTrace trace = event.getTrace(); IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(event.getTrace()); String wakeupEventName = NonNullUtils.nullToEmptyString(fWakeupEventMap.get(trace)); if (eventLayout instanceof LttngEventLayout) { LttngEventLayout layoutDefault = (LttngEventLayout) eventLayout; if (wakeupEventName.equals(layoutDefault.eventSchedProcessTTWU())) { return eventName.equals(layoutDefault.eventSchedProcessTTWU()); } } if (eventLayout instanceof Lttng28EventLayout) { Lttng28EventLayout layout28 = (Lttng28EventLayout) eventLayout; if (wakeupEventName.equals(layout28.eventSchedProcessWaking())) { return (eventName.equals(layout28.eventSchedProcessWaking()) || eventName.equals(layout28.eventSchedProcessWakeupNew())); } } if (eventLayout instanceof LttngEventLayout) { LttngEventLayout layoutDefault = (LttngEventLayout) eventLayout; if (wakeupEventName.equals(layoutDefault.eventSchedProcessWakeup())) { return (eventName.equals(layoutDefault.eventSchedProcessWakeup()) || eventName.equals(layoutDefault.eventSchedProcessWakeupNew())); } } return false; }
Source:
public static Double digestToTruncatedMean(QuantileDigest digest, List<Long> bounds, QuantileDigest.MiddleFunction middleFunction) { if (bounds.get(0).equals(bounds.get(1))) { return null; } else { return digest.getHistogram(bounds, middleFunction).get(1).getMean(); } }

Target:
public static Double digestToTruncatedMean(QuantileDigest digest, List<Long> bounds, QuantileDigest.MiddleFunction middleFunction) { if (bounds.get(0).equals(bounds.get(1))) { return null; } return digest.getHistogram(bounds, middleFunction).get(1).getMean(); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log_OC.d(TAG, "onCreateView"); View rootView = inflater.inflate(R.layout.sso_dialog, container, false); WebView ssoWebView = (WebView) rootView.findViewById(R.id.sso_webview); mWebViewClient.setTargetUrl(mTargetUrl); ssoWebView.setWebViewClient(mWebViewClient); if (savedInstanceState == null) { Log_OC.d(TAG, " initWebView start"); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.setAcceptCookie(true); cookieManager.removeAllCookie(); ssoWebView.loadUrl(mInitialUrl); } else { Log_OC.d(TAG, " restoreWebView start"); WebBackForwardList history = ssoWebView.restoreState(savedInstanceState.getBundle(KEY_WEBVIEW_STATE)); if (history == null) { Log_OC.e(TAG, "Error restoring WebView state ; back to starting URL"); ssoWebView.loadUrl(mInitialUrl); } } WebSettings webSettings = ssoWebView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setBuiltInZoomControls(true); webSettings.setLoadWithOverviewMode(false); webSettings.setSavePassword(false); webSettings.setUserAgentString(WebdavClient.USER_AGENT); webSettings.setSaveFormData(false); return rootView; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log_OC.d(TAG, "onCreateView"); View rootView = inflater.inflate(R.layout.sso_dialog, container, false); mSsoWebView = (WebView) rootView.findViewById(R.id.sso_webview); mWebViewClient.setTargetUrl(mTargetUrl); mSsoWebView.setWebViewClient(mWebViewClient); if (savedInstanceState == null) { Log_OC.d(TAG, " initWebView start"); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.setAcceptCookie(true); cookieManager.removeAllCookie(); mSsoWebView.loadUrl(mInitialUrl); } else { Log_OC.d(TAG, " restoreWebView start"); WebBackForwardList history = mSsoWebView.restoreState(savedInstanceState.getBundle(KEY_WEBVIEW_STATE)); if (history == null) { Log_OC.e(TAG, "Error restoring WebView state ; back to starting URL"); mSsoWebView.loadUrl(mInitialUrl); } } WebSettings webSettings = mSsoWebView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setBuiltInZoomControls(true); webSettings.setLoadWithOverviewMode(false); webSettings.setSavePassword(false); webSettings.setUserAgentString(WebdavClient.USER_AGENT); webSettings.setSaveFormData(false); return rootView; }
Source:
public void deleteEntry(Name dn) throws InternalErrorException { List<Name> subentries = ldapTemplate.search(query() .base(dn) .where("objectclass").like("*"), getNameMapper()); for(Name entrydn : subentries) { ldapTemplate.unbind(entrydn); } super.deleteEntry(dn); }

Target:
public void deleteEntry(Name dn) throws InternalErrorException { List<Name> subentries = ldapTemplate.search(query() .base(dn) .where("objectclass").not().is(PerunAttribute.PerunAttributeNames.objectClassPerunVO), getNameMapper()); for(Name entrydn : subentries) { ldapTemplate.unbind(entrydn); } super.deleteEntry(dn); }
Source:
private void checkRegistryIsAvailable() throws IOException { if (!probeUrl("http://" + registry) && !probeUrl("https://" + registry)) { LOG.warn("Docker registry " + registry + " is not available, " + "which means that you won't be able to save snapshots of your workspaces." + "\nHow to configure registry?" + "\n\tLocal registry -> <LINK_0>" + "\n\tRemote registry -> set up 'docker.registry.auth.*' properties"); } }

Target:
private void checkRegistryIsAvailable() throws IOException { LOG.info("Probing registry '{}'", registryUrl); final HttpURLConnection conn = (HttpURLConnection) new URL(registryUrl).openConnection(); conn.setConnectTimeout(30 * 1000); try { final int responseCode = conn.getResponseCode(); LOG.info("Probe of registry '{}' succeed with HTTP response code '{}'", registryUrl, responseCode); } catch (IOException ioEx) { LOG.warn("Docker registry " + registryUrl + " is not available, " + "which means that you won't be able to save snapshots of your workspaces." + "\nHow to configure registry?" + "\n\tLocal registry -> <LINK_0>" + "\n\tRemote registry -> set up 'docker.registry.auth.*' properties"); } finally { conn.disconnect(); } }
Source:
public void test1DelayedAction() { ArbritaryDelayActionComponent a1 = new ArbritaryDelayActionComponent(); a1.value = 3; vals = new ArrayList<Integer>(Arrays.asList(3)); long currentTime = time.getGameTimeInMs(); delayedActionSystem.addDelayedAction(createFakeEntityWith(a1), "Blah Blah", ((currentTime + 1000) - currentTime)); nextFakeEntityId++; }

Target:
public void test1DelayedAction() { ArbritaryDelayActionComponent a1 = new ArbritaryDelayActionComponent(); a1.value = 3; vals = new ArrayList<Integer>(Arrays.asList(3)); delayedActionSystem.addDelayedAction(createFakeEntityWith(a1), "Blah Blah", ((time.getGameTimeInMs() + 1000) - time.getGameTimeInMs())); nextFakeEntityId++; }
Source:
public void bindStatement() throws StandardException { int columnCount; td = getTableDescriptor(tableName); verifyAndGetUniqueNames(); columnCount = involvedColumnNames.length; boundColumnIDs = new int[ columnCount ]; for (int i = 0; i < columnCount; i++) { ColumnDescriptor columnDescriptor; columnDescriptor = td.getColumnDescriptor(involvedColumnNames[i]); if (columnDescriptor == null) { throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND_IN_TABLE, involvedColumnNames[i], tableName); } boundColumnIDs[ i ] = columnDescriptor.getPosition(); uniqueWithDuplicateNulls = (! uniqueWithDuplicateNulls && (unique && ! columnDescriptor.hasNonNullDefault())); if ( ! columnDescriptor.getType().getTypeId().orderable(getClassFactory())) { throw StandardException.newException(SQLState.LANG_COLUMN_NOT_ORDERABLE_DURING_EXECUTION, columnDescriptor.getType().getTypeId().getSQLTypeName()); } } if (onExpression) { bindIndexExpressions(); generateExecutableIndexExpression(); } getCompilerContext().createDependency(td); }

Target:
public void bindStatement() throws StandardException { int columnCount; td = getTableDescriptor(tableName); verifyAndGetUniqueNames(); columnCount = involvedColumnNames.length; boundColumnIDs = new int[ columnCount ]; for (int i = 0; i < columnCount; i++) { ColumnDescriptor columnDescriptor; columnDescriptor = td.getColumnDescriptor(involvedColumnNames[i]); if (columnDescriptor == null) { throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND_IN_TABLE, involvedColumnNames[i], tableName); } boundColumnIDs[ i ] = columnDescriptor.getPosition(); uniqueWithDuplicateNulls = (! uniqueWithDuplicateNulls && (unique && ! columnDescriptor.hasNonNullDefault())); if ( ! columnDescriptor.getType().getTypeId().orderable(getClassFactory())) { throw StandardException.newException(SQLState.LANG_COLUMN_NOT_ORDERABLE_DURING_EXECUTION, columnDescriptor.getType().getTypeId().getSQLTypeName()); } } if (onExpression) { bindIndexExpressions(); } getCompilerContext().createDependency(td); }
Source:
protected AbstractTreeIterator mergeBase() throws IOException { if (baseTree != null) return openTree(baseTree); RevCommit baseCommit = getBaseCommit(sourceCommits[0], sourceCommits[1]); if (baseCommit == null) { baseCommitId = null; return new EmptyTreeIterator(); } else { baseCommitId = baseCommit.toObjectId(); return openTree(baseCommit.getTree()); } }

Target:
protected AbstractTreeIterator mergeBase() throws IOException { if (baseTree != null) return openTree(baseTree); RevCommit baseCommit = (baseCommitId != null) ? walk .parseCommit(baseCommitId) : getBaseCommit(sourceCommits[0], sourceCommits[1]); if (baseCommit == null) { baseCommitId = null; return new EmptyTreeIterator(); } else { baseCommitId = baseCommit.toObjectId(); return openTree(baseCommit.getTree()); } }
Source:
public boolean onOptionsItemSelected(final MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; } return false; }

Target:
public boolean onOptionsItemSelected(final MenuItem item) { if (item.getItemId() == android.R.id.home) { finish(); return true; } return false; }
Source:
public void setMaxDuplicateSetSize(final long maxDuplicateSetSize) { if (maxDuplicateSetSize < 1) this.maxDuplicateSetSize = Long.MAX_VALUE; this.maxDuplicateSetSize = maxDuplicateSetSize; }

Target:
public void setMaxDuplicateSetSize(final long maxDuplicateSetSize) { if (maxDuplicateSetSize < 1) { this.maxDuplicateSetSize = Long.MAX_VALUE; } this.maxDuplicateSetSize = maxDuplicateSetSize; }
Source:
public void testAllDomainsExistAndActiveOneInactive() { domain1.setStatus(StorageDomainStatus.Active); domain2.setStatus(StorageDomainStatus.InActive); ValidationResult result = validator.allDomainsExistAndActive(); assertFalse("Both domains should not be active", result.isValid()); assertEquals("Wrong validation error", VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL, result.getMessage()); }

Target:
public void testAllDomainsExistAndActiveOneInactive() { domain1.setStatus(StorageDomainStatus.Active); domain2.setStatus(StorageDomainStatus.InActive); ValidationResult result = validator.allDomainsExistAndActive(); assertFalse("One domain should not be active", result.isValid()); assertEquals("Wrong validation error", VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL, result.getMessage()); }
Source:
public void setPolicy(String path, AccessControlPolicy policy) throws PathNotFoundException, AccessControlException, AccessDeniedException, LockException, VersionException, RepositoryException { if (session.isReadOnly()) { throw new AccessDeniedException("Session is ready only"); } if (!hasPrivileges(path, new Privilege[]{privileges.forName(Privilege.JCR_MODIFY_ACCESS_CONTROL)})) { throw new AccessDeniedException(); } if (!(policy instanceof AccessControlList)) { throw new AccessControlException(""); } JcrAccessControlList acl = (JcrAccessControlList) policy; AbstractJcrNode node = (AbstractJcrNode) session.getNode(path, true); node.addMixin(NT_ACCESS_CONTROLLABLE, false); AbstractJcrNode aclNode = (AbstractJcrNode) (node.hasNode(ACCESS_LIST_NODE) ? node.getNode(ACCESS_LIST_NODE) : node.addAclNode(ACCESS_LIST_NODE, NT_ACCESS_LIST_NODE)); for (AccessControlEntry ace : acl.getAccessControlEntries()) { assert (ace.getPrincipal() != null); String name = ace.getPrincipal().getName(); AbstractJcrNode entryNode = aclNode.hasNode(name) ? aclNode.getNode(name) : aclNode.addAclNode(name, NT_ACCESS_LIST_ENTRY_NODE); entryNode.setPropertyInAccessControlScope(PRINCIPAL_NAME, ace.getPrincipal().getName()); entryNode.setPropertyInAccessControlScope(PRIVILEGES, privileges(ace.getPrivileges())); } NodeIterator it = aclNode.getNodes(); while (it.hasNext()) { Node entryNode = it.nextNode(); String name = entryNode.getProperty(PRINCIPAL_NAME).getString(); if (!acl.hasEntry(name)) { entryNode.remove(); } } }

Target:
public void setPolicy(String path, AccessControlPolicy policy) throws PathNotFoundException, AccessControlException, AccessDeniedException, LockException, VersionException, RepositoryException { if (session.isReadOnly()) { throw new AccessDeniedException(JcrI18n.permissionDenied.text(path, "read AC content")); } if (!hasPrivileges(path, new Privilege[]{privileges.forName(Privilege.JCR_MODIFY_ACCESS_CONTROL)})) { throw new AccessDeniedException(); } if (!(policy instanceof AccessControlList)) { throw new AccessControlException(""); } JcrAccessControlList acl = (JcrAccessControlList) policy; AbstractJcrNode node = session.getNode(path, true); node.addMixin(NT_ACCESS_CONTROLLABLE, false); AbstractJcrNode aclNode = (AbstractJcrNode) (node.hasNode(ACCESS_LIST_NODE) ? node.getNode(ACCESS_LIST_NODE) : node.addAclNode(ACCESS_LIST_NODE, NT_ACCESS_LIST_NODE)); for (AccessControlEntry ace : acl.getAccessControlEntries()) { assert (ace.getPrincipal() != null); String name = ace.getPrincipal().getName(); AbstractJcrNode entryNode = aclNode.hasNode(name) ? aclNode.getNode(name) : aclNode.addAclNode(name, NT_ACCESS_LIST_ENTRY_NODE); entryNode.setPropertyInAccessControlScope(PRINCIPAL_NAME, ace.getPrincipal().getName()); entryNode.setPropertyInAccessControlScope(PRIVILEGES, privileges(ace.getPrivileges())); } NodeIterator it = aclNode.getNodes(); while (it.hasNext()) { Node entryNode = it.nextNode(); String name = entryNode.getProperty(PRINCIPAL_NAME).getString(); if (!acl.hasEntry(name)) { entryNode.remove(); } } }
Source:
protected Configuration createConfiguration() { Configuration conf = super.createConfiguration(); boolean scaleCapacityLimitEnabled = conf.getBoolean("fs.s3a.s3guard.ddb.table.scale.capacity.limit", true); if(scaleCapacityLimitEnabled) { LOG.info("Enable the capacity limit : -> {}, -> {}", S3GUARD_DDB_TABLE_CAPACITY_READ_KEY, 1, S3GUARD_DDB_TABLE_CAPACITY_WRITE_KEY,1); conf.set(S3GUARD_DDB_TABLE_CAPACITY_READ_KEY, "1"); conf.set(S3GUARD_DDB_TABLE_CAPACITY_WRITE_KEY, "1"); } if(scaleCapacityLimitEnabled) { assertEquals("The Read Capacity limit should be 1",1,conf.getInt(S3GUARD_DDB_TABLE_CAPACITY_READ_KEY,0)); assertEquals("The Write Capacity limit should be 1",1,conf.getInt(S3GUARD_DDB_TABLE_CAPACITY_WRITE_KEY,0)); } return conf; }

Target:
protected Configuration createConfiguration() { Configuration conf = super.createConfiguration(); conf.setInt(S3GUARD_DDB_TABLE_CAPACITY_READ_KEY, 0); conf.setInt(S3GUARD_DDB_TABLE_CAPACITY_WRITE_KEY, 0); return conf; }
Source:
public void testListFloatingIPPools() throws Exception { for (String zoneId : api.getConfiguredRegions()) { Optional<? extends FloatingIPPoolApi> apiOption = api.getFloatingIPPoolApi(zoneId); if (!apiOption.isPresent()) continue; FloatingIPPoolApi api = apiOption.get(); FluentIterable<? extends FloatingIPPool> response = api.list(); assertTrue(null != response); Set<? extends FloatingIPPool> set = response.toSet(); assertTrue(!set.isEmpty()); } }

Target:
public void testListFloatingIPPools() throws Exception { Optional<? extends FloatingIPPoolApi> apiOption = api.getFloatingIPPoolApi(Iterables.getFirst(regions, null)); if (!apiOption.isPresent()) { return; } FloatingIPPoolApi api = apiOption.get(); FluentIterable<? extends FloatingIPPool> response = api.list(); assertTrue(null != response); Set<? extends FloatingIPPool> set = response.toSet(); assertTrue(!set.isEmpty()); }
Source:
private AddressProvider createAddressProvider(ClientConfig config) { boolean discoveryEnabled = new HazelcastProperties(config.getProperties()) .getBoolean(ClientProperty.DISCOVERY_SPI_ENABLED); AwsConfig awsConfig = config.getNetworkConfig().getAwsConfig(); List<String> userConfiguredAddresses = config.getNetworkConfig().getAddresses(); boolean isAtLeastAProviderConfigured = discoveryEnabled || (awsConfig != null && awsConfig.isEnabled()) || !userConfiguredAddresses.isEmpty(); if (isAtLeastAProviderConfigured) { return null; } return new AddressProvider() { @Override public Addresses loadAddresses() { Addresses possibleAddresses = new Addresses(); for (Address address : getKnownAddresses()) { Addresses addresses = AddressHelper.getPossibleSocketAddresses(address.getPort(), address.getHost(), 1); possibleAddresses.addAll(addresses); } return possibleAddresses; } @Override public Address translate(Address address) { return address; } }; }

Target:
private AddressProvider createAddressProvider(ClientConfig config) { boolean discoveryEnabled = new HazelcastProperties(config.getProperties()) .getBoolean(ClientProperty.DISCOVERY_SPI_ENABLED); List<DiscoveryStrategyConfig> aliasedDiscoveryConfigs = ClientAliasedDiscoveryConfigUtils.createDiscoveryStrategyConfigs(config); List<String> userConfiguredAddresses = config.getNetworkConfig().getAddresses(); boolean isAtLeastAProviderConfigured = discoveryEnabled || !aliasedDiscoveryConfigs.isEmpty() || !userConfiguredAddresses.isEmpty(); if (isAtLeastAProviderConfigured) { return null; } return new AddressProvider() { @Override public Addresses loadAddresses() { Addresses possibleAddresses = new Addresses(); for (Address address : getKnownAddresses()) { Addresses addresses = AddressHelper.getPossibleSocketAddresses(address.getPort(), address.getHost(), 1); possibleAddresses.addAll(addresses); } return possibleAddresses; } @Override public Address translate(Address address) { return address; } }; }
Source:
public void email(final String email) throws IOException { final String pattern = "[a-z_\\.@\\-A-Z0-9]"; if (!email.matches(String.format("%s+", pattern)) && !email.matches(String.format("%s*!%s+", pattern, pattern))) { throw new Alias.InvalidEmailException(email); } this.item.put( new AttributeUpdates().with(DyAliases.ATTR_EMAIL, email) ); Logger.info(this, "@%s changed email to %s", this.name(), email); }

Target:
public void email(final String email) throws IOException { if (!MAIL.matcher(email).matches()) { throw new Alias.InvalidEmailException(email); } this.item.put( new AttributeUpdates().with(DyAliases.ATTR_EMAIL, email) ); Logger.info(this, "@%s changed email to %s", this.name(), email); }
Source:
public void getRefTest() throws IOException, ParseException { JSONObject jsonObject = MapboxTestUtils.parseTestStyle("getRefTest.json"); MBLayer layer = MBLayer.create(jsonObject); System.out.print("st"); }

Target:
public void getRefTest() throws IOException, ParseException { JSONObject jsonObject = MapboxTestUtils.parseTestStyle("getRefTest.json"); MBStyle mbStyle = new MBStyle(jsonObject); MBLayer layer = mbStyle.layers().get(2); assertEquals("water", layer.getRef()); assertEquals("water", mbStyle.layer(layer.getRef()).getSourceLayer()); assertEquals("mapbox", mbStyle.layer(layer.getRef()).getSource()); assertEquals(11, mbStyle.layer(layer.getRef()).getMinZoom()); assertEquals(22, mbStyle.layer(layer.getRef()).getMaxZoom()); assertEquals("round", mbStyle.layer(layer.getRef()).getLayout().get("line-join")); }
Source:
private void undeployLeftoverJobs() { try { final Map<JobId, Job> jobs = heliosClient.jobs().get(); if (jobs.size() > 0) { log.info("There are jobs in helios-solo left over by TemporaryJobs. " + "Undeploying and deleting them now. Jobs: {}", jobs.keySet()); } for (final JobId jobId : jobs.keySet()) { final JobStatus jobStatus = heliosClient.jobStatus(jobId).get(); final Map<String, TaskStatus> statuses = jobStatus.getTaskStatuses(); for (Map.Entry<String, TaskStatus> status : statuses.entrySet()) { final String host = status.getKey(); if (status.getValue().getGoal().equals(Goal.START)) { log.info("Job is still set to START on host {}. Undeploying it now.", jobId, host); final JobUndeployResponse undeployResponse = heliosClient.undeploy(jobId, host).get(); log.info("Undeploy response for job is {}.", jobId, undeployResponse.getStatus()); log.info("Waiting for job to actually be undeployed...", jobId); awaitJobUndeployed(heliosClient, host, jobId, 400, TimeUnit.SECONDS); log.info("Job successfully undeployed.", jobId); } } } } catch (Exception e) { log.warn("Exception occurred when trying to clean up leftover temp jobs.", e); } }

Target:
protected void undeployLeftoverJobs() { try { final Map<JobId, Job> jobs = heliosClient.jobs().get(); if (jobs.size() > 0) { log.info("There are leftover jobs deployed by helios-solo. " + "Undeploying and deleting them now. Jobs: {}", jobs.keySet()); } for (final JobId jobId : jobs.keySet()) { final JobStatus jobStatus = heliosClient.jobStatus(jobId).get(); final Map<String, TaskStatus> statuses = jobStatus.getTaskStatuses(); for (Map.Entry<String, TaskStatus> status : statuses.entrySet()) { final String host = status.getKey(); final Goal goal = status.getValue().getGoal(); if (goal != Goal.UNDEPLOY) { log.info("Job is still set to on host {}. Undeploying it now.", jobId, goal, host); final JobUndeployResponse undeployResponse = heliosClient.undeploy(jobId, host).get(); log.info("Undeploy response for job is {}.", jobId, undeployResponse.getStatus()); if (undeployResponse.getStatus() != JobUndeployResponse.Status.OK) { log.warn("Undeploy response for job was not OK. Not waiting for job to " + "actually be undeployed.", jobId); } } log.info("Waiting for job to actually be undeployed...", jobId); awaitJobUndeployed(heliosClient, host, jobId, jobUndeployWaitSeconds, TimeUnit.SECONDS); log.info("Job successfully undeployed.", jobId); } } } catch (Exception e) { log.warn("Exception occurred when trying to clean up leftover jobs.", e); } }
Source:
public BlobHolder convert(BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionException { List<Blob> blobs = new ArrayList<>(); blobs.add(new StringBlob("blob1","text/plain",AbstractBlob.UTF_8,"file1")); blobs.add(new StringBlob("blob2","text/plain",AbstractBlob.UTF_8,"file2")); return new SimpleCachableBlobHolder(blobs); }

Target:
public BlobHolder convert(BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionException { List<Blob> blobs = new ArrayList<>(); blobs.add(new StringBlob("blob1", TEXT_PLAIN, UTF_8, "file1")); blobs.add(new StringBlob("blob2", TEXT_PLAIN, UTF_8, "file2")); return new SimpleCachableBlobHolder(blobs); }
Source:
private List<SubscriptionEventTypeStats> createSubscriptionStat(final Subscription subscription, final boolean includeDistance) throws InconsistentStateException, ServiceTemporarilyUnavailableException { final List<EventType> eventTypes = getEventTypesForSubscription(subscription); final List<PartitionEndStatistics> topicPartitions = loadPartitionEndStatistics(eventTypes); final ZkSubscriptionClient subscriptionClient = createZkSubscriptionClient(subscription); final Optional<ZkSubscriptionNode> zkSubscriptionNode = subscriptionClient.getZkSubscriptionNode(); return loadStats(eventTypes, zkSubscriptionNode, subscriptionClient, topicPartitions, includeDistance); }

Target:
private List<SubscriptionEventTypeStats> createSubscriptionStat(final Subscription subscription, final boolean includeDistance) throws InconsistentStateException, ServiceTemporarilyUnavailableException { final List<EventType> eventTypes = getEventTypesForSubscription(subscription); final ZkSubscriptionClient subscriptionClient = createZkSubscriptionClient(subscription); final Optional<ZkSubscriptionNode> zkSubscriptionNode = subscriptionClient.getZkSubscriptionNode(); if (includeDistance) { return loadStats(eventTypes, zkSubscriptionNode, subscriptionClient); } else { return loadLightStats(eventTypes, zkSubscriptionNode); } }
Source:
protected void buildVmCD() { XmlRpcStruct struct; if (vm.getVmPayload() != null && vm.getVmPayload().getType() == VmDeviceType.CDROM) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName(), "", 0, (vm.getVmPayload() == null) ? null : vm.getVmPayload().getSpecParams(), true, true, true, ""); struct = new XmlRpcStruct(); addCdDetails(vmDevice, struct); addDevice(struct, vmDevice, ""); } else if (vm.isRunOnce() && !StringUtils.isEmpty(vm.getCdPath())) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName(), "", 0, (vm.getVmPayload() == null) ? null : vm.getVmPayload().getSpecParams(), true, true, true, ""); struct = new XmlRpcStruct(); addCdDetails(vmDevice, struct); addDevice(struct, vmDevice, vm.getCdPath()); } else { List<VmDevice> vmDevices = DbFacade.getInstance() .getVmDeviceDAO() .getVmDeviceByVmIdTypeAndDevice(vm.getId(), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName()); for (VmDevice vmDevice : vmDevices) { if (!vmDevice.getIsManaged()) { continue; } if (!VmPayload.isPayload(vmDevice.getSpecParams()) && vmDevices.size() > 1) { continue; } struct = new XmlRpcStruct(); String cdPath = vm.getCdPath(); addCdDetails(vmDevice, struct); addAddress(vmDevice, struct); addDevice(struct, vmDevice, cdPath == null ? "" : cdPath); break; } } }

Target:
protected void buildVmCD() { XmlRpcStruct struct; if (vm.getVmPayload() != null && vm.getVmPayload().getType() == VmDeviceType.CDROM) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName(), "", 0, (vm.getVmPayload() == null) ? null : vm.getVmPayload().getSpecParams(), true, true, true, ""); struct = new XmlRpcStruct(); addCdDetails(vmDevice, struct); addDevice(struct, vmDevice, ""); } else if (vm.isRunOnce() && !StringUtils.isEmpty(vm.getCdPath())) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName(), "", 0, (vm.getVmPayload() == null) ? null : vm.getVmPayload().getSpecParams(), true, true, true, ""); struct = new XmlRpcStruct(); addCdDetails(vmDevice, struct); addDevice(struct, vmDevice, vm.getCdPath()); } else { List<VmDevice> vmDevices = DbFacade.getInstance() .getVmDeviceDao() .getVmDeviceByVmIdTypeAndDevice(vm.getId(), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName()); for (VmDevice vmDevice : vmDevices) { if (!vmDevice.getIsManaged()) { continue; } if (!VmPayload.isPayload(vmDevice.getSpecParams()) && vmDevices.size() > 1) { continue; } struct = new XmlRpcStruct(); String cdPath = vm.getCdPath(); addCdDetails(vmDevice, struct); addAddress(vmDevice, struct); addDevice(struct, vmDevice, cdPath == null ? "" : cdPath); break; } } }
Source:
public String toString() { return MessageFormat.format(Messages.ConfigurationImpl_toString, nodeConfiguration); }

Target:
public String toString() { return MessageFormat.format(Messages.ConfigurationImpl_toString, nodeConfiguration, edgeConfiguration); }
Source:
public static DataSourceCredentials map(com.azure.search.documents.implementation.models.DataSourceCredentials obj) { if (obj == null) { return null; } DataSourceCredentials dataSourceCredentials = new DataSourceCredentials(); String _connectionString = obj.getConnectionString(); dataSourceCredentials.setConnectionString(_connectionString); return dataSourceCredentials; }

Target:
public static DataSourceCredentials map(com.azure.search.documents.implementation.models.DataSourceCredentials obj) { if (obj == null) { return null; } DataSourceCredentials dataSourceCredentials = new DataSourceCredentials(); String connectionString = obj.getConnectionString(); dataSourceCredentials.setConnectionString(connectionString); return dataSourceCredentials; }
Source:
public void testInvalidBinaryDecodeFromHex1() { assertEvaluate("decode('\\xff', 'hex')", null); }

Target:
public void testInvalidBinaryDecodeFromHex1() { expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Illegal hexadecimal character \\ at index 0"); assertEvaluate("decode('\\xff', 'hex')", null); }
Source:
public Object convert(Class destClass, Object srcObject) { Class<?> srcObjectClass = srcObject.getClass(); LocalDateTime result; if (Date.class.isAssignableFrom(srcObjectClass)) { Instant instant = ((Date) srcObject).toInstant(); result = LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); } else if (Instant.class.isAssignableFrom(srcObjectClass)) { result = LocalDateTime.ofInstant(((Instant) srcObject), ZoneId.systemDefault()); } else if (Long.class.isAssignableFrom(srcObjectClass)) { Instant instant = Instant.ofEpochMilli((Long) srcObject); result = LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); } else { return super.convert(destClass, srcObject); } if (LocalTime.class.isAssignableFrom(destClass)) { return result.toLocalTime(); } else if (LocalDate.class.isAssignableFrom(destClass)) { return result.toLocalDate(); } return result; }

Target:
public Object convert(Class destClass, Object srcObject) { LocalDateTime localDateTime = convertToLocalDateTime(srcObject); if (localDateTime != null) { if (LocalTime.class.isAssignableFrom(destClass)) { return localDateTime.toLocalTime(); } else if (LocalDate.class.isAssignableFrom(destClass)) { return localDateTime.toLocalDate(); } return localDateTime; } return super.convert(destClass, srcObject); }
Source:
public List<Lifeline> getAllLifelines() { List<Lifeline> allLifelines = null; if (useCache) { if (allLifelinesCache != null) { allLifelines = Lists.newArrayList(allLifelinesCache); } } if (allOrderedLifelinesCache == null) { if (allLifelines == null) { allLifelines = Lists.newArrayList(); Collection<InstanceRole> allInstanceRoles = getAllInstanceRoles(); Function<ISequenceNode, Lifeline> lifelineFunction = new Function<ISequenceNode, Lifeline>() { public Lifeline apply(ISequenceNode from) { return from.getLifeline().get(); } }; allLifelines = Lists.newArrayList(Iterables.transform(allInstanceRoles, lifelineFunction)); if (useCache) { allLifelinesCache = Lists.newArrayList(allLifelines); } } Collections.sort(allLifelines, RangeHelper.lowerBoundOrdering().onResultOf(ISequenceEvent.VERTICAL_RANGE)); allOrderedLifelinesCache = allLifelines; } return allOrderedLifelinesCache; }

Target:
public List<Lifeline> getAllLifelines() { List<Lifeline> allLifelines = null; if (useCache) { if (allLifelinesCache != null) { allLifelines = Lists.newArrayList(allLifelinesCache); } } if (allOrderedLifelinesCache == null) { if (allLifelines == null) { allLifelines = Lists.newArrayList(); Collection<InstanceRole> allInstanceRoles = getAllInstanceRoles(); Function<ISequenceNode, Lifeline> lifelineFunction = new Function<ISequenceNode, Lifeline>() { public Lifeline apply(ISequenceNode from) { return from.getLifeline().get(); } }; allLifelines = Lists.newArrayList(Iterables.transform(allInstanceRoles, lifelineFunction)); if (useCache) { allLifelinesCache = allLifelines; } } Collections.sort(allLifelines, RangeHelper.lowerBoundOrdering().onResultOf(ISequenceEvent.VERTICAL_RANGE)); allOrderedLifelinesCache = Lists.newArrayList(allLifelines); } return allOrderedLifelinesCache; }
Source:
Set<ExecutableElement> abstractBuildMethods() { return ImmutableSet.copyOf(buildMethods).stream() .filter(MoreElements.hasModifiers(Modifier.ABSTRACT)) .collect(Collectors.toSet()); }

Target:
Set<ExecutableElement> abstractBuildMethods() { return buildMethods.stream() .filter(MoreElements.hasModifiers(Modifier.ABSTRACT)) .collect(Collectors.toSet()); }
Source:
StaticMethodInstanceFactory(Class<T> type, Method method) { super(method); this.type = requireNonNull(type, "type is null"); requireNonNull(method, "method is null"); if (!Modifier.isStatic(method.getModifiers())) { throw new IllegalArgumentException("Method not static " + method); } this.method = method; }

Target:
StaticMethodInstanceFactory(Class<T> type, Method method) { super(method); this.type = requireNonNull(type, "type is null"); requireNonNull(method, "method is null"); if (!isStaticFactoryMethodFor(method, type)) { throw new IllegalArgumentException(format("Given method \"%s\" is not a valid factory method for %s", method, type)); } this.method = method; }
Source:
public static String getCommonJsImportPath( Node requireCall, ModuleLoader.ResolutionMode resolutionMode) { if (resolutionMode == ModuleLoader.ResolutionMode.WEBPACK) { if (requireCall.getSecondChild().isNumber()) { return String.valueOf(Double.valueOf(requireCall.getSecondChild().getDouble()).intValue()); } else if (requireCall.getChildCount() >= 3 && requireCall.getChildAtIndex(2).isNumber()) { return String.valueOf( Double.valueOf(requireCall.getChildAtIndex(2).getDouble()).intValue()); } } return requireCall.getSecondChild().getString(); }

Target:
public static String getCommonJsImportPath( Node requireCall, ModuleLoader.ResolutionMode resolutionMode) { if (resolutionMode == ModuleLoader.ResolutionMode.WEBPACK) { Node pathArgument = requireCall.getChildCount() >= 3 ? requireCall.getChildAtIndex(2) : requireCall.getSecondChild(); if (pathArgument.isNumber()) { return String.valueOf((int) pathArgument.getDouble()); } else { return pathArgument.getString(); } } return requireCall.getSecondChild().getString(); }
Source:
public ValidationResult externalNetworkDetailsUnchanged(Network newNetwork) { return Objects.equals(network.getVlanId(), newNetwork.getVlanId()) && network.getStp() == newNetwork.getStp() && network.isVmNetwork() == newNetwork.isVmNetwork() ? ValidationResult.VALID : new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_NETWORK_DETAILS_CANNOT_BE_EDITED); }

Target:
public ValidationResult externalNetworkDetailsUnchanged(Network newNetwork) { ProviderNetwork providerNetwork = network.getProvidedBy(); ProviderNetwork newProviderNetwork = newNetwork.getProvidedBy(); return Objects.equals(network.getVlanId(), newNetwork.getVlanId()) && network.getStp() == newNetwork.getStp() && network.isVmNetwork() == newNetwork.isVmNetwork() && Objects.equals(providerNetwork.getProviderId(), newProviderNetwork.getProviderId()) && Objects.equals(providerNetwork.getExternalId(), newProviderNetwork.getExternalId()) ? ValidationResult.VALID : new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_NETWORK_DETAILS_CANNOT_BE_EDITED); }
Source:
protected void cleanup(Context context) throws IOException, InterruptedException { super.cleanup(context); try { if (!sourceHasData && targetResultSet == null) { getTargetResultSet(context.getConfiguration(), null, null); } if(targetResultSet != null) { while (targetHasNext) { ImmutableBytesWritable targetKey = null; if (targetResultSet.getCurrentRow() != null) { targetKey = new ImmutableBytesWritable(); targetResultSet.getCurrentRow().getKey(targetKey); } logFailRowAndIncrementCounter(context, Counter.ONLY_IN_TARGET_TABLE_ROWS, targetKey); targetHasNext = targetResultSet.next(); } } } catch (SQLException e) { LOG.error("Unable to properly scan the peer table", e); } finally { try { targetResultSet.close(); targetResultSet = null; } catch (SQLException e) { LOG.error("Unable to close peer result set", e); } } }

Target:
protected void cleanup(Context context) throws IOException, InterruptedException { super.cleanup(context); try { if(targetResultSet != null) { while (targetHasNext) { ImmutableBytesWritable targetKey = null; if (targetResultSet.getCurrentRow() != null) { targetKey = new ImmutableBytesWritable(); targetResultSet.getCurrentRow().getKey(targetKey); } logFailRowAndIncrementCounter(context, Counter.ONLY_IN_TARGET_TABLE_ROWS, targetKey); targetHasNext = targetResultSet.next(); } } } catch (SQLException e) { LOG.error("Unable to properly scan the peer table", e); } finally { try { if(targetResultSet != null) { targetResultSet.close(); targetResultSet = null; } } catch (SQLException e) { LOG.error("Unable to close peer result set", e); } } }
Source:
public AccountStore getAccountStore() { String href = getAccountStoreHref(); AccountStore accountStore = null; if (href.contains("directories")) { accountStore = getDataStore().getResource(href, Directory.class); } else if (href.contains("groups")) { accountStore = getDataStore().getResource(href, Group.class); } else if (href.contains("organizations")){ accountStore = getDataStore().getResource(href, Organization.class); } return accountStore; }

Target:
public AccountStore getAccountStore() { String href = getAccountStoreHref(); AccountStore accountStore = null; if (href.contains("/directories/")) { accountStore = getDataStore().getResource(href, Directory.class); } else if (href.contains("/groups/")) { accountStore = getDataStore().getResource(href, Group.class); } else if (href.contains("/organizations/")){ accountStore = getDataStore().getResource(href, Organization.class); } return accountStore; }
Source:
public WorkState getState(String string) { for (WorkState state : new CopyOnWriteArrayList<WorkState>(states)) { if (state.getName().equals(string)) { return state; } } return null; }

Target:
public WorkState getState(String string) { for (WorkState state : states) { if (state.getName().equals(string)) { return state; } } return null; }
Source:
private static void setupApplicationRoot() throws IOException { Path tempDir = Files.createTempDirectory(AppConfigurationInitialisationTest.class.getName()); tempDir.toFile().deleteOnExit(); System.setProperty("application.user.root", tempDir.toString()); }

Target:
public static void setupApplicationRoot() throws IOException { Path tempDir = Files.createTempDirectory(AppConfigurationInitialisationTest.class.getName()); tempDir.toFile().deleteOnExit(); System.setProperty("application.user.root", tempDir.toString()); }
Source:
public QuotaConfig(VerifiableProperties verifiableProperties) { storageQuotaConfig = new StorageQuotaConfig(verifiableProperties); requestQuotaThrottlingEnabled = verifiableProperties.getBoolean(REQUEST_QUOTA_THROTTLING_ENABLED, false); hostQuotaThrottlingEnabled = verifiableProperties.getBoolean(HOST_QUOTA_THROTTLING_ENABLED, false); requestQuotaEnforcerSourcePairInfoJson = verifiableProperties.getString(REQUEST_QUOTA_ENFORCER_SOURCE_PAIR_INFO_JSON, buildDefaultQuotaEnforcerSourceInfoPairJson()); hostQuotaEnforcerFactories = Utils.splitString(verifiableProperties.getString(HOST_QUOTA_ENFORCER_FACTORIES, ""), ",", HashSet::new); quotaManagerFactoryClass = verifiableProperties.getString(QUOTA_MANAGER_FACTORY_CLASS, DEFAULT_QUOTA_MANAGER_FACTORY_CLASS); quotaThrottlingMode = QuotaMode.valueOf(verifiableProperties.getString(QUOTA_THROTTLING_MODE, DEFAULT_QUOTA_THROTTLING_MODE)); }

Target:
public QuotaConfig(VerifiableProperties verifiableProperties) { storageQuotaConfig = new StorageQuotaConfig(verifiableProperties); requestQuotaThrottlingEnabled = verifiableProperties.getBoolean(REQUEST_QUOTA_THROTTLING_ENABLED, false); hostQuotaThrottlingEnabled = verifiableProperties.getBoolean(HOST_QUOTA_THROTTLING_ENABLED, false); requestQuotaEnforcerSourcePairInfoJson = verifiableProperties.getString(REQUEST_QUOTA_ENFORCER_SOURCE_PAIR_INFO_JSON, buildDefaultQuotaEnforcerSourceInfoPairJson().toString()); hostQuotaEnforcerFactories = Utils.splitString(verifiableProperties.getString(HOST_QUOTA_ENFORCER_FACTORIES, ""), ",", HashSet::new); quotaManagerFactoryClass = verifiableProperties.getString(QUOTA_MANAGER_FACTORY_CLASS, DEFAULT_QUOTA_MANAGER_FACTORY_CLASS); quotaThrottlingMode = QuotaMode.valueOf(verifiableProperties.getString(QUOTA_THROTTLING_MODE, DEFAULT_QUOTA_THROTTLING_MODE)); }