auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public AuthUser authenticate(final AuthRequest request) throws AuthException { List<AuthUser> authUsers = Lists.newArrayList(); List<AuthException> authExs = Lists.newArrayList(); for (AuthBackend backend : authBackends) { try { authUsers.add(backend.authenticate(request)); } catch (MissingCredentialsException ex) { } catch (AuthException ex) { authExs.add(ex); } } if (authExs.isEmpty() && authUsers.isEmpty()) { throw new MissingCredentialsException(); } else if (authExs.isEmpty() && authUsers.size() == 1) { return authUsers.get(0); } else if (authExs.size() == 1 && authUsers.isEmpty()) { throw authExs.get(0); } String msg = String.format("Multiple AuthBackends attempted to handle request:" + " authUsers=%s authExs=%s", authUsers, authExs); throw new AuthException(msg); }

Target:
public AuthUser authenticate(final AuthRequest request) throws AuthException { List<AuthUser> authUsers = Lists.newArrayList(); List<AuthException> authExs = Lists.newArrayList(); for (AuthBackend backend : authBackends) { try { authUsers.add(checkNotNull(backend.authenticate(request))); } catch (MissingCredentialsException ex) { } catch (AuthException ex) { authExs.add(ex); } } if (authExs.isEmpty() && authUsers.isEmpty()) { throw new MissingCredentialsException(); } else if (authExs.isEmpty() && authUsers.size() == 1) { return authUsers.get(0); } else if (authExs.size() == 1 && authUsers.isEmpty()) { throw authExs.get(0); } String msg = String.format("Multiple AuthBackends attempted to handle request:" + " authUsers=%s authExs=%s", authUsers, authExs); throw new AuthException(msg); }
Source:
public void close() throws Exception { shutdown(); }

Target:
public void close() { shutdown(); }
Source:
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) { CallGraphAnalysis fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphAnalysis.ID); if (fModule == null) { return null; } fModule.schedule(); Job job = new Job(Messages.CallStackTableViewer_name) { @Override protected IStatus run(IProgressMonitor monitor) { fModule.waitForCompletion(NonNullUtils.checkNotNull(monitor)); if(monitor.isCanceled()) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; } }; job.schedule(); return fModule; }

Target:
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) { CallGraphAnalysis fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphAnalysis.ID); if (fModule == null) { return null; } fModule.schedule(); Job job = new Job(Messages.CallGraphAnalysis) { @Override protected IStatus run(IProgressMonitor monitor) { fModule.waitForCompletion(NonNullUtils.checkNotNull(monitor)); if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; } }; job.schedule(); return fModule; }
Source:
public AndroidBluetoothPlatform(Context ctx) { context = ctx; permissionChecker = new PermissionChecker(ctx); if (BluetoothAdapter.getDefaultAdapter() != null) { bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); } if (Build.VERSION.SDK_INT >= 18) { crashCallBackWrapper = new CrashCallBackWrapper(ctx); } else { crashCallBackWrapper = null; } }

Target:
public AndroidBluetoothPlatform(Context ctx) { context = ctx; permissionChecker = new PermissionChecker(ctx); bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (Build.VERSION.SDK_INT >= 18) { crashCallBackWrapper = new CrashCallBackWrapper(ctx); } else { crashCallBackWrapper = null; } }
Source:
private void logIngestException(IngestException exception, File inputFile) { LOGGER.debug("Failed to ingest file [{}].", inputFile.getAbsolutePath(), exception); if (INGEST_LOGGER.isWarnEnabled()) { INGEST_LOGGER.warn("\nFailed to ingest file [{}]: \n" + Exceptions.getFullMessage(exception), inputFile.getAbsolutePath()); } }

Target:
private void logIngestException(IngestException exception, File inputFile) { LOGGER.debug("Failed to ingest file [{}].", inputFile.getAbsolutePath(), exception); INGEST_LOGGER.warn("Failed to ingest file [{}]: \n{}", inputFile.getAbsolutePath(), Exceptions.getFullMessage(exception)); }
Source:
private void updateData(@NonNull TimeQueryFilter filters, IProgressMonitor monitor) { if (fXYDataProvider == null) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, "Data provider for this viewer is not available"); return; } boolean isComplete = false; do { TmfModelResponse<ITmfCommonXAxisModel> response = fXYDataProvider.fetchXY(filters, monitor); ITmfCommonXAxisModel model = response.getModel(); if (model != null) { updateDisplay(model); } ITmfResponse.Status status = response.getStatus(); if (status == ITmfResponse.Status.COMPLETED) { isComplete = true; } else if (status == ITmfResponse.Status.FAILED || status == ITmfResponse.Status.CANCELLED) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, String.valueOf(response.getStatusMessage())); isComplete = true; } else { try { Thread.sleep(BUILD_UPDATE_TIMEOUT); } catch (InterruptedException e) { TraceCompassLogUtils.traceInstant(LOGGER, Level.INFO, e.getMessage()); isComplete = true; } } } while (!isComplete); }

Target:
private void updateData(@NonNull TimeQueryFilter filters, IProgressMonitor monitor) { if (fXYDataProvider == null) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, "Data provider for this viewer is not available"); return; } boolean isComplete = false; do { TmfModelResponse<ITmfCommonXAxisModel> response = fXYDataProvider.fetchXY(filters, monitor); ITmfCommonXAxisModel model = response.getModel(); if (model != null) { updateDisplay(model); } ITmfResponse.Status status = response.getStatus(); if (status == ITmfResponse.Status.COMPLETED) { isComplete = true; } else if (status == ITmfResponse.Status.FAILED || status == ITmfResponse.Status.CANCELLED) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, response.getStatusMessage()); isComplete = true; } else { try { Thread.sleep(BUILD_UPDATE_TIMEOUT); } catch (InterruptedException e) { TraceCompassLogUtils.traceInstant(LOGGER, Level.INFO, e.getMessage()); } } } while (!isComplete); }
Source:
public void test01_02_ByteMin_invalid() { click(By.linkText("@ByteMin Test")); setText(By.id("userName"), "あいu"); click(By.id("btn_validate")); assertThat(getText(By.id("userName.errors")), is("must be grater than or equal 6 Bytes")); }

