auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Map<FactoryContainer, Attributes> getAllContainers() { Map<FactoryContainer, Attributes> map = new LinkedHashMap<>(_path.size()); synchronized (_path) { for (Entry<FactoryContainer, Attributes> entry : getReversed(_path.entrySet())) { map.put(entry.getKey(), new Attributes(entry.getValue())); } } return map; }

Target:
public Map<FactoryContainer, Attributes> getAllContainers() { Map<FactoryContainer, Attributes> map = new LinkedHashMap<>(_path.size()); synchronized (_path) { for (Map.Entry<FactoryContainer, Attributes> entry : getReversed(_path.entrySet())) { map.put(entry.getKey(), new Attributes(entry.getValue())); } } return map; }
Source:
public void onResourcePackStatus(C19PacketResourcePackStatus packet, CallbackInfo ci) { String hash = packet.hash; PlayerResourcePackStatusEvent.ResourcePackStatus status; ResourcePack pack = sentResourcePacks.get(hash); switch (packet.status) { case ACCEPTED: status = ResourcePackStatus.ACCEPTED; break; case DECLINED: status = ResourcePackStatus.DECLINED; break; case SUCCESSFULLY_LOADED: status = ResourcePackStatus.SUCCESSFULLY_LOADED; break; case FAILED_DOWNLOAD: status = ResourcePackStatus.PACK_FILE_FORMAT_NOT_RECOGNIZED; break; default: throw new AssertionError(); } if (status.wasSuccessful().isPresent()) { sentResourcePacks.remove(hash); } Sponge.getGame().getEventManager() .post(SpongeEventFactory.createPlayerResourcePackStatus(Sponge.getGame(), (Player)playerEntity, pack, status)); }

Target:
public void onResourcePackStatus(C19PacketResourcePackStatus packet, CallbackInfo ci) { String hash = packet.hash; ResourcePackStatus status; ResourcePack pack = this.sentResourcePacks.get(hash); switch (packet.status) { case ACCEPTED: status = ResourcePackStatus.ACCEPTED; break; case DECLINED: status = ResourcePackStatus.DECLINED; break; case SUCCESSFULLY_LOADED: status = ResourcePackStatus.SUCCESSFULLY_LOADED; break; case FAILED_DOWNLOAD: status = ResourcePackStatus.FAILED; break; default: throw new AssertionError(); } if (status.wasSuccessful().isPresent()) { this.sentResourcePacks.remove(hash); } Sponge.getGame().getEventManager() .post(SpongeEventFactory.createResourcePackStatusEvent(Sponge.getGame(), pack, (Player)this.playerEntity, status)); }
Source:
public String getDescription() { return "Many resources, such as TypedArrays, VelocityTrackers, etc., should be " + "recycled (with a recycle()/close() call) after use. " + "Inspired from " + "<LINK_0>" + "java/com/android/tools/lint/checks/CleanupDetector.java"; }

Target:
public String getDescription() { return "Android - Many resources, such as TypedArrays, VelocityTrackers, etc., should be " + "recycled (with a recycle()/close() call) after use."; }
Source:
private static void deleteSupplementaryFile(String selection) { java.util.List<IResource> resourceToDelete = new ArrayList<>(); java.util.List<String> ids = XmlUtils.getAnalysisIdsFromFile(selection + XmlUtils.XML_EXTENSION); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(0); for (IProject project : projects) { TmfProjectElement pElement = TmfProjectRegistry.getProject(project); if (pElement != null) { TmfTraceFolder tracesFolder = pElement.getTracesFolder(); for (TmfTraceElement tElement : tracesFolder.getTraces()) { boolean closeEditor = false; for (IResource resource : tElement.getSupplementaryResources()) { for (String id : ids) { if (resource.getName().startsWith(id)) { resourceToDelete.add(resource); closeEditor = true; } } } if (closeEditor) { tElement.closeEditors(); } } } } for (IResource resource : resourceToDelete) { try { resource.delete(false, null); } catch (CoreException e) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_DeleteFileError, resource.getName())); } } }

Target:
private static void deleteSupplementaryFile(String selection) { java.util.List<IResource> resourceToDelete = new ArrayList<>(); java.util.List<String> ids = XmlUtils.getAnalysisIdsFromFile(selection + XmlUtils.XML_EXTENSION); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(0); for (IProject project : projects) { TmfProjectElement pElement = TmfProjectRegistry.getProject(project); if (pElement != null) { java.util.List<TmfCommonProjectElement> tElements = new ArrayList<>(); tElements.addAll(pElement.getTracesFolder().getTraces()); tElements.addAll(pElement.getExperimentsFolder().getExperiments()); for (TmfCommonProjectElement tElement : tElements) { boolean closeEditor = false; for (IResource resource : tElement.getSupplementaryResources()) { for (String id : ids) { if (resource.getName().startsWith(id)) { resourceToDelete.add(resource); closeEditor = true; } } } if (closeEditor) { tElement.closeEditors(); } } } } for (IResource resource : resourceToDelete) { try { resource.delete(false, null); } catch (CoreException e) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_DeleteFileError, resource.getName())); } } }
Source:
private Map<String, Object> getApplications() { Applications applications = this.eurekaClient.getApplications(); if (applications == null) { return Collections.emptyMap(); } Map<String, Object> result = new HashMap<>(); for (Application application : applications.getRegisteredApplications()) { if (application.getInstances().isEmpty()) { continue; } result.put(application.getName(), application.getInstances().size()); } return result; }

Target:
private Map<String, Object> getApplications() { Applications applications = this.eurekaClient.getApplications(); if (applications == null) { return Collections.emptyMap(); } Map<String, Object> result = new HashMap<>(); for (Application application : applications.getRegisteredApplications()) { if (!application.getInstances().isEmpty()) { result.put(application.getName(), application.getInstances().size()); } } return result; }
Source:
static Builder forScalar(AttributeConverter<?, ?> c) { Builder rv = new Builder(); rv.hlp = new AttributeConverters(c, null, null); return rv; }

Target:
static Builder forScalar(AttributeConverter<?, ?> c) { return new Builder(new AttributeConverters(c, null, null)); }
Source:
private void updateBrickSize() { long totalSize = 0; if (getStorageDevices().getSelectedItems() != null) { for (StorageDevice storageDevice : getStorageDevices().getSelectedItems()) { if (storageDevice.getCanCreateBrick()) { totalSize += storageDevice.getSize(); } } } Pair<SizeUnit, Double> convertedSize = SizeConverter.autoConvert(totalSize, SizeUnit.MB); setBrickSize(convertedSize); }

Target:
private void updateBrickSize() { long totalSize = 0; if (getStorageDevices().getSelectedItems() != null) { for (StorageDevice storageDevice : getStorageDevices().getSelectedItems()) { totalSize += storageDevice.getSize(); } } Pair<SizeUnit, Double> convertedSize = SizeConverter.autoConvert(totalSize, SizeUnit.MB); setBrickSize(convertedSize); }
Source:
public void handleEvent(@NonNull ITmfStateSystemBuilder ss, @NonNull ITmfEvent event) throws AttributeNotFoundException { ITmfEventField content = event.getContent(); long ts = event.getTimestamp().getValue(); Integer sector = ((Long) content.getField(getLayout().fieldBlockSector()).getValue()).intValue(); Integer nrSector = ((Long) content.getField(getLayout().fieldBlockNrSector()).getValue()).intValue(); Integer phydisk = ((Long) content.getField(getLayout().fieldBlockDeviceId()).getValue()).intValue(); Integer rwbs = ((Long) content.getField(getLayout().fieldBlockRwbs()).getValue()).intValue(); DiskWriteModel disk = fStateProvider.getDisk(phydisk); Request request = disk.getDriverRequest(sector); if (request == null) { request = new Request(disk, sector, rwbs); } request.setNrSector(nrSector); request.setType(rwbs); disk.completeRequest(ts, request); }

Target:
public void handleEvent(@NonNull ITmfStateSystemBuilder ss, @NonNull ITmfEvent event) throws AttributeNotFoundException { ITmfEventField content = event.getContent(); long ts = event.getTimestamp().getValue(); Long sector = NonNullUtils.checkNotNull((Long) content.getField(getLayout().fieldBlockSector()).getValue()); int nrSector = ((Long) content.getField(getLayout().fieldBlockNrSector()).getValue()).intValue(); int phydisk = ((Long) content.getField(getLayout().fieldBlockDeviceId()).getValue()).intValue(); int rwbs = ((Long) content.getField(getLayout().fieldBlockRwbs()).getValue()).intValue(); DiskWriteModel disk = fStateProvider.getDisk(phydisk); Request request = disk.getDriverRequest(sector); if (request == null) { request = new Request(disk, sector, rwbs); } request.setNrSector(nrSector); request.setType(rwbs); disk.completeRequest(ts, request); }
Source:
public void getApexDFSRootDirAbsPath() throws IOException { Configuration conf = new YarnConfiguration(new Configuration(false)); conf.set(StramClientUtils.APEX_APP_DFS_ROOT_DIR, "/x/y/z"); conf.setBoolean(StramUserLogin.DT_APP_PATH_IMPERSONATED, false); FileSystem fs = FileSystem.newInstance(conf); UserGroupInformation testUser = UserGroupInformation.createUserForTesting("testUser1", new String[]{""}); UserGroupInformation.setLoginUser(testUser); Path path = StramClientUtils.getApexDFSRootDir(fs, conf); Assert.assertEquals(fs.getHomeDirectory() + "/datatorrent", path.toString()); Assert.assertNull(conf.get(StramClientUtils.DT_DFS_ROOT_DIR)); Assert.assertEquals("/x/y/z", conf.get(StramClientUtils.APEX_APP_DFS_ROOT_DIR)); }

Target:
public void getApexDFSRootDirAbsPath() throws Exception { Configuration conf = new Configuration(false); conf.set(StramClientUtils.APEX_APP_DFS_ROOT_DIR, "/x/y/z"); conf.setBoolean(StramUserLogin.DT_APP_PATH_IMPERSONATED, false); setupLoginTestUser(); FileSystem fs = FileSystem.newInstance(conf); Path path = StramClientUtils.getApexDFSRootDir(fs, conf); Assert.assertEquals(fs.getHomeDirectory() + "/datatorrent", path.toString()); Assert.assertNull(conf.get(StramClientUtils.DT_DFS_ROOT_DIR)); Assert.assertEquals("/x/y/z", conf.get(StramClientUtils.APEX_APP_DFS_ROOT_DIR)); }
Source:
public void prepareDataForEpoch() { synchronized (trainingDataKeys) { trainingDataKeys.clear(); trainingDataKeys.addAll(memoryStore.getAll().keySet()); Collections.shuffle(trainingDataKeys); LOG.log(Level.INFO, "training data key set size = {0}", trainingDataKeys.size()); } }

Target:
void prepareDataForEpoch() { synchronized (trainingDataKeys) { trainingDataKeys.clear(); trainingDataKeys.addAll(memoryStore.getAll().keySet()); Collections.shuffle(trainingDataKeys); LOG.log(Level.INFO, "training data key set size = {0}", trainingDataKeys.size()); } }
Source:
public void testNonTightHtmlTagIntolerantCheckVisitCount() throws Exception { NonTightHtmlTagIntolerantCheck.visitJavadocTokenMethodCallCount = 0; final DefaultConfiguration checkConfig = createModuleConfig(NonTightHtmlTagIntolerantCheck.class); final File testFile = new File(getPath("InputAbstractJavadocNonTightHtmlTags.java")); final List<File> fileList = new ArrayList<>(); fileList.add(testFile); final Checker checker = createChecker(checkConfig); checker.process(fileList); assertEquals("Please ensure that method 'visitJavadocToken' is not called " + "more than thrice.", 5, NonTightHtmlTagIntolerantCheck.visitJavadocTokenMethodCallCount); }

Target:
public void testNonTightHtmlTagIntolerantCheckVisitCount() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NonTightHtmlTagIntolerantCheck.class); checkConfig.addAttribute("violateExecutionOnNonTightHtml", "true"); checkConfig.addAttribute("reportVisitJavadocToken", "true"); final String[] expected = { "6: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "13: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "16: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "li"), "21: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "27: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "tr"), "34: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "li"), "41:8: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), "54: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "li"), "62:13: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), "71: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "80: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "tr"), "99:8: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), "105:8: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), "109:8: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), "124: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), }; verify(checkConfig, getPath("InputAbstractJavadocNonTightHtmlTags.java"), expected); }
Source:
public void testRepetitiveSequenceWithOnlyGuanine() { NucleotideCounter nucleotideCounter = new NucleotideCounter("GGGGGGG"); Map<Character, Integer> counts = nucleotideCounter.nucleotideCounts(); assertThat(nucleotideCounter.count('G'), is(7)); assertThat(nucleotideCounter.count('T'), is(0)); }