Target:
public void test01_02_ByteMin_invalid() { driver.findElement(By.linkText("@ByteMin Test")).click(); inputFieldAccessor.overrideValue(By.id("userName"), "あいu", driver); driver.findElement(By.id("btn_validate")).click(); assertThat(driver.findElement(By.id("userName.errors")).getText(), is("must be greater than or equal to 6 Bytes")); }
Source:
public void testRemoveRange() { List<Integer> list = new ArrayList<Integer>(); list.add(1); Collection<Integer> result = CollectionUtils.removeRange(list, 0, 0); assertEquals(1, list.size()); assertEquals(0, result.size()); list.add(2); list.add(3); result = CollectionUtils.removeRange(list, 1, 3); assertEquals(1, list.size()); assertEquals(1, (int) list.get(0)); assertEquals(2, result.size()); assertTrue(result.contains(2)); assertTrue(result.contains(3)); }

Target:
public void testRemoveRange() { List<Integer> list = new ArrayList<>(); list.add(1); Collection<Integer> result = CollectionUtils.removeRange(list, 0, 0); assertEquals(1, list.size()); assertEquals(0, result.size()); list.add(2); list.add(3); result = CollectionUtils.removeRange(list, 1, 3); assertEquals(1, list.size()); assertEquals(1, (int) list.get(0)); assertEquals(2, result.size()); assertTrue(result.contains(2)); assertTrue(result.contains(3)); }
Source:
protected UnimprovedTimeMillisSpentScoreDifferenceThresholdTermination(long unimprovedTimeMillisSpentLimit, Score unimprovedScoreDifferenceThreshold, Clock clock) { this.unimprovedTimeMillisSpentLimit = unimprovedTimeMillisSpentLimit; this.unimprovedScoreDifferenceThreshold = unimprovedScoreDifferenceThreshold; if (unimprovedTimeMillisSpentLimit <= 0L) { throw new IllegalArgumentException("The unimprovedTimeMillisSpentLimit (" + unimprovedTimeMillisSpentLimit + ") cannot be negative."); } this.clock = clock; }

Target:
protected UnimprovedTimeMillisSpentScoreDifferenceThresholdTermination( long unimprovedTimeMillisSpentLimit, Score unimprovedScoreDifferenceThreshold, Clock clock) { this.unimprovedTimeMillisSpentLimit = unimprovedTimeMillisSpentLimit; this.unimprovedScoreDifferenceThreshold = unimprovedScoreDifferenceThreshold; if (unimprovedTimeMillisSpentLimit < 0L) { throw new IllegalArgumentException("The unimprovedTimeMillisSpentLimit (" + unimprovedTimeMillisSpentLimit + ") cannot be negative."); } this.clock = clock; }
Source:
public @Nonnull ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { if (!Prep.isInvalid(stack)) { IoMode mode = getIoMode(side); if (mode != IoMode.PUSH && mode != IoMode.DISABLED) { return getInventory().getView(EnderInventory.Type.INPUT).insertItem(slot, stack, simulate); } } return ItemStack.EMPTY; }

Target:
public @Nonnull ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { if (!Prep.isInvalid(stack)) { IoMode mode = getIoMode(side); if (mode.canRecieveInput()) { return getInventory().getView(EnderInventory.Type.INPUT).insertItem(slot, stack, simulate); } } return ItemStack.EMPTY; }
Source:
public NodeMetadata apply(InstanceInZone instanceInZone) { Instance input = instanceInZone.getInstance(); Map<URI, ? extends Image> imagesMap = images.get(); Image image = checkNotNull(imagesMap.get(checkNotNull(input.getImage(), "image")), "no image for %s. images: %s", input.getImage(), imagesMap.values()); return new NodeMetadataBuilder() .id(SlashEncodedIds.fromTwoIds(checkNotNull(locations.get().get(input.getZone()), "location for %s", input.getZone()).getId(), input.getName()).slashEncode()) .name(input.getName()) .providerId(input.getId()) .hostname(input.getName()) .imageId(image.getId()) .location(checkNotNull(locations.get().get(input.getZone()), "location for %s", input.getZone())) .hardware(checkNotNull(hardwares.get().get(input.getMachineType()), "hardware type for %s", input.getMachineType().toString())) .operatingSystem(image.getOperatingSystem()) .status(toPortableNodeStatus.get(input.getStatus())) .tags(input.getTags().getTags()) .uri(input.getSelfLink()) .userMetadata(input.getMetadata()) .group(nodeNamingConvention.groupInUniqueNameOrNull(input.getName())) .privateAddresses(collectPrivateAddresses(input)) .publicAddresses(collectPublicAddresses(input)) .build(); }

Target:
public NodeMetadata apply(InstanceInZone instanceInZone) { Instance input = instanceInZone.getInstance(); Map<URI, ? extends Image> imagesMap = images.get(); Image image = checkNotNull(imagesMap.get(checkNotNull(input.getImage(), "image")), "no image for %s. images: %s", input.getImage(), imagesMap.values()); return new NodeMetadataBuilder() .id(SlashEncodedIds.fromTwoIds(checkNotNull(locations.get().get(input.getZone()), "location for %s", input.getZone()).getId(), input.getName()).slashEncode()) .name(input.getName()) .providerId(input.getId()) .hostname(input.getName()) .imageId(image.getId()) .location(checkNotNull(locations.get().get(input.getZone()), "location for %s", input.getZone())) .hardware(checkNotNull(hardwares.get().get(input.getMachineType()), "hardware type for %s", input.getMachineType().toString())) .operatingSystem(image.getOperatingSystem()) .status(toPortableNodeStatus.get(input.getStatus())) .tags(input.getTags().getItems()) .uri(input.getSelfLink()) .userMetadata(input.getMetadata()) .group(nodeNamingConvention.groupInUniqueNameOrNull(input.getName())) .privateAddresses(collectPrivateAddresses(input)) .publicAddresses(collectPublicAddresses(input)) .build(); }
Source:
private RemoteConfigurationRegistryClient createClient(RemoteConfigurationRegistryConfig config) { ACLProvider aclProvider; if (config.isSecureRegistry()) { configureSasl(config); if (!StringUtils.isBlank(config.getAuthType()) && config .getAuthType().equalsIgnoreCase("Kerberos") && !config .isBackwardsCompatible()) { aclProvider = new SASLOwnerACLProvider(true); } else { aclProvider = new SASLOwnerACLProvider(false); } } else { System.clearProperty(LOGIN_CONTEXT_NAME_PROPERTY); aclProvider = new DefaultACLProvider(); } CuratorFramework client = CuratorFrameworkFactory.builder() .connectString(config.getConnectionString()) .retryPolicy(new ExponentialBackoffRetry(1000, 3)) .aclProvider(aclProvider) .build(); client.start(); return (new ClientAdapter(client, config)); }