Target:
public void testRepetitiveSequenceWithOnlyGuanine() { NucleotideCounter nucleotideCounter = new NucleotideCounter("GGGGGGG"); Map<Character, Integer> counts = nucleotideCounter.nucleotideCounts(); assertThat(counts, allOf( hasEntry('A', 0), hasEntry('C', 0), hasEntry('G', 7), hasEntry('T', 0) )); }
Source:
private boolean verifyJwt(String jwtToken, String expectedAudience) throws Exception { TokenVerifier tokenVerifier = TokenVerifier.newBuilder() .setAudience(expectedAudience) .build(); try { tokenVerifier.verify(jwtToken); return true; } catch (TokenVerifier.VerificationException e) { return false; } }

Target:
private boolean verifyJwt(String jwtToken, String expectedAudience) { TokenVerifier tokenVerifier = TokenVerifier.newBuilder() .setAudience(expectedAudience) .setIssuer(IAP_ISSUER_URL) .build(); try { JsonWebToken jsonWebToken = tokenVerifier.verify(jwtToken); JsonWebToken.Payload payload = jsonWebToken.getPayload(); return payload.getSubject() != null && payload.get("email") != null; } catch (TokenVerifier.VerificationException e) { System.out.println(e.getMessage()); return false; } }
Source:
private Component createConsentMessage() { Container consentMessages = new JPanel(); consentMessages.add(new JLabel("<html>" + "<h2>WatchDog is a free, open-source plugin that tells how you code your software</h2>" + "It measures how you write Java code and tests. We never do anything bad with <a href=\"<LINK_0>\">your purely numerical data</a>.<br>" + "You can inspect a <a href=\"<LINK_2>\">detailed report</a> on your development behaviour.<br>" + "By proceeding to use this plugin, you consent with us using your anonymous data to perform research and publish papers with.<br>")); return consentMessages; }

Target:
private Component createConsentMessage() { Container consentMessages = new JPanel(); consentMessages.setLayout(new BoxLayout(consentMessages, BoxLayout.Y_AXIS)); Container header = new JPanel(new FlowLayout(FlowLayout.LEFT)); consentMessages.add(header); header.add(new JLabel("<html>" + "<h2>" + OPENSOURCE_PLUGIN + "</h2>")); Container firstSentence = new JPanel(new FlowLayout(FlowLayout.LEFT)); consentMessages.add(firstSentence); firstSentence.add(new JLabel(GATHER_NUMERICAL_DATA)); UIUtils.createHyperLinkLabel(firstSentence, Links.NUMERICAL_DATA); Container secondSentence = new JPanel(new FlowLayout(FlowLayout.LEFT)); consentMessages.add(secondSentence); secondSentence.add(new JLabel(DEVELOPMENT_BEHAVIOR)); UIUtils.createHyperLinkLabel(secondSentence, Links.DETAILED_REPORT); Container thirdSentence = new JPanel(new FlowLayout(FlowLayout.LEFT)); consentMessages.add(thirdSentence); thirdSentence.add(new JLabel(REGISTRATION_CONSENT)); Container fourthSentence = new JPanel(new FlowLayout(FlowLayout.LEFT)); consentMessages.add(fourthSentence); fourthSentence.add(new JLabel(FOR_MORE_INFORMATION)); UIUtils.createHyperLinkLabel(fourthSentence, Links.PRIVACY_STATEMENT); Container contactUs = new JPanel(new FlowLayout(FlowLayout.LEFT)); consentMessages.add(contactUs); contactUs.add(new JLabel(CONTACT_US)); return consentMessages; }
Source:
protected Callable<Boolean> createTaskFor(final CommandLine commandLine, final BuildLogger logger, final long timeout, final BuilderConfiguration configuration) { return new Callable<Boolean>() { @Override public Boolean call() throws Exception { BaseBuilderRequest request = configuration.getRequest(); getSourcesManager() .getSources(logger, request.getWorkspace(), request.getProject(), request.getSourcesUrl(), configuration.getWorkDir()); eventService.publish(BuilderEvent.buildTimeStartedEvent(request.getId(), request.getWorkspace(), request.getProject(), System.currentTimeMillis())); eventService.publish(BuilderEvent.beginEvent(request.getId(), request.getWorkspace(), request.getProject())); StreamPump output = null; Watchdog watcher = null; int result = -1; try { ProcessBuilder processBuilder = new ProcessBuilder().command(commandLine.toShellCommand()).directory( configuration.getWorkDir()).redirectErrorStream(true); modifyCommandEnvironment(processBuilder.environment(), configuration); Process process = processBuilder.start(); if (timeout > 0) { watcher = new Watchdog(getName().toUpperCase() + "-WATCHDOG", timeout, TimeUnit.SECONDS); watcher.start(new CancellableProcessWrapper(process, new Cancellable.Callback() { @Override public void cancelled(Cancellable cancellable) { try { logger.writeLine("[ERROR] Your build has been shutdown due to timeout."); } catch (IOException e) { LOG.error(e.getMessage(), e); } } })); } output = new StreamPump(); output.start(process, logger); try { result = process.waitFor(); } catch (InterruptedException e) { Thread.interrupted(); ProcessUtil.kill(process); } try { output.await(); } catch (InterruptedException e) { Thread.interrupted(); } } finally { if (watcher != null) { watcher.stop(); } if (output != null) { output.stop(); } } LOG.debug("Done: {}, exit code: {}", commandLine, result); return result == 0; } }; }