Target:
private RemoteConfigurationRegistryClient createClient(RemoteConfigurationRegistryConfig config) { ACLProvider aclProvider; if (config.isSecureRegistry()) { configureSasl(config); if(AUTH_TYPE_KERBEROS.equalsIgnoreCase(config.getAuthType()) && !config.isBackwardsCompatible()) { aclProvider = new SASLOwnerACLProvider(true); } else { aclProvider = new SASLOwnerACLProvider(false); } } else { System.clearProperty(LOGIN_CONTEXT_NAME_PROPERTY); aclProvider = new DefaultACLProvider(); } CuratorFramework client = CuratorFrameworkFactory.builder() .connectString(config.getConnectionString()) .retryPolicy(new ExponentialBackoffRetry(1000, 3)) .aclProvider(aclProvider) .build(); client.start(); return (new ClientAdapter(client, config)); }
Source:
public DefaultKfsAccountForAwsResultWrapper getDefaultKfsAccountForAwsResultWrapper() throws URISyntaxException, IOException { String defaultAccountUrl = findDefaultAccountServiceEndPoint(); Response response = null; try { Invocation request = buildClientRequest(defaultAccountUrl, findDefaultAccountServiceXApiKey()); response = request.invoke(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(DefaultKfsAccountForAwsResultWrapper.class); } else { LOG.error("getDefaultKfsAccountForAwsResultWrapper, error calling enpoint. The HTTP response was " + response.getStatus()); throw new IOException("Invalid response code: " + response.getStatus()); } } finally { CURestClientUtils.closeQuietly(response); } }

Target:
public DefaultKfsAccountForAwsResultWrapper getDefaultKfsAccountForAwsResultWrapper() throws URISyntaxException, IOException { String defaultAccountUrl = findDefaultAccountServiceEndPoint(); Response response = null; try { Invocation request = buildClientRequest(defaultAccountUrl, findDefaultAccountServiceXApiKey()); response = request.invoke(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(DefaultKfsAccountForAwsResultWrapper.class); } else { LOG.error("getDefaultKfsAccountForAwsResultWrapper, error calling endpoint. The HTTP response was " + response.getStatus()); throw new IOException("Invalid response code: " + response.getStatus()); } } finally { CURestClientUtils.closeQuietly(response); } }
Source:
public static String formatTime(long time, TimeFormat format, Resolution resolution) { switch (format) { case CALENDAR: return formatTimeAbs(time, resolution); case NUMBER: return NumberFormat.getInstance().format(time); case CYCLES: return NumberFormat.getInstance().format(time) + Messages.Utils_ClockCyclesUnit; case RELATIVE: return formatTimeRelative(time, resolution); default: } StringBuilder str = new StringBuilder(); long t = time; boolean neg = t < 0; if (neg) { t = -t; str.append('-'); } long sec = t / SEC_IN_NS; str.append(sec); String ns = formatNs(t, resolution); if (!ns.equals("")) { str.append('.'); str.append(ns); } return str.toString(); }

Target:
public static String formatTime(long time, TimeFormat format, Resolution resolution) { switch (format) { case CALENDAR: return formatTimeAbs(time, resolution); case NUMBER: return NumberFormat.getInstance().format(time); case CYCLES: return NumberFormat.getInstance().format(time) + Messages.Utils_ClockCyclesUnit; case RELATIVE: return formatTimeRelative(time, resolution); default: } StringBuilder str = new StringBuilder(); long t = time; boolean neg = t < 0; if (neg) { t = -t; str.append('-'); } long sec = t / SEC_IN_NS; str.append(sec); String ns = formatNs(t, resolution); if (!ns.isEmpty()) { str.append('.'); str.append(ns); } return str.toString(); }
Source:
public static List<File> unzipFiles(File zippedfile, String destPath, IProgressMonitor monitor) throws FileNotFoundException, IOException { try (ZipFile zipFile = new ZipFile(zippedfile)) { Enumeration<? extends ZipEntry> entries = zipFile.entries(); List<File> outputFiles = new ArrayList<File>(); File destinationFile = new File(destPath); if (!destinationFile.exists()) { destinationFile.mkdirs(); } while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); File outputFile = new File(destinationFile, entry.getName()); if (entry.isDirectory() && !outputFile.exists()) { outputFile.mkdirs(); continue; } if (!outputFile.getParentFile().exists()) { outputFile.getParentFile().mkdirs(); } try (InputStream inputStream = new BufferedInputStream(zipFile.getInputStream(entry))) { try (OutputStream outStream = new BufferedOutputStream(new FileOutputStream(outputFile))) { copyStream(inputStream, outStream); } } outputFiles.add(outputFile); if (monitor != null) { monitor.worked(1); } } return outputFiles; } }

Target:
public static List<File> unzipFiles(File zippedfile, String destPath, IProgressMonitor monitor) throws FileNotFoundException, IOException { try (ZipFile zipFile = new ZipFile(zippedfile)) { Enumeration<? extends ZipEntry> entries = zipFile.entries(); List<File> outputFiles = new ArrayList<File>(); File destinationFile = new File(destPath); if (!destinationFile.exists()) { destinationFile.mkdirs(); } while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); File outputFile = new File(destinationFile, entry.getName()); if (entry.isDirectory() && !outputFile.exists()) { outputFile.mkdirs(); continue; } if (!outputFile.getParentFile().exists()) { outputFile.getParentFile().mkdirs(); } try (InputStream inputStream = new BufferedInputStream(zipFile.getInputStream(entry)); OutputStream outStream = new BufferedOutputStream(new FileOutputStream(outputFile))) { copyStream(inputStream, outStream); } outputFiles.add(outputFile); if (monitor != null) { monitor.worked(1); } } return outputFiles; } }
Source:
public S3PublishHelper(S3Configuration s3, boolean verbose) { super(s3.isCompressionEnabled(), verbose); this.client = (AmazonS3Client)buildClient( s3.getAccessKey(), s3.getSecretKey(), s3.getSessionToken(), s3.getRegion(), s3.getServiceEndpoint(), s3.getSigningRegion() ); this.bucket = s3.getBucket().toLowerCase(); String path = s3.getPath(); if (path != null && !path.isEmpty()) { if (!path.endsWith("/")) { this.path = path + "/"; } else { this.path = path; } } else { this.path = null; } this.sseConfig = s3.getSseConfiguration(); }

Target:
public S3PublishHelper(S3Configuration s3, boolean verbose) { super(s3.isCompressionEnabled(), verbose); this.client = (AmazonS3Client)buildClient( s3.getAccessKey(), s3.getSecretKey(), s3.getSessionToken(), s3.getRegion(), s3.getServiceEndpoint(), s3.getSigningRegion() ); this.bucket = s3.getBucket().toLowerCase(); String path = s3.getPath(); if (StringUtils.isTruthy(path)) { if (!path.endsWith("/")) { this.path = path + "/"; } else { this.path = path; } } else { this.path = null; } this.sseConfig = s3.getSseConfiguration(); }
Source:
protected void execute() { if (connector != null) connector.refresh(); }

Target:
protected void execute() { if (connector != null) { connector.refresh(); } }
Source:
public void testMigrationThroughService() { CommentManager commentManager; commentManager = Framework.getService(CommentManager.class); assertTrue(commentManager.getClass().getName(), commentManager instanceof CommentManagerImpl); MigrationService.MigrationStatus status = migrationService.getStatus(MIGRATION_ID); assertNotNull(status); assertFalse(status.isRunning()); assertEquals(MIGRATION_STATE_RELATION, status.getState()); runMigration(() -> { migrationService.runStep(MIGRATION_ID, MIGRATION_STEP_RELATION_TO_PROPERTY); await().atLeast(1, SECONDS); await().pollInterval(1, SECONDS).until(() -> !migrationService.getStatus(MIGRATION_ID).isRunning()); }); commentManager = Framework.getService(CommentManager.class); assertTrue(commentManager.getClass().getName(), commentManager instanceof PropertyCommentManager); status = migrationService.getStatus(MIGRATION_ID); assertNotNull(status); assertFalse(status.isRunning()); assertEquals(MIGRATION_STATE_PROPERTY, status.getState()); }

Target:
public void testMigrationThroughService() { CommentManager commentManager; commentManager = Framework.getService(CommentManager.class); assertTrue(commentManager.getClass().getName(), commentManager instanceof CommentManagerImpl); MigrationService.MigrationStatus status = migrationService.getStatus(MIGRATION_ID); assertNotNull(status); assertFalse(status.isRunning()); assertEquals(MIGRATION_STATE_RELATION, status.getState()); testMigration(() -> { migrationService.runStep(MIGRATION_ID, MIGRATION_STEP_RELATION_TO_PROPERTY); sleep(1000); long deadline = System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(1); while (System.currentTimeMillis() < deadline) { if (!migrationService.getStatus(MIGRATION_ID).isRunning()) { break; } sleep(100); } }); commentManager = Framework.getService(CommentManager.class); assertTrue(commentManager.getClass().getName(), commentManager instanceof PropertyCommentManager); status = migrationService.getStatus(MIGRATION_ID); assertNotNull(status); assertFalse(status.isRunning()); assertEquals(MIGRATION_STATE_PROPERTY, status.getState()); }
Source:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitFunctionOrMethodDeclaration(@NotNull GoFunctionOrMethodDeclaration o) { super.visitFunctionOrMethodDeclaration(o); check(o.getSignature(), o.getBlock(), holder); } @Override public void visitFunctionLit(@NotNull GoFunctionLit o) { super.visitFunctionLit(o); check(o.getSignature(), o.getBlock(), holder); } }; }

Target:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitFunctionOrMethodDeclaration(@NotNull GoFunctionOrMethodDeclaration o) { check(o.getSignature(), o.getBlock(), holder); } @Override public void visitFunctionLit(@NotNull GoFunctionLit o) { check(o.getSignature(), o.getBlock(), holder); } }; }
Source:
ProcessorContextImpl(final TaskId id, final StreamTask streamTask, final StreamsConfig config, final RecordCollector collector, final ProcessorStateManager stateMgr, final StreamsMetricsImpl metrics, final ThreadCache cache) { super(id, config, metrics, stateMgr, cache); this.streamTask = streamTask; this.collector = collector; }

Target:
ProcessorContextImpl(final TaskId id, final StreamTask streamTask, final StreamsConfig config, final RecordCollector collector, final ProcessorStateManager stateMgr, final StreamsMetricsImpl metrics, final ThreadCache cache) { super(id, config, metrics, stateMgr, cache); this.streamTask = streamTask; this.collector = collector; if (streamTask == null && taskType() == TaskType.ACTIVE) { throw new IllegalStateException("Tried to create context for active task but the streamtask was null"); } }
Source:
public void registerTracerBean(@Observes AfterBeanDiscovery abd) { abd.addBean().addTransitiveTypeClosure(Tracer.class).produceWith(i -> { ClassLoader loader; if (!WildFlySecurityManager.isChecking()) { loader = Thread.currentThread().getContextClassLoader(); } else { loader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { @Override public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } }); } return TRACERS.get(loader); }); }