Target:
protected Callable<Boolean> createTaskFor(final CommandLine commandLine, final BuildLogger logger, final long timeout, final BuilderConfiguration configuration) { return new Callable<Boolean>() { @Override public Boolean call() throws Exception { BaseBuilderRequest request = configuration.getRequest(); if (!prepareWorkingDirectory(configuration, logger)) { return Boolean.FALSE; } eventService.publish(BuilderEvent.buildTimeStartedEvent(request.getId(), request.getWorkspace(), request.getProject(), System.currentTimeMillis())); eventService.publish(BuilderEvent.beginEvent(request.getId(), request.getWorkspace(), request.getProject())); int result = -1; boolean terminated = false; ProcessBuilder processBuilder = createProcessBuilder(commandLine, configuration); try (StreamPump output = new StreamPump()) { Process process = processBuilder.start(); terminated = waitForProcess(process, timeout, configuration, logger); try { output.await(); } catch (InterruptedException e) { Thread.interrupted(); } } if (terminated) { try { logger.writeLine("[ERROR] Your build has been shutdown due to timeout."); } catch (IOException e) { LOG.error(e.getMessage(), e); } } LOG.debug("Done: {}, exit code: {}", commandLine, result); return result == 0; } }; }
Source:
public void shutdownEverything() { stopRemoteThread(); try { this.executorService.shutdown(); if (!executorService.awaitTermination(60, TimeUnit.SECONDS)) { LOGGER.debug("One minute passed, saving still not completed. Trying forced shutdown."); executorService.shutdownNow(); if (executorService.awaitTermination(60, TimeUnit.SECONDS)) { LOGGER.debug("One minute passed again - forced shutdown worked."); } else { LOGGER.error("DelayedTaskThrottler did not terminate"); } } } catch (InterruptedException ie) { executorService.shutdownNow(); Thread.currentThread().interrupt(); } try { this.lowPriorityExecutorService.shutdownNow(); if (!lowPriorityExecutorService.awaitTermination(60, TimeUnit.SECONDS)) { LOGGER.debug("One minute passed, saving still not completed. Trying forced shutdown."); lowPriorityExecutorService.shutdownNow(); if (lowPriorityExecutorService.awaitTermination(60, TimeUnit.SECONDS)) { LOGGER.debug("One minute passed again - forced shutdown worked."); } else { LOGGER.error("DelayedTaskThrottler did not terminate"); } } } catch (InterruptedException ie) { lowPriorityExecutorService.shutdownNow(); Thread.currentThread().interrupt(); } timer.cancel(); }

Target:
public void shutdownEverything() { stopRemoteThread(); gracefullyShutdown(this.executorService); gracefullyShutdown(this.lowPriorityExecutorService); timer.cancel(); }
Source:
public byte[] getMaxBytes() { return hasNonNullValue() ? max.getBytes() : null; }

Target:
public byte[] getMaxBytes() { return max == null ? null : max.getBytes(); }
Source:
private void createCompositeSort(QueryStack theQueryStack, String theResourceName, RestSearchParameterTypeEnum theParamType, String theParamName, boolean theAscending) { switch (theParamType) { case STRING: theQueryStack.addSortOnString(myResourceName, theParamName, theAscending); break; case DATE: theQueryStack.addSortOnDate(myResourceName, theParamName, theAscending); break; case REFERENCE: theQueryStack.addSortOnResourceLink(myResourceName, theParamName, theAscending); break; case TOKEN: theQueryStack.addSortOnToken(myResourceName, theParamName, theAscending); break; case NUMBER: theQueryStack.addSortOnNumber(myResourceName, theParamName, theAscending); break; case URI: theQueryStack.addSortOnUri(myResourceName, theParamName, theAscending); break; case QUANTITY: theQueryStack.addSortOnQuantity(myResourceName, theParamName, theAscending); break; default: throw new InvalidRequestException("This server does not support _sort specifications of type " + theParamType + " - Can't serve _sort=" + theParamName); } }

Target:
private void createCompositeSort(QueryStack theQueryStack, String theResourceName, RestSearchParameterTypeEnum theParamType, String theParamName, boolean theAscending) { switch (theParamType) { case STRING: theQueryStack.addSortOnString(myResourceName, theParamName, theAscending); break; case DATE: theQueryStack.addSortOnDate(myResourceName, theParamName, theAscending); break; case TOKEN: theQueryStack.addSortOnToken(myResourceName, theParamName, theAscending); break; case QUANTITY: theQueryStack.addSortOnQuantity(myResourceName, theParamName, theAscending); break; default: throw new InvalidRequestException("Don't know how to handle composite parameter with type of " + theParamType + " on _sort="+ theParamName); } }
Source:
private synchronized void createRateLimiterAtomically() { currentRate = unitsPerSecond.get(); rateLimiter = new SmoothRateLimiter.SmoothBursty(stopwatch, MAX_BURST_SECONDS); rateLimiter.setRate(currentRate); log.info("Units per second set to for rate limiter type {}", SafeArg.of("unitsPerSecond", currentRate), SafeArg.of("rateLimiterType", rateLimiterType)); }

Target:
private synchronized void createRateLimiterAtomically() { currentRate = unitsPerSecond.get(); rateLimiter = new SmoothRateLimiter.SmoothBursty(stopwatch, MAX_BURST_SECONDS); rateLimiter.setRate(currentRate); log.info("Units per second set to for rate limiter {}", SafeArg.of("unitsPerSecond", currentRate), SafeArg.of("rateLimiterName", rateLimiterName)); }
Source:
public AdhocQueryResponse respondingGatewayCrossGatewayQuery(AdhocQueryRequest body, WebServiceContext context) { AssertionType assertion = getAssertion(context, null); if (assertion != null) { assertion.setImplementsSpecVersion(UDDI_SPEC_VERSION.SPEC_2_0.toString()); } return inboundDocQuery.respondingGatewayCrossGatewayQuery(body, assertion, this.getWebContextProperties(context)); }

Target:
public AdhocQueryResponse respondingGatewayCrossGatewayQuery(AdhocQueryRequest body, WebServiceContext context) { AssertionType assertion = getAssertion(context, null); if (assertion != null) { assertion.setImplementsSpecVersion(UDDI_SPEC_VERSION.SPEC_2_0.toString()); } return inboundDocQuery.respondingGatewayCrossGatewayQuery(body, assertion, getWebContextProperties(context)); }
Source:
synchronized Map<String, String> getJobMetadata(final JobRunner jobRunner) { final ExecutableNode node = jobRunner.getNode(); final Props props = ServiceProvider.SERVICE_PROVIDER.getInstance(Props.class); final Map<String, String> metaData = new HashMap<>(); metaData.put("jobId", node.getId()); final ExecutableFlow flow = node.getExecutableFlow(); metaData.put("executionID", String.valueOf(flow.getExecutionId())); metaData.put("flowName", flow.getId()); metaData.put("projectName", flow.getProjectName()); metaData.put("startTime", String.valueOf(node.getStartTime())); metaData.put("jobType", String.valueOf(node.getType())); metaData.put("azkabanHost", props.getString(AZKABAN_SERVER_HOST_NAME, "unknown")); metaData.put("azkabanWebserver", props.getString(AZKABAN_WEBSERVER_EXTERNAL_HOSTNAME, props.getString("jetty.hostname", "localhost"))); metaData.put("jobProxyUser", jobRunner.getProps().getString(JobProperties.USER_TO_PROXY, null)); metaData.put("attempt ID", String.valueOf(node.getAttempt())); FlowRunner.propagateMetadataFromProps(metaData, node.getInputProps(), "job", node.getId(), FlowRunner.this.logger); return metaData; }