Target:
public void registerTracerBean(@Observes AfterBeanDiscovery abd) { abd.addBean().addTransitiveTypeClosure(Tracer.class).produceWith(i -> { return TRACERS.get(WildFlySecurityManager.getCurrentContextClassLoaderPrivileged()); }); }
Source:
public static ExtensionsManager getInstance() { if (instance == null) { synchronized (EngineExtensionsManager.class) { if (instance == null) { instance = new ExtensionsManager(); instance.getGlobalContext().put(Base.GlobalContextKeys.APPLICATION_NAME, Base.ApplicationNames.OVIRT_ENGINE); createInternalAAAConfigurations(); createKerberosLdapAAAConfigurations(); for (File directory : EngineLocalConfig.getInstance().getExtensionsDirectories()) { if (!directory.exists()) { log.warn(String.format("The directory '%1$s' cotaning configuration files does not exist.", directory.getAbsolutePath())); } else { File[] files = directory.listFiles(); if (files != null) { sort(files); for (File file : files) { if (file.getName().endsWith(".properties")) { instance.load(file); } } } } } for (ExtensionProxy extension : instance.getExtensions()) { if (EngineLocalConfig.getInstance().getBoolean(ENGINE_EXTENSION_ENABLED + extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME), true)) { try { instance.activate( extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME), EngineLocalConfig.getInstance().getBoolean( ENGINE_EXTENSION_ENABLED + extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME) ) ); } catch (Exception ex) { log.error(ex.getMessage()); log.debug(ex); } } } } } } instance.dump(); return instance; }

Target:
public static ExtensionsManager getInstance() { if (instance == null) { synchronized (EngineExtensionsManager.class) { if (instance == null) { instance = new ExtensionsManager(); instance.getGlobalContext().put(Base.GlobalContextKeys.APPLICATION_NAME, Base.ApplicationNames.OVIRT_ENGINE); createInternalAAAConfigurations(); createKerberosLdapAAAConfigurations(); for (File directory : EngineLocalConfig.getInstance().getExtensionsDirectories()) { if (!directory.exists()) { log.warn(String.format("The directory '%1$s' cotaning configuration files does not exist.", directory.getAbsolutePath())); } else { File[] files = directory.listFiles(); if (files != null) { sort(files); for (File file : files) { if (file.getName().endsWith(".properties")) { instance.load(file); } } } } } for (ExtensionProxy extension : instance.getLoadedExtensions()) { if (EngineLocalConfig.getInstance().getBoolean( ENGINE_EXTENSION_ENABLED + extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME), Boolean.parseBoolean( extension.getContext().<Properties>get(Base.ContextKeys.CONFIGURATION).getProperty(Base.ConfigKeys.ENABLED,"true") ) )) { instance.initialize(extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME)); } } } } } instance.dump(); return instance; }
Source:
public boolean equals(Object o) { return true; }

Target:
public boolean equals(Object o) { return o != null && o instanceof IdentityExtractionFn; }
Source:
public void destroyPersistenceContext(Object identifier) throws CachePersistenceException { String stringIdentifier = validateIdentifier(identifier); FileBasedPersistenceContext persistenceContext = knownPersistenceContexts.remove(stringIdentifier); if (persistenceContext == null) { throw new CachePersistenceException("Identifier " + identifier + " not known to this persistence service"); } else { destroy(stringIdentifier, persistenceContext, true); } }

Target:
public void destroyPersistenceContext(Object identifier) throws CachePersistenceException { String stringIdentifier = validateIdentifier(identifier); FileBasedPersistenceContext persistenceContext = knownPersistenceContexts.remove(stringIdentifier); if (persistenceContext == null) { destroy(stringIdentifier, new DefaultFileBasedPersistenceContext(getDirectoryFor(stringIdentifier)), true); } else { destroy(stringIdentifier, persistenceContext, true); } }
Source:
public void gatewayDiagnostics() { CosmosClient gatewayClient = null; try { gatewayClient = new CosmosClientBuilder() .endpoint(TestConfigurations.HOST) .key(TestConfigurations.MASTER_KEY) .contentResponseOnWriteEnabled(true) .gatewayMode() .buildClient(); CosmosContainer container = gatewayClient.getDatabase(cosmosAsyncContainer.getDatabase().getId()).getContainer(cosmosAsyncContainer.getId()); InternalObjectNode internalObjectNode = getInternalObjectNode(); CosmosItemResponse<InternalObjectNode> createResponse = container.createItem(internalObjectNode); String diagnostics = createResponse.getDiagnostics().toString(); assertThat(diagnostics).contains("\"connectionMode\":\"GATEWAY\""); assertThat(diagnostics).doesNotContain(("\"gatewayStatistics\":null")); assertThat(diagnostics).contains("\"operationType\":\"Create\""); assertThat(diagnostics).contains("\"metaDataName\":\"CONTAINER_LOOK_UP\""); assertThat(diagnostics).contains("\"serializationType\":\"PARTITION_KEY_FETCH_SERIALIZATION\""); assertThat(diagnostics).contains("\"userAgent\":\"" + Utils.getUserAgent() + "\""); assertThat(createResponse.getDiagnostics().getDuration()).isNotNull(); validateTransportRequestTimelineGateway(diagnostics); validateJson(diagnostics); } finally { if (gatewayClient != null) { gatewayClient.close(); } } }

Target:
public void gatewayDiagnostics() { CosmosClient testGatewayClient = null; try { testGatewayClient = new CosmosClientBuilder() .endpoint(TestConfigurations.HOST) .key(TestConfigurations.MASTER_KEY) .contentResponseOnWriteEnabled(true) .gatewayMode() .buildClient(); CosmosContainer container = testGatewayClient.getDatabase(cosmosAsyncContainer.getDatabase().getId()).getContainer(cosmosAsyncContainer.getId()); InternalObjectNode internalObjectNode = getInternalObjectNode(); CosmosItemResponse<InternalObjectNode> createResponse = container.createItem(internalObjectNode); String diagnostics = createResponse.getDiagnostics().toString(); assertThat(diagnostics).contains("\"connectionMode\":\"GATEWAY\""); assertThat(diagnostics).doesNotContain(("\"gatewayStatistics\":null")); assertThat(diagnostics).contains("\"operationType\":\"Create\""); assertThat(diagnostics).contains("\"metaDataName\":\"CONTAINER_LOOK_UP\""); assertThat(diagnostics).contains("\"serializationType\":\"PARTITION_KEY_FETCH_SERIALIZATION\""); assertThat(diagnostics).contains("\"userAgent\":\"" + Utils.getUserAgent() + "\""); assertThat(createResponse.getDiagnostics().getDuration()).isNotNull(); validateTransportRequestTimelineGateway(diagnostics); validateJson(diagnostics); } finally { if (testGatewayClient != null) { testGatewayClient.close(); } } }
Source:
private Optional<InsightCard.Category> generateNewUserInsights(final Long accountId, final DeviceId deviceId, final int accountAge, final DeviceDataInsightQueryDAO deviceDataInsightQueryDAO) { final Set<InsightCard.Category> recentCategories = this.getRecentInsightsCategories(accountId); InsightCard.Category categoryToGenerate; switch (accountAge) { case 1: categoryToGenerate = InsightCard.Category.LIGHT; break; case 2: categoryToGenerate = InsightCard.Category.SLEEP_QUALITY; break; default: return Optional.absent(); } if (recentCategories.contains(categoryToGenerate)) { return Optional.absent(); } LOGGER.debug("Trying to generate category insight for new user accountId {}", categoryToGenerate, accountId); final Optional<InsightCard.Category> generatedNewUserCategory = this.generateInsightsByCategory(accountId, deviceId, deviceDataInsightQueryDAO, categoryToGenerate); if (generatedNewUserCategory.isPresent()) { LOGGER.debug("Successfully generated category insight for new user accountId {}", generatedNewUserCategory.get(), accountId); return generatedNewUserCategory; } return Optional.absent(); }

Target:
private Optional<InsightCard.Category> generateNewUserInsights(final Long accountId, final DeviceId deviceId, final int accountAge, final DeviceDataInsightQueryDAO deviceDataInsightQueryDAO) { final Set<InsightCard.Category> recentCategories = this.getRecentInsightsCategories(accountId); InsightCard.Category categoryToGenerate; switch (accountAge) { case 1: categoryToGenerate = InsightCard.Category.LIGHT; break; case 2: categoryToGenerate = InsightCard.Category.TEMPERATURE; break; case 3: categoryToGenerate = InsightCard.Category.SLEEP_QUALITY; break; default: return Optional.absent(); } if (recentCategories.contains(categoryToGenerate)) { return Optional.absent(); } LOGGER.debug("Trying to generate category insight for new user accountId {}", categoryToGenerate, accountId); final Optional<InsightCard.Category> generatedNewUserCategory = this.generateInsightsByCategory(accountId, deviceId, deviceDataInsightQueryDAO, categoryToGenerate); if (generatedNewUserCategory.isPresent()) { LOGGER.debug("Successfully generated category insight for new user accountId {}", generatedNewUserCategory.get(), accountId); return generatedNewUserCategory; } return Optional.absent(); }
Source:
public void platformMotionDownAABBTest() { Level check = new Level(emptyPlayer, emptyUnit, new Grid<>(Arrays.asList( Cell.WALL, Cell.WALL, Cell.WALL, Cell.WALL, Cell.EMPTY, Cell.WALL, Cell.WALL, Cell.PLATFORM, Cell.WALL, Cell.WALL, Cell.WALL, Cell.WALL), 3, 4)); CollisionHandler handler = new CollisionHandler(check); Cell cell = handler.checkLevelAABB( new AABB(new Point(1, 1.1), new Point(2, 2.1)), new Point(0, 1)); assertFalse(cell.getType() == Cell.EMPTY); }

Target:
public void platformMotionDownAABBTest() { Level check = new Level(emptyPlayer, emptyUnit, new Grid<>(Arrays.asList( Cell.WALL, Cell.WALL, Cell.WALL, Cell.WALL, Cell.EMPTY, Cell.WALL, Cell.WALL, Cell.PLATFORM, Cell.WALL, Cell.WALL, Cell.WALL, Cell.WALL), 3, 4)); CollisionHandler handler = new CollisionHandler(check); Cell cell = handler.checkLevelAABB( new AABB(new Point(1, 1.1), new Point(2, 2.1)), new Point(0, 1)); assertNotEquals(cell, Cell.EMPTY); }
Source:
public Iterable<Listener<K, V>> getListeners() { return listeners; }

Target:
public List<Listener<K, V>> getListeners() { return Collections.unmodifiableList(listeners); }
Source:
public PlayerBackpack(@Nonnull PlayerProfile profile, int id, int size) { if (size < 9 || size > 54 || size % 9 != 0) { throw new IllegalArgumentException("Invalid size! Size must be one of: [9, 18, 27, 36, 45, 54]"); } this.profile = profile; this.id = id; this.cfg = profile.getConfig(); this.size = size; cfg.setValue(PlayerBackpack.backpacks + id + ".size", size); markDirty(); inventory = Bukkit.createInventory(null, size, "Backpack [" + size + " Slots]"); }

Target:
public PlayerBackpack(@Nonnull PlayerProfile profile, int id, int size) { if (size < 9 || size > 54 || size % 9 != 0) { throw new IllegalArgumentException("Invalid size! Size must be one of: [9, 18, 27, 36, 45, 54]"); } this.profile = profile; this.id = id; this.cfg = profile.getConfig(); this.size = size; cfg.setValue(CONFIG_PREFIX + id + ".size", size); markDirty(); inventory = Bukkit.createInventory(null, size, "Backpack [" + size + " Slots]"); }
Source:
private void applySubsetMultiThread(Path tmpDir, GoGoDuckModule module, int threadCount) throws GoGoDuckException { logger.info(String.format("Applying subset on directory '%s'", tmpDir)); File[] directoryListing = tmpDir.toFile().listFiles(); ExecutorService executorService = Executors.newFixedThreadPool(threadCount); List<String> ncksSubsetParameters = null; for (final File file : directoryListing) { if (ncksSubsetParameters == null) { ncksSubsetParameters = module.getNcksSubsetParameters(file.getAbsoluteFile().toString()).getNcksParameters(); logger.info(String.format("Subset for operation is '%s'", ncksSubsetParameters)); userLog.log(String.format("Applying subset '%s'", ncksSubsetParameters)); } executorService.submit(new NcksRunnable(file, module, this, ncksSubsetParameters)); } executorService.shutdown(); try { executorService.awaitTermination(MAX_EXECUTION_TIME_DAYS, TimeUnit.DAYS); } catch (InterruptedException e) { throw new GoGoDuckException("Task interrupted while waiting to complete", e); } }