Target:
synchronized Map<String, String> getJobMetadata(final JobRunner jobRunner) { final ExecutableNode node = jobRunner.getNode(); final Props props = ServiceProvider.SERVICE_PROVIDER.getInstance(Props.class); final Map<String, String> metaData = new HashMap<>(); metaData.put("jobId", node.getId()); final ExecutableFlow executableFlow = node.getExecutableFlow(); metaData.put("executionID", String.valueOf(executableFlow.getExecutionId())); metaData.put("flowName", executableFlow.getId()); metaData.put("projectName", executableFlow.getProjectName()); metaData.put("startTime", String.valueOf(node.getStartTime())); metaData.put("jobType", String.valueOf(node.getType())); metaData.put("azkabanHost", props.getString(AZKABAN_SERVER_HOST_NAME, "unknown")); metaData.put("azkabanWebserver", props.getString(AZKABAN_WEBSERVER_EXTERNAL_HOSTNAME, props.getString("jetty.hostname", "localhost"))); metaData.put("jobProxyUser", jobRunner.getEffectiveUser()); metaData.put("attemptID", String.valueOf(node.getAttempt())); FlowRunner.propagateMetadataFromProps(metaData, node.getInputProps(), "job", node.getId(), FlowRunner.this.logger); return metaData; }
Source:
<T extends BusinessEntity<Guid>> void check(final AutoRecoverDAO<T> dao, final VdcActionType actionType, final DoWithClosure<T, VdcActionParametersBase> paramsCallback, final String logMsg) { if (!shouldPerformRecoveryOnType(logMsg)) { log.info("Autorecovering " + logMsg + " is disabled, skipping"); return; } log.debug("Checking autorecoverable " + logMsg); final List<T> fails = dao.listFailedAutorecoverables(); final BackendInternal backend = getBackend(); log.info("Autorecovering " + fails.size() + " " + logMsg); for (final T fail : fails) { log.info("Autorecovering " + logMsg + ": " + fail.getId()); final VdcActionParametersBase actionParams = paramsCallback.doWith(fail); actionParams.setShouldBeLogged(true); backend.runInternalAction(actionType, actionParams); } log.debug("Checking autorecoverable " + logMsg + " done"); }

Target:
<T extends BusinessEntity<Guid>> void check(final AutoRecoverDAO<T> dao, final VdcActionType actionType, final DoWithClosure<T, VdcActionParametersBase> paramsCallback, final String logMsg) { if (!shouldPerformRecoveryOnType(logMsg)) { log.info("Autorecovering " + logMsg + " is disabled, skipping"); return; } log.debugFormat("Checking autorecoverable {0}" , logMsg); final List<T> fails = dao.listFailedAutorecoverables(); final BackendInternal backend = getBackend(); log.info("Autorecovering " + fails.size() + " " + logMsg); for (final T fail : fails) { log.info("Autorecovering " + logMsg + ": " + fail.getId()); final VdcActionParametersBase actionParams = paramsCallback.doWith(fail); actionParams.setShouldBeLogged(true); backend.runInternalAction(actionType, actionParams); } log.debugFormat("Checking autorecoverable {0} done",logMsg); }
Source:
protected List<TestProcessManager> entities(int count) { final List<TestProcessManager> procmans = new ArrayList<>(); for (int i = 0; i < count; i++) { final ProjectId id = ProjectId.newBuilder().setId(String.format("procman-number-%s", i)).build(); procmans.add(new TestProcessManager(id)); } return procmans; }

Target:
protected List<TestProcessManager> entities(int count) { final List<TestProcessManager> procmans = new ArrayList<>(count); for (int i = 0; i < count; i++) { final ProjectId id = ProjectId.newBuilder().setId(String.format("procman-number-%s", i)).build(); procmans.add(new TestProcessManager(id)); } return procmans; }
Source:
public void testCreateInAvailabilityZone() { String serverId = null; String availabilityZone; for (String zoneId : zones) { ServerApi serverApi = api.getServerApiForZone(zoneId); Optional<? extends AvailabilityZoneAPI> azApi = api.getAvailabilityZoneApi(zoneId); availabilityZone = azApi.isPresent() ? azApi.get().list().last().get().getName() : "nova"; try { serverId = createServer(zoneId, availabilityZone).getId(); Server server = serverApi.get(serverId); assertEquals(server.getStatus(), ACTIVE); } finally { if (serverId != null) { serverApi.delete(serverId); } } } }

Target:
public void testCreateInAvailabilityZone() { String serverId = null; String availabilityZone; for (String zoneId : zones) { ServerApi serverApi = api.getServerApiForZone(zoneId); Optional<? extends AvailabilityZoneApi> availabilityZoneApi = api.getAvailabilityZoneApi(zoneId); availabilityZone = availabilityZoneApi.isPresent() ? Iterables.getLast(availabilityZoneApi.get().list()).getName() : "nova"; try { serverId = createServer(zoneId, availabilityZone).getId(); Server server = serverApi.get(serverId); assertEquals(server.getStatus(), ACTIVE); } finally { if (serverId != null) { serverApi.delete(serverId); } } } }
Source:
private void getAllMembersHelper(IResource res, ArrayList<IResource> ret) { ArrayList<IResource> tmp = new ArrayList<IResource>(); if (res instanceof IContainer) { IContainer cont = (IContainer) res; try { for (IResource r : cont.members()) { if (r.getLocation().toFile().isFile()) { tmp.add(r); } else { getAllMembersHelper(r, tmp); } } } catch (CoreException e) { return; } ret.addAll(tmp); } }

Target:
private void getAllMembersHelper(IResource res, ArrayList<IResource> ret) { if (res instanceof IContainer) { ArrayList<IResource> tmp = new ArrayList<IResource>(); IContainer cont = (IContainer) res; try { for (IResource r : cont.members()) { if (r.getLocation().toFile().isFile()) { tmp.add(r); } else { getAllMembersHelper(r, tmp); } } } catch (CoreException e) { return; } ret.addAll(tmp); } }
Source:
public void leaveNode(Tree tree) { if (tree.is(IF_STATEMENT) && fieldNotInitializedTest(((IfStatementTree) tree).condition())) { ifConditionStack.pollLast(); } if (tree.is(SYNCHRONIZED_STATEMENT)) { synchronizedStmtStack.pollLast(); } }

Target:
public void leaveNode(Tree tree) { if (!hasSemantic()) { return; } if (isIfFieldEqNullTree(tree)) { ifConditionSymbolStack.pop(); } if (tree.is(SYNCHRONIZED_STATEMENT)) { synchronizedStmtStack.pop(); } }
Source:
public static void showMessageAsPlainText(Activity activity, CharSequence possibleHtml) { CharSequence richText = Html.fromHtml(possibleHtml.toString()); makeSnackbar(findBestView(activity), richText, Snackbar.LENGTH_LONG).setText(richText.toString()).show(); }

Target:
public static void showMessageAsPlainText(Activity activity, CharSequence possibleHtml) { CharSequence richText = Html.fromHtml(possibleHtml.toString()); showMessage(activity, richText.toString()); }
Source:
private File createTemporaryFolderIn(File parentFolder) throws IOException { File createdFolder = null; for (int i = 0; i < TEMP_DIR_ATTEMPTS; ++i) { final String suffix = ".tmp"; final File tmpFile = File.createTempFile(TMP_PREFIX, suffix, parentFolder); tmpFile.delete(); final String tmpPath = tmpFile.getPath(); final String folderPath = tmpPath.substring(0, tmpPath.length() - suffix.length()); createdFolder = new File(folderPath); if (createdFolder.mkdir()) { return createdFolder; } } throw new IOException("Unable to create temporary directory in: " + parentFolder.toString() + ". Tried " + TEMP_DIR_ATTEMPTS + " times. " + "Last attempted to create: " + createdFolder.toString()); }

Target:
private File createTemporaryFolderIn(File parentFolder) throws IOException { File createdFolder = null; for (int i = 0; i < TEMP_DIR_ATTEMPTS; ++i) { String suffix = ".tmp"; File tmpFile = File.createTempFile(TMP_PREFIX, suffix, parentFolder); String tmpName = tmpFile.getName(); String folderName = tmpName.substring(0, tmpName.length() - suffix.length()); createdFolder = new File(parentFolder, folderName); if (createdFolder.mkdir()) { tmpFile.delete(); return createdFolder; } tmpFile.delete(); } throw new IOException("Unable to create temporary directory in: " + parentFolder.toString() + ". Tried " + TEMP_DIR_ATTEMPTS + " times. " + "Last attempted to create: " + createdFolder.toString()); }
Source:
public static DetailAST findLastChildWhichContainsSpecifiedToken(DetailAST ast, int childType, int containType) { DetailAST returnValue = null; for (DetailAST astIterator = ast.getFirstChild(); astIterator != null; astIterator = astIterator.getNextSibling()) { if (astIterator.getType() == childType && astIterator.branchContains(containType)) { returnValue = astIterator; } } return returnValue; }

Target:
private static DetailAST findLastChildWhichContainsSpecifiedToken(DetailAST ast, int childType, int containType) { DetailAST returnValue = null; for (DetailAST astIterator = ast.getFirstChild(); astIterator != null; astIterator = astIterator.getNextSibling()) { if (astIterator.getType() == childType && astIterator.branchContains(containType)) { returnValue = astIterator; } } return returnValue; }
Source:
public void visitNode(Tree tree) { Long identityElement = getBitwiseOperationIdentityElement(tree); Long evaluatedExpression = evaluateExpression(getExpression(tree)); if (evaluatedExpression != null && evaluatedExpression == identityElement) { addIssue(tree, "Remove this silly bit operation."); } }

Target:
public void visitNode(Tree tree) { Long identityElement = getBitwiseOperationIdentityElement(tree); Long evaluatedExpression = evaluateExpression(getExpression(tree)); if (evaluatedExpression != null && identityElement.equals(evaluatedExpression)) { addIssue(tree, "Remove this silly bit operation."); } }
Source:
public boolean releaseInactive() { boolean useful = writerPool.releaseInactive(); useful |= readerPool.releaseInactive(); if (null != backupWriterPool) { useful |= backupWriterPool.releaseInactive(); } return useful; }

Target:
public boolean releaseInactive() { boolean useful = writerPool.releaseInactive(); useful |= readerPool.releaseInactive(); return useful; }
Source:
void compiled(long microseconds) { log.tracef( "QueryStatistics - query compiled : %s", query ); planCacheMissCount.increment(); planCompilationTotalMicroseconds.addAndGet( microseconds ); }

Target:
void compiled(long microseconds) { planCacheMissCount.increment(); planCompilationTotalMicroseconds.addAndGet( microseconds ); }
Source:
protected FileChannel getFileChannel() { return fRandomAccessFile.getChannel(); }

Target:
protected FileChannel getFileChannel() { return Objects.requireNonNull(fRandomAccessFile).getChannel(); }
Source:
public void loadDefaultGameSameThread() { ClientSetting.defaultGameUri .getValue() .filter( defaultGame -> { String rootFolder = ClientFileSystemHelper.getUserRootFolder().toURI().toString(); if (rootFolder.startsWith("file:")) { rootFolder = rootFolder.substring("file:".length()); } return defaultGame.contains(rootFolder); }) .filter( defaultGame -> { if (defaultGame.startsWith("jar:file:")) { defaultGame = defaultGame.substring("jar:file:".length(), defaultGame.indexOf('!')); } else if (defaultGame.startsWith("file://")) { defaultGame = defaultGame.substring("file://".length()); } return new File(defaultGame).exists(); }) .map(URI::create) .ifPresentOrElse(this::load, this::resetDefaultGame); }