Target:
private void applySubsetMultiThread(Path tmpDir, GoGoDuckModule module, int threadCount) throws GoGoDuckException { logger.info(String.format("Applying subset on directory '%s'", tmpDir)); List<String> ncksSubsetParameters; try { File[] directoryListing = tmpDir.toFile().listFiles(); if (directoryListing != null) { ExecutorService executorService = Executors.newFixedThreadPool(threadCount); for (File file : directoryListing) { ncksSubsetParameters = module.getSubsetParameters().getNcksParameters(); logger.info(String.format("Subset for operation is '%s'", ncksSubsetParameters)); userLog.log(String.format("Applying subset '%s'", ncksSubsetParameters)); executorService.submit(new NcksRunnable(file, module, this)); } executorService.shutdown(); executorService.awaitTermination(MAX_EXECUTION_TIME_DAYS, TimeUnit.DAYS); } else { throw new GoGoDuckException("No files available for sub-setting"); } } catch (InterruptedException e) { throw new GoGoDuckException("Task interrupted while waiting to complete", e); } catch (Exception e) { throw new GoGoDuckException(e.getMessage(), e); } }
Source:
protected void checkConverterAvailability(String converterName) { ConverterCheckResult check = cs.isConverterAvailable(converterName); assertNotNull(check); assertTrue(String.format( "Skipping %s tests since commandLine is not installed:\n" + "- installation message: %s\n- error message: %s", converterName, check.getInstallationMessage(), check.getErrorMessage()), check.isAvailable()); }

Target:
protected void checkConverterAvailability(String converterName) { ConverterCheckResult check = cs.isConverterAvailable(converterName); assertNotNull(check); assumeTrue(String.format( "Skipping %s tests since commandLine is not installed:\n" + "- installation message: %s\n- error message: %s", converterName, check.getInstallationMessage(), check.getErrorMessage()), check.isAvailable()); }
Source:
public void version(Actor actor) { actor.printInfo(TranslatableComponent.of("worldedit.version.version", TextComponent.of(WorldEdit.getVersion()))); actor.printInfo(TextComponent.of("<LINK_1>")); PlatformManager pm = we.getPlatformManager(); TextComponentProducer producer = new TextComponentProducer(); for (Platform platform : pm.getPlatforms()) { producer.append( TextComponent.of("* ", TextColor.GRAY) .append(TextComponent.of(platform.getPlatformName())) .append(TextComponent.of("(" + platform.getPlatformVersion() + ")")) ).newline(); } actor.print(new MessageBox("Platforms", producer, TextColor.GRAY).create()); producer.reset(); for (Capability capability : Capability.values()) { Platform platform = pm.queryCapability(capability); producer.append( TextComponent.of(capability.name(), TextColor.GRAY) .append(TextComponent.of(": ") .append(TextComponent.of(platform != null ? platform.getPlatformName() : "NONE"))) ).newline(); } actor.print(new MessageBox("Capabilities", producer, TextColor.GRAY).create()); }

Target:
public void version(Actor actor) { actor.printInfo(TranslatableComponent.of("worldedit.version.version", TextComponent.of(WorldEdit.getVersion()))); actor.printInfo(TextComponent.of("<LINK_0>")); PlatformManager pm = we.getPlatformManager(); TextComponentProducer producer = new TextComponentProducer(); for (Platform platform : pm.getPlatforms()) { producer.append( TextComponent.of("* ", TextColor.GRAY) .append(TextComponent.of(platform.getPlatformName())) .append(TextComponent.of("(" + platform.getPlatformVersion() + ")")) ).newline(); } actor.print(new MessageBox("Platforms", producer, TextColor.GRAY).create()); producer.reset(); for (Capability capability : Capability.values()) { Platform platform = pm.queryCapability(capability); producer.append( TextComponent.of(capability.name(), TextColor.GRAY) .append(TextComponent.of(": ") .append(TextComponent.of(platform != null ? platform.getPlatformName() : "NONE"))) ).newline(); } actor.print(new MessageBox("Capabilities", producer, TextColor.GRAY).create()); }
Source:
public void bind() { getOnStateChangeCallback().ifPresent(callback -> callback.accept(mUpdaterState.get())); mStateValidityEnsured.set(false); this.mUpdateEngine.bind(mUpdateEngineCallback); }

Target:
public void bind() { getOnStateChangeCallback().ifPresent(callback -> callback.accept(mUpdaterState.get())); mStateSynchronized.set(false); this.mUpdateEngine.bind(mUpdateEngineCallback); }
Source:
public void operationComplete(int rc, Void v) { if (rc == BKException.Code.OK) { authenticated = true; LOG.error("Authentication success on server side"); } else { LOG.debug("Authentication failed on server side"); } }

Target:
public void operationComplete(int rc, Void v) { if (rc == BKException.Code.OK) { authenticated = true; LOG.info("Authentication success on server side"); } else { LOG.debug("Authentication failed on server side"); } }
Source:
public Cursor getWordMatches(String query, String[] columns) { String selection = KEY_ADDRESS + " LIKE ?"; String[] selectionArgs = new String[] {"%" + query + "%"}; return query(selection, selectionArgs, columns); }

Target:
public final Cursor getWordMatches(String query, String[] columns) { String selection = KEY_ADDRESS + " LIKE ?"; String[] selectionArgs = new String[] {"%" + query + "%"}; return query(selection, selectionArgs, columns); }
Source:
public void testReassignNotCompletedWithBadTimeFormat() throws Exception { changeUser(USER_ADMINISTRATOR); Map<String, Object> parameters = new HashMap<>(); Long processInstanceId = null; try { processInstanceId = processClient.startProcess(CONTAINER_ID, PROCESS_ID_EVALUATION, parameters); List<TaskSummary> tasks = taskClient.findTasksAssignedAsBusinessAdministrator(USER_ADMINISTRATOR, 0, 10); TaskSummary task = tasks.get(0); OrgEntities reassign = OrgEntities.builder().users(Arrays.asList(USER_JOHN)).build(); assertExceptionContainsCorrectMessage(() -> userTaskAdminClient.reassignWhenNotCompleted(CONTAINER_ID, task.getId(), "2sssss", reassign) , "Error code: 500"); } finally { if (processInstanceId != null) { processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); } } }