Target:
public void loadDefaultGameSameThread() { ClientSetting.defaultGameUri .getValue() .map(URI::create) .filter( defaultGame -> getDefaultGameRealPath(defaultGame) .startsWith(ClientFileSystemHelper.getUserRootFolder().toPath())) .filter(defaultGame -> getDefaultGameRealPath(defaultGame).toFile().exists()) .ifPresentOrElse(this::load, this::resetDefaultGame); }
Source:
public synchronized boolean seek(CtfLocationInfo ctfLocationData) { boolean ret = false; if (ctfLocationData.equals(CtfLocation.INVALID_LOCATION)) { fCurLocation = NULL_LOCATION; return false; } if (fCurLocation.getLocationInfo().equals(ctfLocationData)) { return super.hasMoreEvents(); } fCurLocation = new CtfLocation(ctfLocationData); long currTimestamp = ctfLocationData.getTimestamp(); final long offsetTimestamp = this.getCtfTmfTrace().timestampNanoToCycles(currTimestamp); try { if (offsetTimestamp < 0) { ret = super.seek(0L); } else { ret = super.seek(offsetTimestamp); } } catch (CTFException e) { Activator.getDefault().logError(e.getMessage(), e); return false; } long index = 0; final CtfTmfEvent currentEvent = this.getCurrentEvent(); if (currentEvent != null) { currTimestamp = currentEvent.getTimestamp().getValue(); for (long i = 0; ret && i < ctfLocationData.getIndex(); i++) { if (currTimestamp == currentEvent.getTimestamp().getValue()) { index++; } else { index = 0; } ret = this.advance(); } } else { ret = false; } if (ret) { fCurLocation = new CtfLocation(new CtfLocationInfo(getCurrentEvent().getTimestamp().getValue(), index)); } else { fCurLocation = NULL_LOCATION; } return ret; }

Target:
public synchronized boolean seek(CtfLocationInfo ctfLocationData) { boolean ret = false; if (ctfLocationData.equals(CtfLocation.INVALID_LOCATION)) { fCurLocation = NULL_LOCATION; return false; } if (fCurLocation.getLocationInfo().equals(ctfLocationData)) { return super.hasMoreEvents(); } fCurLocation = new CtfLocation(ctfLocationData); final long seekToTimestamp = ctfLocationData.getTimestamp(); final long offsetTimestamp = this.getCtfTmfTrace().timestampNanoToCycles(seekToTimestamp); try { if (offsetTimestamp < 0) { ret = super.seek(0L); } else { ret = super.seek(offsetTimestamp); } } catch (CTFException e) { Activator.getDefault().logError(e.getMessage(), e); return false; } long index = 0; ITmfEvent currentEvent = getCurrentEvent(); ret &= (currentEvent != null); ITmfEvent previousEvent = currentEvent; for (long i = 0; ret && i < ctfLocationData.getIndex(); i++) { if (seekToTimestamp >= Objects.requireNonNull(currentEvent).getTimestamp().getValue()) { index++; } else { break; } ret = advance(); previousEvent = currentEvent; currentEvent = getCurrentEvent(); } if (ret) { fCurLocation = new CtfLocation(new CtfLocationInfo(Objects.requireNonNull(previousEvent).getTimestamp().getValue(), index)); } else { fCurLocation = NULL_LOCATION; } return ret; }
Source:
public GitlabProject getProject(String namespace, String projectName) throws IOException{ String fullName = namespace+" / "+projectName; String tailUrl = GitlabProject.URL + "?search=" + projectName; GitlabProject[] projects = retrieve().to(tailUrl, GitlabProject[].class); for(GitlabProject gp : projects) { if(gp.getNameWithNamespace().equals(fullName)) { return gp; } } throw new FileNotFoundException("Project not found: "+fullName); }

Target:
public GitlabProject getProject(String namespace, String projectName) throws IOException{ String tailUrl = GitlabProject.URL + "?search=" + projectName; GitlabProject[] projects = retrieve().to(tailUrl, GitlabProject[].class); for(GitlabProject gp : projects) { String pNamespace = gp.getNamespace().getName(); if(pNamespace.equals(namespace)) { return gp; } } throw new FileNotFoundException("Project not found: "+namespace+" / "+projectName); }
Source:
protected WatchDog doPopulate(WatchDog model, VmWatchdog entity) { model.setAction(entity.getAction() == null ? null : entity.getAction().name()); model.setModel(entity.getModel() == null ? null : entity.getModel().name()); model.setId(entity.getId().toString()); return model; }

Target:
protected WatchDog doPopulate(WatchDog model, VmWatchdog entity) { return model; }
Source:
public void message(FIXMessage message) throws IOException { long msgSeqNum = message.getMsgSeqNum(); if (msgSeqNum == 0) { sendLogout("MsgSeqNum(34) not found"); return; } FIXValue msgType = message.getMsgType(); if (msgType == null) { statusListener.close(FIXSession.this, "MsgType(35) not found"); return; } if (msgType.length() == 1 && msgType.asChar() == SequenceReset) { if(handleSequenceReset(message)) return; } if (msgSeqNum > rxMsgSeqNum) { sendResendRequest(rxMsgSeqNum); return; } if (msgSeqNum < rxMsgSeqNum) { handleTooLowMsgSeqNum(message, msgSeqNum, msgType); return; } rxMsgSeqNum++; if (msgType.length() != 1) { downstream.message(message); return; } switch (msgType.byteAt(0)) { case Heartbeat: handleHeartbeat(); break; case TestRequest: handleTestRequest(message); break; case ResendRequest: handleResendRequest(message); break; case Reject: handleReject(message); break; case SequenceReset: handleSequenceReset(message); break; case Logout: handleLogout(message); break; case Logon: handleLogon(message); break; default: downstream.message(message); break; } }

Target:
public void message(FIXMessage message) throws IOException { long msgSeqNum = message.getMsgSeqNum(); if (msgSeqNum == 0) { sendLogout("MsgSeqNum(34) not found"); return; } FIXValue msgType = message.getMsgType(); if (msgType == null) { statusListener.close(FIXSession.this, "MsgType(35) not found"); return; } if (msgType.length() == 1 && msgType.asChar() == SequenceReset) { if (handleSequenceReset(message)) return; } if (msgSeqNum > rxMsgSeqNum) { sendResendRequest(rxMsgSeqNum); return; } if (msgSeqNum < rxMsgSeqNum) { handleTooLowMsgSeqNum(message, msgType, msgSeqNum); return; } rxMsgSeqNum++; if (msgType.length() != 1) { downstream.message(message); return; } switch (msgType.byteAt(0)) { case Heartbeat: handleHeartbeat(); break; case TestRequest: handleTestRequest(message); break; case ResendRequest: handleResendRequest(message); break; case Reject: handleReject(message); break; case SequenceReset: handleSequenceReset(message); break; case Logout: handleLogout(message); break; case Logon: handleLogon(message); break; default: downstream.message(message); break; } }
Source:
public Options getOptions() { final Options o = new Options(); profileOpt = new Option("pn", "profile", true, "iterator profile name"); profileOpt.setRequired(true); profileOpt.setArgName("profile"); priorityOpt = new Option("p", "priority", true, "the order in which the iterator is applied"); priorityOpt.setArgName("pri"); priorityOpt.setRequired(true); final OptionGroup typeGroup = new OptionGroup(); classnameTypeOpt = new Option("class", "class-name", true, "a java class that implements SortedKeyValueIterator"); classnameTypeOpt.setArgName("name"); aggTypeOpt = new Option("agg", "aggregator", false, "an aggregating type"); regexTypeOpt = new Option("regex", "regular-expression", false, "a regex matching iterator"); versionTypeOpt = new Option("vers", "version", false, "a versioning iterator"); reqvisTypeOpt = new Option("reqvis", "require-visibility", false, "an iterator that omits entries with empty visibilities"); ageoffTypeOpt = new Option("ageoff", "ageoff", false, "an aging off iterator"); typeGroup.addOption(classnameTypeOpt); typeGroup.addOption(aggTypeOpt); typeGroup.addOption(regexTypeOpt); typeGroup.addOption(versionTypeOpt); typeGroup.addOption(reqvisTypeOpt); typeGroup.addOption(ageoffTypeOpt); typeGroup.setRequired(true); nameOpt = new Option("n", "name", true, "iterator to set"); nameOpt.setArgName("itername"); o.addOption(profileOpt); o.addOptionGroup(typeGroup); o.addOption(priorityOpt); o.addOption(nameOpt); return o; }

Target:
public Options getOptions() { final Options o = new Options(); setBaseOptions(o); setProfileOptions(o); return o; }
Source:
private Answer executeRequest(GetClientDefaultsCommand cmd) { try { isNuageVspManagerLoaded(); Map<String, Object> clientDefaults = _nuageVspManagerClient.getClientDefaults(); return new GetClientDefaultsAnswer(cmd, clientDefaults); } catch (Exception e) { return new GetClientDefaultsAnswer(cmd, e); } }

Target:
private Answer executeRequest(GetClientDefaultsCommand cmd) { try { isNuageVspManagerLoaded(); Map<String, Object> clientDefaults = _nuageVspManagerClient.getClientDefaults(); return new GetClientDefaultsAnswer(cmd, clientDefaults); } catch (ExecutionException | ConfigurationException e) { s_logger.error("Failure during " + cmd + " on Nuage VSD " + _hostName, e); return new GetClientDefaultsAnswer(cmd, e); } }
Source:
public boolean hasChatColors() { return ( settings != null ) ? settings.isChatColours() : true; }

Target:
public boolean hasChatColors() { return settings == null || settings.isChatColours(); }
Source:
public void testLocalSymbolTableAppend() throws Exception { writer.writeSymbol("taco"); writer.flush(); writer.writeSymbol("burrito"); writer.finish(); IonReader reader = system().newReader(writer.getBytes()); reader.next(); assertEquals(reader.getSymbolTable().findSymbol("taco"), 15); assertEquals(reader.getSymbolTable().findSymbol("burrito"), -1); reader.next(); assertEquals(reader.getSymbolTable().findSymbol("burrito"), 16); }

Target:
public void testLocalSymbolTableAppend() throws Exception { writer.writeSymbol("taco"); writer.flush(); writer.writeSymbol("burrito"); writer.finish(); IonReader reader = system().newReader(writer.getBytes()); reader.next(); assertEquals(reader.getSymbolTable().findSymbol("taco"), 15); assertEquals(reader.getSymbolTable().findSymbol("burrito"), -1); reader.next(); assertEquals(reader.getSymbolTable().findSymbol("taco"), 15); assertEquals(reader.getSymbolTable().findSymbol("burrito"), 16); }
Source:
private static void validateName(String name) { if (name == null) { throw new IllegalArgumentException("null bucket name"); } if (name.length() < 3 || name.length() > 63) { throw new IllegalArgumentException( name + " : " + "bucket name must be at least 3 and no more than 63 characters long"); } if (name.contains("..")) { String msg = "bucket name cannot contain successive periods. For more information refer " + "<LINK_0>"; throw new IllegalArgumentException(name + " : " + msg); } if (!name.matches("^[a-z0-9][a-z0-9\\.\\-]+[a-z0-9]$")) { String msg = "bucket name does not follow Amazon S3 standards. For more information refer " + "<LINK_0>"; throw new IllegalArgumentException(name + " : " + msg); } }

Target:
private void validateName(String name) { if (name == null) { throw new IllegalArgumentException("null bucket name"); } if (name.length() < 3 || name.length() > 63) { throw new IllegalArgumentException( name + " : " + "bucket name must be at least 3 and no more than 63 characters long"); } if (name.contains("..")) { String msg = "bucket name cannot contain successive periods. For more information refer " + "<LINK_0>"; throw new IllegalArgumentException(name + " : " + msg); } if (!name.matches("^[a-z0-9][a-z0-9\\.\\-]+[a-z0-9]$")) { String msg = "bucket name does not follow Amazon S3 standards. For more information refer " + "<LINK_0>"; throw new IllegalArgumentException(name + " : " + msg); } }
Source:
public boolean hasFullNumberPrecision() { return true; }

Target:
public boolean hasFullNumberPrecision() { return false; }
Source:
public boolean test() throws Exception { ImageHelper blueish = ImageHelper.grabImage(fRect); if (blueish == null) { fFailureMessage = "Image is null"; return false; } Multiset<RGB> histogram = blueish.getHistogram(); for (RGB rgb : fRgbs) { if (histogram.count(rgb) <= 0) { fFailureMessage = "Color not found: " + rgb; } } return true; }

Target:
public boolean test() throws Exception { ImageHelper image = ImageHelper.grabImage(fRect); if (image == null) { fFailureMessage = "Grabbed image is null"; return false; } Multiset<RGB> histogram = image.getHistogram(); for (RGB rgb : fRgbs) { if (histogram.count(rgb) <= 0) { fFailureMessage = "Color not found: " + rgb; return false; } } return true; }