Target:
public void testReassignNotCompletedWithBadTimeFormat() throws Exception { changeUser(USER_ADMINISTRATOR); Map<String, Object> parameters = new HashMap<>(); Long processInstanceId = null; try { processInstanceId = processClient.startProcess(CONTAINER_ID, PROCESS_ID_EVALUATION, parameters); List<TaskSummary> tasks = taskClient.findTasksAssignedAsBusinessAdministrator(USER_ADMINISTRATOR, 0, 10); TaskSummary task = tasks.get(0); OrgEntities reassign = OrgEntities.builder().users(Arrays.asList(USER_JOHN)).build(); assertExceptionContainsCorrectMessage(() -> userTaskAdminClient.reassignWhenNotCompleted(CONTAINER_ID, task.getId(), "2sssss", reassign) , "Error code: 400", "Error parsing time string:"); } finally { if (processInstanceId != null) { processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); } } }
Source:
public IncomingPhoneNumber searchNumber(String phone, Sid sourceOrganizationSid, Sid destinationOrganizationSid) { if (logger.isDebugEnabled()) { logger.debug("getMostOptimalIncomingPhoneNumber: " + phone + ",srcOrg:" + sourceOrganizationSid + ",destOrg:" + destinationOrganizationSid); } List<String> numberQueries = createPhoneQuery(phone); IncomingPhoneNumber numberfound = findByNumber(numberQueries, sourceOrganizationSid, destinationOrganizationSid); if (numberfound == null) { numberfound = findSingleNumber("*", sourceOrganizationSid, destinationOrganizationSid); if (numberfound == null) { if (destinationOrganizationSid != null && phone.matches("[\\d,*,#,+]+")) { numberfound = findByRegex(numberQueries, sourceOrganizationSid, destinationOrganizationSid); } } } return numberfound; }

Target:
public IncomingPhoneNumber searchNumber(String phone, Sid sourceOrganizationSid, Sid destinationOrganizationSid) { if (logger.isDebugEnabled()) { logger.debug("getMostOptimalIncomingPhoneNumber: " + phone + ",srcOrg:" + sourceOrganizationSid + ",destOrg:" + destinationOrganizationSid); } List<String> numberQueries = createPhoneQuery(phone); IncomingPhoneNumber numberfound = findByNumber(numberQueries, sourceOrganizationSid, destinationOrganizationSid); if (numberfound == null) { if (destinationOrganizationSid != null && destinationOrganizationSid.equals(sourceOrganizationSid) && phone.matches("[\\d,*,#,+]+")) { numberfound = findByRegex(numberQueries, sourceOrganizationSid, destinationOrganizationSid); } if (numberfound == null) { numberfound = findSingleNumber("*", sourceOrganizationSid, destinationOrganizationSid); } } return numberfound; }
Source:
public boolean isHighSpeedConnection() { return telephonyManager.getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS || telephonyManager.getNetworkType() == TelephonyManager.NETWORK_TYPE_HSUPA || telephonyManager.getNetworkType() == TelephonyManager.NETWORK_TYPE_HSPA || telephonyManager.getNetworkType() == TelephonyManager.NETWORK_TYPE_HSDPA || telephonyManager.getNetworkType() == TelephonyManager.NETWORK_TYPE_EVDO_0 || telephonyManager.getNetworkType() == TelephonyManager.NETWORK_TYPE_EVDO_A; }

Target:
public boolean isHighSpeedConnection() { final int networkType = telephonyManager.getNetworkType(); return networkType == TelephonyManager.NETWORK_TYPE_UMTS || networkType == TelephonyManager.NETWORK_TYPE_HSUPA || networkType == TelephonyManager.NETWORK_TYPE_HSPA || networkType == TelephonyManager.NETWORK_TYPE_HSDPA || networkType == TelephonyManager.NETWORK_TYPE_EVDO_0 || networkType == TelephonyManager.NETWORK_TYPE_EVDO_A; }
Source:
public void emitData(final I input) { if (generateEvent(input) != null) { outputEmitter.emitData(generateEvent(input)); } }

Target:
public void emitData(final I input) { MistDataEvent newInputEvent = generateEvent(input); if (newInputEvent != null) { outputEmitter.emitData(newInputEvent); } }
Source:
public ChatComponent addWith(JsonElement element) { $lock.writeLock().lock(); with.add(element); $lock.writeLock().unlock(); return this; }

Target:
public ChatComponent addWith(JsonElement element) { with.add(element); return this; }
Source:
public void justWorks() throws Exception { for (final String method:TkProxyTest.METHODS) { new FtRemote(new TkFixed("hello, world!")).exec( new FtRemote.Script() { @Override public void exec(final URI home) throws IOException { MatcherAssert.assertThat( new RsPrint( new TkProxy(home).act(new RqFake(method)) ).print(), Matchers.containsString("hello") ); } } ); } }

Target:
public void justWorks() throws Exception { new FtRemote(new TkFixed("hello, world!")).exec( new FtRemote.Script() { @Override public void exec(final URI home) throws IOException { MatcherAssert.assertThat( new RsPrint( new TkProxy(home).act(new RqFake("PUT")) ).print(), Matchers.containsString("hello") ); } } ); }
Source:
public CountryListAdapter(Context context) { super(context, R.layout.fui_dgts__country_row, android.R.id.text1); }

Target:
public CountryListAdapter(Context context) { super(context, R.layout.fui_dgts_country_row, android.R.id.text1); }
Source:
public void setIdName(final String idName) { if (Util.empty(idName)) { throw new IllegalArgumentException("idName cannot be null or empty"); } Matcher matcher = ID_PATTERN.matcher(idName); if (!matcher.matches()) { throw new IllegalArgumentException( "idName " + idName + " must start with a letter and followed by letters, digits and or underscores."); } if (getIdName() == null || !getIdName().equals(idName)) { ComponentModel model = getOrCreateComponentModel(); model.setIdName(idName); } }

Target:
public void setIdName(final String idName) { if (Util.empty(idName)) { throw new IllegalArgumentException("idName cannot be null or empty"); } Matcher matcher = ID_PATTERN.matcher(idName); if (!matcher.matches()) { throw new IllegalArgumentException( "idName " + idName + " must start with a letter and followed by letters, digits and or underscores."); } String currIdName = getIdName(); if (!Objects.equals(idName, currIdName)) { ComponentModel model = getOrCreateComponentModel(); model.setIdName(idName); } }