auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initMethods(Module moduleObject, JavaScriptModule module) throws ScriptException { String name = null; String className = null; String attribute; JavaScriptMethod method; List methodsList = moduleObject.getMethods(); Iterator itr = methodsList.iterator(); while (itr.hasNext()) { try { Method methodObject = (Method) itr.next(); name = methodObject.getName(); className = methodObject.getClassName(); attribute = methodObject.getReadOnly(); method = new JavaScriptMethod(name); method.setClazz(Class.forName(className)); method.setMethodName(name); if (attribute != null) { method.setAttribute(("true".equals(attribute)) ? ScriptableObject.READONLY : ScriptableObject.PERMANENT); } module.addMethod(method); } catch (ClassNotFoundException e) { String msg = "Error registering method. Class cannot be found, name : " + name + ", class : " + className; log.error(msg, e); } } }

Target:
private void initMethods(Module moduleObject, JavaScriptModule module) throws ScriptException { String name = null; String className = null; String attribute; JavaScriptMethod method; List methodsList = moduleObject.getMethods(); Iterator itr = methodsList.iterator(); while (itr.hasNext()) { try { Method methodObject = (Method) itr.next(); name = methodObject.getName(); className = methodObject.getClassName(); attribute = methodObject.getReadOnly(); method = new JavaScriptMethod(name); method.setClazz(Class.forName(className)); method.setMethodName(name); if (attribute != null) { method.setAttribute((Boolean.parseBoolean(attribute) == true) ? ScriptableObject.READONLY : ScriptableObject.PERMANENT); } module.addMethod(method); } catch (ClassNotFoundException e) { String msg = "Error registering method. Class cannot be found, name : " + name + ", class : " + className; log.error(msg, e); } } }
Source:
private String generateExceptionMessage(Throwable error) { String message = error.getMessage(); while (error.getCause() != null) { if (error.getCause() instanceof SSLHandshakeException) { message = "SAP Web IDE is not configured to trust the security certificate provided by the Git server."; break; } else if (error.getCause() instanceof IOException) { if (message != null && message.startsWith(FILE_NAME_TOO_LONG)) { try { String repoPath = repository.getWorkTree().getCanonicalPath(); int startIndex = message.indexOf(repoPath); int endIndex = message.indexOf(","); if (startIndex > -1 && endIndex > -1) { message = FILE_NAME_TOO_LONG + " " + message.substring(startIndex + repoPath.length(), endIndex); } break; } catch (IOException e1) { } } } error = error.getCause(); } return message; }

Target:
private String generateExceptionMessage(Throwable error) { String message = error.getMessage(); while (error.getCause() != null) { if (error.getCause() instanceof SSLHandshakeException) { message = "The system is not configured to trust the security certificate provided by the Git server"; break; } else if (error.getCause() instanceof IOException) { if (message != null && message.startsWith(FILE_NAME_TOO_LONG_ERROR_PREFIX)) { try { String repoPath = repository.getWorkTree().getCanonicalPath(); int startIndex = message.indexOf(repoPath); int endIndex = message.indexOf(","); if (startIndex > -1 && endIndex > -1) { message = FILE_NAME_TOO_LONG_ERROR_PREFIX + " " + message.substring(startIndex + repoPath.length(), endIndex); } break; } catch (IOException e) { } } } error = error.getCause(); } return message; }
Source:
public static void main(String[] args) throws Exception { Crypto crypto = Crypto.initJava(); NetworkAccess network = NetworkAccess.buildJava(new URL("<LINK_0>")).get(); String username = args[0]; String fromPath = args[1]; String toPath = args[2]; Console console = System.console(); String password = new String(console.readPassword("Enter password for " + username + ":")); UserContext context = UserContext.signIn(username, password, network, crypto).get(); ForkJoinPool pool = new ForkJoinPool(50); long t1 = System.currentTimeMillis(); uploadTo(context, Paths.get(fromPath), toPath, context.fragmenter(), props -> true, pool); long t2 = System.currentTimeMillis(); LOG.info("Upload took " + (t2-t1) + " mS"); }

Target:
public static void main(String[] args) throws Exception { Crypto crypto = Crypto.initJava(); NetworkAccess network = NetworkAccess.buildJava(new URL("<LINK_0>")).get(); String username = args[0]; String fromPath = args[1]; String toPath = args[2]; Console console = System.console(); String password = new String(console.readPassword("Enter password for " + username + ":")); UserContext context = UserContext.signIn(username, password, network, crypto).get(); ForkJoinPool pool = new ForkJoinPool(50); long t1 = System.currentTimeMillis(); uploadTo(context, Paths.get(fromPath), toPath, context.fragmenter(), props -> true, pool); long t2 = System.currentTimeMillis(); System.out.println("Upload took " + (t2-t1) + " mS"); }
Source:
public void refreshStorageDevicesFromServers(List<VDS> upServers) { List<Callable<Pair<VDS, List<StorageDevice>>>> storageDevicesListCalls = new ArrayList<>(); for (final VDS server : upServers) { storageDevicesListCalls.add(new Callable<Pair<VDS, List<StorageDevice>>>() { @Override public Pair<VDS, List<StorageDevice>> call() throws Exception { List<StorageDevice> storageDevices = getStorageDevicesFromServer(server); return new Pair<VDS, List<StorageDevice>>(server, storageDevices); } }); } if (storageDevicesListCalls != null) { List<Pair<VDS, List<StorageDevice>>> storageDevices = ThreadPoolUtil.invokeAll(storageDevicesListCalls); for (Pair<VDS, List<StorageDevice>> pair : storageDevices) { if (pair.getSecond() != null) { updateStorageDevices(pair.getFirst(), pair.getSecond()); } } } }

Target:
public void refreshStorageDevicesFromServers(List<VDS> upServers) { List<Callable<Pair<VDS, List<StorageDevice>>>> storageDevicesListCalls = new ArrayList<>(); for (final VDS server : upServers) { storageDevicesListCalls.add(new Callable<Pair<VDS, List<StorageDevice>>>() { @Override public Pair<VDS, List<StorageDevice>> call() throws Exception { List<StorageDevice> storageDevices = getStorageDevicesFromServer(server); return new Pair<VDS, List<StorageDevice>>(server, storageDevices); } }); } if (!storageDevicesListCalls.isEmpty()) { List<Pair<VDS, List<StorageDevice>>> storageDevices = ThreadPoolUtil.invokeAll(storageDevicesListCalls); for (Pair<VDS, List<StorageDevice>> pair : storageDevices) { if (pair.getSecond() != null) { updateStorageDevices(pair.getFirst(), pair.getSecond()); } } } }
Source:
public void postImport(IProgressMonitor monitor, ResourcesManager resManager, ImportItem[] importedItemRecords) { if (importedItemRecords == null) { return; } for (final ImportItem importItem : importedItemRecords) { try { getItem(importItem).ifPresent(processItem -> { migrateItem(processItem); }); } catch (Exception e) { ExceptionHandler.process(e); } } }

Target:
public void postImport(IProgressMonitor monitor, ResourcesManager resManager, ImportItem[] importedItemRecords) { if (importedItemRecords == null) { return; } for (final ImportItem importItem : importedItemRecords) { try { Optional<ProcessItem> processItem = getItem(importItem); if (processItem.isPresent()) { manager.checkProcessItemMigration(processItem.get(), monitor); } } catch (Exception e) { ExceptionHandler.process(e); } } }
Source:
public void terminateOutdatedJobsTask() { long terminated = jobExecutionDao.readAllPending().stream().filter(this::isOutdated).peek(this::terminate).count(); if (terminated > 0) { LOGGER.info("{} jobs has been terminated.", terminated); } else { LOGGER.debug("{} jobs has been terminated.", terminated); } }

Target:
public void terminateOutdatedJobsTask() { jobExecutionDao.readAllPending().stream() .filter(this::isOutdated) .peek(this::terminate) .peek(jobExec -> LOGGER.info("{} has been terminated.", jobExec.getJob())); }
Source:
public static int maximumGap(int[] nums) { if(nums == null || nums.length < 2){ return 0; } int max = Integer.MIN_VALUE; int min = Integer.MAX_VALUE; int length = nums.length; int maxGap = 0; for(int i : nums){ max = Math.max(max, i); min = Math.min(min, i); } if(min == max){ return 0; } int bicketSize = (max - min) / (length - 1); if(bicketSize == 0){ bicketSize = 1; } int bicketCount = (max - min) / bicketSize + 1; int[] left = new int[bicketCount]; int[] right = new int[bicketCount]; Arrays.fill(left, -1); Arrays.fill(right, -1); for(int i = 0; i < length ; i ++){ int loc = (nums[i] - min) / bicketSize; if(left[loc] == -1){ left[loc] = nums[i]; right[loc] = nums[i]; } else{ left[loc] = Math.min(left[loc], nums[i]); right[loc] = Math.max(right[loc], nums[i]); } } int locLeft; int locRight = -1; for(int i = 0; i < bicketCount; i++){ if(left[i] != -1 && locRight == -1){ locRight = right[i]; } else if(left[i] != -1 && locRight != -1){ locLeft = left[i]; maxGap= Math.max(maxGap, locLeft - locRight ); locRight = right[i]; } } return maxGap; }

Target:
public static int maximumGap(int[] nums) { if(nums == null || nums.length < 2){ return 0; } int max = Integer.MIN_VALUE; int min = Integer.MAX_VALUE; int length = nums.length; int maxGap = 0; for(int i : nums){ max = Math.max(max, i); min = Math.min(min, i); } if(min == max){ return 0; } int bucketSize = (max - min) / (length - 1); if(bucketSize == 0){ bucketSize = 1; } int bucketCount = (max - min) / bucketSize + 1; int[] left = new int[bucketCount]; int[] right = new int[bucketCount]; Arrays.fill(left, -1); Arrays.fill(right, -1); for(int i = 0; i < length ; i++){ int loc = (nums[i] - min) / bucketSize; if(left[loc] == -1){ left[loc] = nums[i]; right[loc] = nums[i]; } else{ left[loc] = Math.min(left[loc], nums[i]); right[loc] = Math.max(right[loc], nums[i]); } } int locLeft; int locRight = -1; for(int i = 0; i < bucketCount; i++){ if(left[i] != -1 && locRight == -1){ locRight = right[i]; } else if(left[i] != -1 && locRight != -1){ locLeft = left[i]; maxGap= Math.max(maxGap, locLeft - locRight ); locRight = right[i]; } } return maxGap; }
Source:
public List<Observation> observationEntityToObservation(List<ObservationEntity> observationEntityList) { List<Observation> observationList = new ArrayList<>(); for (ObservationEntity entity : observationEntityList) { Observation obs = new Observation(); obs.setId(entity.getId()); obs.setEncounterID(entity.getEncounterKeyID()); obs.setUuid(entity.getUuid()); obs.setDisplay(entity.getDisplay()); obs.setDisplayValue(entity.getDisplayValue()); obs.setDiagnosisOrder(entity.getDiagnosisOrder()); obs.setDiagnosisList(entity.getDiagnosisList()); obs.setDiagnosisCertanity(entity.getDiagnosisCertainty()); obs.setDiagnosisNote(entity.getDiagnosisNote()); ConceptEntity concept = new ConceptEntity(); concept.setUuid(entity.getConceptuuid()); obs.setConcept(concept); observationList.add(obs); } return observationList; }

Target:
public static List<Observation> observationEntityToObservation(List<ObservationEntity> observationEntityList) { List<Observation> observationList = new ArrayList<>(); for (ObservationEntity entity : observationEntityList) { Observation obs = new Observation(); obs.setId(entity.getId()); obs.setEncounterID(entity.getEncounterKeyID()); obs.setUuid(entity.getUuid()); obs.setDisplay(entity.getDisplay()); obs.setDisplayValue(entity.getDisplayValue()); obs.setDiagnosisOrder(entity.getDiagnosisOrder()); obs.setDiagnosisList(entity.getDiagnosisList()); obs.setDiagnosisCertanity(entity.getDiagnosisCertainty()); obs.setDiagnosisNote(entity.getDiagnosisNote()); ConceptEntity concept = new ConceptEntity(); concept.setUuid(entity.getConceptuuid()); obs.setConcept(concept); observationList.add(obs); } return observationList; }
Source:
public HdfsSystemConsumer(String systemName, Config config, HdfsSystemConsumerMetrics consumerMetrics) { super(consumerMetrics.getMetricsRegistry()); hdfsConfig = new HdfsConfig(config); readerType = HdfsReaderFactory.getType(hdfsConfig.getFileReaderType(systemName)); stagingDirectory = hdfsConfig.getStagingDirectory(); bufferCapacity = hdfsConfig.getConsumerBufferCapacity(systemName); numMaxRetires = hdfsConfig.getConsumerNumMaxRetries(systemName); readers = new ConcurrentHashMap<>(); readerRunnableStatus = new ConcurrentHashMap<>(); isShutdown = false; this.consumerMetrics = consumerMetrics; cachedPartitionDescriptorMap = CacheBuilder.newBuilder().build(new CacheLoader<String, Map<Partition, List<String>>>() { @Override public Map<Partition, List<String>> load(String streamName) throws Exception { Validate.notEmpty(streamName); if (StringUtils.isBlank(stagingDirectory)) { throw new SamzaException("Staging directory can't be empty. " + "Is this not a yarn job (currently hdfs system consumer only works in " + "the same yarn environment on which hdfs is running)? " + "Is STAGING_DIRECTORY not set (see HdfsConfig.scala)?"); } return HdfsSystemAdmin.obtainPartitionDescriptorMap(stagingDirectory, streamName); } }); }

Target:
public HdfsSystemConsumer(String systemName, Config config, HdfsSystemConsumerMetrics consumerMetrics) { super(consumerMetrics.getMetricsRegistry()); hdfsConfig = new HdfsConfig(config); readerType = HdfsReaderFactory.getType(hdfsConfig.getFileReaderType(systemName)); stagingDirectory = hdfsConfig.getStagingDirectory(); bufferCapacity = hdfsConfig.getConsumerBufferCapacity(systemName); numMaxRetires = hdfsConfig.getConsumerNumMaxRetries(systemName); readers = new ConcurrentHashMap<>(); readerRunnableStatus = new ConcurrentHashMap<>(); isShutdown = false; this.consumerMetrics = consumerMetrics; cachedPartitionDescriptorMap = CacheBuilder.newBuilder().build(new CacheLoader<String, Map<Partition, List<String>>>() { @Override public Map<Partition, List<String>> load(String streamName) throws Exception { Validate.notEmpty(streamName); if (StringUtils.isBlank(stagingDirectory)) { throw new SamzaException("Staging directory can't be empty. " + "Is this not a yarn job (currently hdfs system consumer only works in " + "the same yarn environment on which hdfs is running)? " + "Is STAGING_DIRECTORY (" + HdfsConfig.STAGING_DIRECTORY() + ") not set (see HdfsConfig.scala)?"); } return HdfsSystemAdmin.obtainPartitionDescriptorMap(stagingDirectory, streamName); } }); }
Source:
private void bindNamed(Binding params, PreparedStatement statement) { List<String> paramList = stmt.getParams(); if (paramList.contains(POSITIONAL_PARAM)) { String msg = "Cannot mix named and positional parameters in a SQL statement: " + Joiner.on(", ").join(paramList); throw new UnableToExecuteStatementException(msg, context); } for (int i = 0; i < paramList.size(); i++) { String param = paramList.get(i); Argument a = params.findForName(param) .orElseThrow(() -> { String msg = String.format("Unable to execute, no named parameter matches \"%s\".", param); return new UnableToExecuteStatementException(msg, context); }); try { a.apply(i + 1, statement, this.context); } catch (SQLException e) { throw new UnableToCreateStatementException(String.format("Exception while binding '%s'", param), e, context); } } }

Target:
private void bindNamed(Binding params, PreparedStatement statement) { List<String> paramList = stmt.getParams(); if (paramList.contains(POSITIONAL_PARAM)) { throw new UnableToExecuteStatementException( "Cannot mix named and positional parameters in a SQL statement: " + Joiner.on(", ").join(paramList), context); } for (int i = 0; i < paramList.size(); i++) { String param = paramList.get(i); try { params.findForName(param) .orElseThrow(() -> new UnableToExecuteStatementException( String.format("Unable to execute, no named parameter matches '%s'.", param), context)) .apply(i + 1, statement, context); } catch (SQLException e) { throw new UnableToCreateStatementException( String.format("Exception while binding named parameter '%s'", param), e, context); } } }
Source:
public void testKieSessionsPool() { KieContainerSessionsPool pool = getKieContainer().newKieSessionsPool( 1 ); KieSession ksession = pool.newKieSession(); checkKieSession( ksession ); ksession.dispose(); try { ksession.insert( "test2" ); fail("it shouldn't be possible to operate on a disposed session even if created from a pool"); } catch (Exception e) { } KieSession ksession2 = pool.newKieSession(); assertSame( ksession, ksession2 ); assertNull( ksession2.getGlobal( "list" ) ); checkKieSession( ksession2 ); pool.shutdown(); try { ksession.insert( "test3" ); fail("after pool shutdown all sessions created from it should be disposed"); } catch (Exception e) { } try { pool.newKieSession(); fail("after pool shutdown it shouldn't be possible to get sessions from it"); } catch (Exception e) { } }

Target:
public void testKieSessionsPool() { KieContainerSessionsPool pool = getKieContainer().newKieSessionsPool( 1 ); KieSession ksession = pool.newKieSession(); try { checkKieSession( ksession ); } finally { ksession.dispose(); } try { ksession.insert( "test2" ); fail("it shouldn't be possible to operate on a disposed session even if created from a pool"); } catch (Exception e) { } KieSession ksession2 = pool.newKieSession(); assertSame( ksession, ksession2 ); assertNull( ksession2.getGlobal( "list" ) ); checkKieSession( ksession2 ); pool.shutdown(); try { ksession.insert( "test3" ); fail("after pool shutdown all sessions created from it should be disposed"); } catch (IllegalStateException e) { } try { pool.newKieSession(); fail("after pool shutdown it shouldn't be possible to get sessions from it"); } catch (IllegalStateException e) { } }
Source:
private BKHttpServiceProvider(BookieServer bookieServer, AutoRecoveryMain autoRecovery, ServerConfiguration serverConf) throws IOException, KeeperException, InterruptedException { this.bookieServer = bookieServer; this.autoRecovery = autoRecovery; this.serverConf = serverConf; this.zk = ZooKeeperClient.newBuilder() .connectString(serverConf.getZkServers()) .sessionTimeoutMs(serverConf.getZkTimeout()) .build(); ClientConfiguration clientConfiguration = new ClientConfiguration(serverConf) .setZkServers(serverConf.getZkServers()); this.bka = new BookKeeperAdmin(clientConfiguration); this.executor = Executors.newSingleThreadExecutor( new ThreadFactoryBuilder().setNameFormat("BKHttpServiceThread").build()); }

Target:
private BKHttpServiceProvider(BookieServer bookieServer, AutoRecoveryMain autoRecovery, ServerConfiguration serverConf) throws IOException, KeeperException, InterruptedException { this.bookieServer = bookieServer; this.autoRecovery = autoRecovery; this.serverConf = serverConf; this.zk = ZooKeeperClient.newBuilder() .connectString(serverConf.getZkServers()) .sessionTimeoutMs(serverConf.getZkTimeout()) .build(); ClientConfiguration clientConfiguration = new ClientConfiguration(serverConf) .setZkServers(serverConf.getZkServers()); this.bka = new BookKeeperAdmin(clientConfiguration); this.executor = Executors.newSingleThreadExecutor( new ThreadFactoryBuilder().setNameFormat("BKHttpServiceThread").setDaemon(true).build()); }
Source:
public void onCreate() { super.onCreate(); Collect.setStaticApplicationContext(this); AndroidClassHasher.registerAndroidClassHashStrategy(); AndroidUtil.initializeStaticHandlers(); CommCareApplication.app = this; PreInitLogger pil = new PreInitLogger(); Logger.registerLogger(pil); System.setProperty("http.keepAlive", "false"); Thread.setDefaultUncaughtExceptionHandler(new CommCareExceptionHandler(Thread.getDefaultUncaughtExceptionHandler())); PropertyManager.setPropertyManager(new ODKPropertyManager()); SQLiteDatabase.loadLibs(this); setRoots(); prepareTemporaryStorage(); dbState = initGlobalDb(); try { LegacyInstallUtils.checkForLegacyInstall(this, this.getGlobalStorage(ApplicationRecord.class)); } catch(StorageFullException sfe) { throw new RuntimeException(sfe); } finally { Logger.registerLogger(new AndroidLogger(this.getGlobalStorage(AndroidLogEntry.STORAGE_KEY, AndroidLogEntry.class))); pil.dumpToNewLogger(); } intializeDefaultLocalizerData(); resourceState = STATE_UNINSTALLED; resourceState = initializeAppResources(); ACRA.init(this); this.initACRA(); }

Target:
public void onCreate() { super.onCreate(); Collect.setStaticApplicationContext(this); AndroidClassHasher.registerAndroidClassHashStrategy(); AndroidUtil.initializeStaticHandlers(); CommCareApplication.app = this; PreInitLogger pil = new PreInitLogger(); Logger.registerLogger(pil); System.setProperty("http.keepAlive", "false"); Thread.setDefaultUncaughtExceptionHandler(new CommCareExceptionHandler(Thread.getDefaultUncaughtExceptionHandler())); PropertyManager.setPropertyManager(new ODKPropertyManager()); SQLiteDatabase.loadLibs(this); setRoots(); prepareTemporaryStorage(); dbState = initGlobalDb(); try { LegacyInstallUtils.checkForLegacyInstall(this, this.getGlobalStorage(ApplicationRecord.class)); } catch (StorageFullException sfe) { throw new RuntimeException(sfe); } finally { Logger.registerLogger(new AndroidLogger(this.getGlobalStorage(AndroidLogEntry.STORAGE_KEY, AndroidLogEntry.class))); pil.dumpToNewLogger(); } intializeDefaultLocalizerData(); resourceState = initializeAppResources(); ACRA.init(this); this.initACRA(); }
Source:
public CircuitBreakerRegistry circuitBreakerRegistry( EventConsumerRegistry<CircuitBreakerEvent> eventConsumerRegistry, RegistryEventConsumer<CircuitBreaker> circuitBreakerRegistryEventConsumer) { CircuitBreakerRegistry circuitBreakerRegistry = circuitBreakerConfiguration.createCircuitBreakerRegistry(circuitBreakerProperties, circuitBreakerRegistryEventConsumer); circuitBreakerConfiguration.registerEventConsumer(circuitBreakerRegistry, eventConsumerRegistry); HashMap<String, String> allTags = getAllTags(); circuitBreakerConfiguration.initCircuitBreakerRegistry(circuitBreakerRegistry,allTags); return circuitBreakerRegistry; }

Target:
public CircuitBreakerRegistry circuitBreakerRegistry( EventConsumerRegistry<CircuitBreakerEvent> eventConsumerRegistry, RegistryEventConsumer<CircuitBreaker> circuitBreakerRegistryEventConsumer) { CircuitBreakerRegistry circuitBreakerRegistry = circuitBreakerConfiguration.createCircuitBreakerRegistry(circuitBreakerProperties, circuitBreakerRegistryEventConsumer); circuitBreakerConfiguration .registerEventConsumer(circuitBreakerRegistry, eventConsumerRegistry); circuitBreakerConfiguration.initCircuitBreakerRegistry(circuitBreakerRegistry); return circuitBreakerRegistry; }
Source:
public void bindDiscountCode(DiscountCode discountCode) { String code = Utils.checkStringEmpty(discountCode.getCode()); String discountUrl = Utils.checkStringEmpty(discountCode.getDiscount_url()); String tickets = Utils.checkStringEmpty(discountCode.getTickets()); String usedFor = Utils.checkStringEmpty(discountCode.getUsed_for()); int minQuantity = discountCode.getMin_quantity(); int maxQuantity = discountCode.getMax_quantity(); float value = discountCode.getValue(); setStringFieldWithPrefix(discountCodeTextView, code, ""); setStringFieldWithPrefix(discountCodeValue, "Value : "+value, ""); setStringFieldWithPrefix(discountMinQuantity, "Minimum Quantity : "+minQuantity, ""); setStringFieldWithPrefix(discountMaxQuantity, "Maximum Quantity :"+maxQuantity, ""); setStringFieldWithPrefix(discountTicket, tickets, "Tickets : "); setStringFieldWithPrefix(discountUsedFor, usedFor, "Used For : "); setStringFieldWithPrefix(this.discountUrl, discountUrl, "Discount URL : "); }

Target:
public void bindDiscountCode(DiscountCode discountCode) { String code = Utils.checkStringEmpty(discountCode.getCode()); String discountUrl = Utils.checkStringEmpty(discountCode.getDiscount_url()); String tickets = Utils.checkStringEmpty(discountCode.getTickets()); String usedFor = Utils.checkStringEmpty(discountCode.getUsed_for()); Resources res = context.getResources(); String minQuantity = String.format(res.getString(R.string.discount_code_min_quantity), discountCode.getMin_quantity()); String maxQuantity = String.format(res.getString(R.string.discount_code_max_quantity), discountCode.getMax_quantity()); String value = String.format(res.getString(R.string.discount_code_value), discountCode.getValue()); setStringFieldWithPrefix(discountCodeTextView, code, null); setStringFieldWithPrefix(discountCodeValue, value, null); setStringFieldWithPrefix(discountMinQuantity, minQuantity, null); setStringFieldWithPrefix(discountMaxQuantity, maxQuantity, null); setStringFieldWithPrefix(discountTicket, tickets, "Tickets : "); setStringFieldWithPrefix(discountUsedFor, usedFor, "Used For : "); setStringFieldWithPrefix(this.discountUrl, discountUrl, "Discount URL : "); }
Source:
void sendMessageFailsIfConnectionNotOpened() { when(webSocketClient.isOpen()).thenReturn(false); assertThrows(IllegalStateException.class, () -> webSocketConnection.sendMessage(MESSAGE)); verify(webSocketClient, times(0)).send(MESSAGE); }

Target:
void sendMessageFailsIfConnectionNotOpened() { when(webSocketClient.isOpen()).thenReturn(false); assertThrows(IllegalStateException.class, () -> webSocketConnection.sendMessage(MESSAGE)); verify(webSocketClient, never()).send(MESSAGE); }
Source:
private static Topology getTopology(final Properties streamsConfig, final String queryableStoreName, final boolean leftJoin) { final StreamsBuilder builder = new StreamsBuilder(); final KTable<Integer, Float> left = builder.table(LEFT_TABLE, Consumed.with(Serdes.Integer(), Serdes.Float())); final KTable<String, Long> right = builder.table(RIGHT_TABLE, Consumed.with(Serdes.String(), Serdes.Long())); final Materialized<Integer, String, KeyValueStore<Bytes, byte[]>> materialized = Materialized.<Integer, String>as(Stores.inMemoryKeyValueStore(queryableStoreName)) .withKeySerde(Serdes.Integer()) .withValueSerde(Serdes.String()) .withCachingDisabled(); final Function<Float, String> extractor = value -> Integer.toString((int) value.floatValue()); final ValueJoiner<Float, Long, String> joiner = (value1, value2) -> "value1=" + value1 + ",value2=" + value2; if (leftJoin) left.leftJoin(right, extractor, joiner, Named.as("customName"), materialized) .toStream() .to(OUTPUT, Produced.with(Serdes.Integer(), Serdes.String())); else left.join(right, extractor, joiner, Named.as("customName"), materialized) .toStream() .to(OUTPUT, Produced.with(Serdes.Integer(), Serdes.String())); return builder.build(streamsConfig); }

Target:
private static Topology getTopology(final Properties streamsConfig, final String queryableStoreName, final boolean leftJoin) { final StreamsBuilder builder = new StreamsBuilder(); final KTable<String, String> left = builder.table(LEFT_TABLE, Consumed.with(Serdes.String(), Serdes.String())); final KTable<String, String> right = builder.table(RIGHT_TABLE, Consumed.with(Serdes.String(), Serdes.String())); final Materialized<String, String, KeyValueStore<Bytes, byte[]>> materialized = Materialized.<String, String>as(Stores.inMemoryKeyValueStore(queryableStoreName)) .withKeySerde(Serdes.String()) .withValueSerde(Serdes.String()) .withCachingDisabled(); final Function<String, String> extractor = value -> value.split("\\|")[1]; final ValueJoiner<String, String, String> joiner = (value1, value2) -> "(" + value1 + "," + value2 + ")"; if (leftJoin) left.leftJoin(right, extractor, joiner, materialized) .toStream() .to(OUTPUT, Produced.with(Serdes.String(), Serdes.String())); else left.join(right, extractor, joiner, materialized) .toStream() .to(OUTPUT, Produced.with(Serdes.String(), Serdes.String())); return builder.build(streamsConfig); }
Source:
ILogData read(long address) { if (!runtime.getParameters().isCacheDisabled()) { try { readCache.get(address, () -> fetch(address)); } catch (ExecutionException | UncheckedExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else { throw new RuntimeException(cause); } } } return fetch(address); }

Target:
ILogData read(long address) { if (!runtime.getParameters().isCacheDisabled()) { ILogData data = readCache.getIfPresent(address); if (data == null) { final ILogData loadedVal = fetch(address); return cacheLoadAndGet(readCache, address, loadedVal); } return data; } return fetch(address); }
Source:
private SegmentIdentifier tryAllocate( TaskActionToolbox toolbox, Task task, Interval tryInterval, Interval rowInterval, boolean logOnFail ) { log.debug( "Trying to allocate pending segment for rowInterval[%s], segmentInterval[%s].", rowInterval, tryInterval ); final LockResult lockResult = toolbox.getTaskLockbox().tryLock(TaskLockType.EXCLUSIVE, task, tryInterval); if (lockResult.isRevoked()) { throw new ISE("The lock for interval[%s] is preempted and no longer valid", tryInterval); } if (lockResult.isOk()) { SegmentIdentifier identifier; synchronized (lockResult.getTaskLock()) { identifier = toolbox.getIndexerMetadataStorageCoordinator().allocatePendingSegment( dataSource, sequenceName, previousSegmentId, tryInterval, lockResult.getTaskLock().getVersion(), skipSegmentLineageCheck ); } if (identifier != null) { return identifier; } else { final String msg = StringUtils.format( "Could not allocate pending segment for rowInterval[%s], segmentInterval[%s].", rowInterval, tryInterval ); if (logOnFail) { log.error(msg); } else { log.debug(msg); } return null; } } else { final String msg = StringUtils.format( "Could not acquire lock for rowInterval[%s], segmentInterval[%s].", rowInterval, tryInterval ); if (logOnFail) { log.error(msg); } else { log.debug(msg); } return null; } }

Target:
private SegmentIdentifier tryAllocate( TaskActionToolbox toolbox, Task task, Interval tryInterval, Interval rowInterval, boolean logOnFail ) { log.debug( "Trying to allocate pending segment for rowInterval[%s], segmentInterval[%s].", rowInterval, tryInterval ); final LockResult lockResult = toolbox.getTaskLockbox().tryLock(TaskLockType.EXCLUSIVE, task, tryInterval); if (lockResult.isRevoked()) { throw new ISE("The lock for interval[%s] is preempted and no longer valid", tryInterval); } if (lockResult.isOk()) { final SegmentIdentifier identifier; try { identifier = toolbox.getTaskLockbox().doInCriticalSection( task, ImmutableList.of(tryInterval), CriticalAction.<SegmentIdentifier>builder() .onValidLocks( () -> toolbox.getIndexerMetadataStorageCoordinator().allocatePendingSegment( dataSource, sequenceName, previousSegmentId, tryInterval, lockResult.getTaskLock().getVersion(), skipSegmentLineageCheck ) ).onInvalidLocks( () -> null ) .build() ); } catch (Exception e) { throw new RuntimeException(e); } if (identifier != null) { return identifier; } else { final String msg = StringUtils.format( "Could not allocate pending segment for rowInterval[%s], segmentInterval[%s].", rowInterval, tryInterval ); if (logOnFail) { log.error(msg); } else { log.debug(msg); } return null; } } else { final String msg = StringUtils.format( "Could not acquire lock for rowInterval[%s], segmentInterval[%s].", rowInterval, tryInterval ); if (logOnFail) { log.error(msg); } else { log.debug(msg); } return null; } }
Source:
protected void executeVdsBrokerCommand() { log.info("-- executeVdsBrokerCommand: calling 'merge'"); status = getBroker().mergeSubchain(getParameters().getStorageJobId().toString(), SubchainInfoHelper.prepareSubchainInfoForVdsCommand(getParameters().getSubchainInfo())); proceedProxyReturnValue(); }

Target:
protected void executeVdsBrokerCommand() { log.info("-- executeVdsBrokerCommand: calling 'mergeSubchain'"); status = getBroker().mergeSubchain(getParameters().getJobId().toString(), SubchainInfoHelper.prepareSubchainInfoForVdsCommand(getParameters().getSubchainInfo())); proceedProxyReturnValue(); }
Source:
public SegmentLoaderLocalCacheManager( IndexIO indexIO, SegmentLoaderConfig config, @Json ObjectMapper mapper ) { this.indexIO = indexIO; this.config = config; this.jsonMapper = mapper; this.locations = new ArrayList<>(); for (StorageLocationConfig locationConfig : config.getLocations()) { locations.add( new StorageLocation( locationConfig.getPath(), locationConfig.getMaxSize(), locationConfig.getFreeSpacePercent() ) ); } this.strategy = config.getStorageLocationSelectorStrategy(); this.strategy.setStorageLocations(ImmutableList.copyOf(locations)); }

Target:
public SegmentLoaderLocalCacheManager( IndexIO indexIO, SegmentLoaderConfig config, @Json ObjectMapper mapper ) { this.indexIO = indexIO; this.config = config; this.jsonMapper = mapper; this.locations = new ArrayList<>(); for (StorageLocationConfig locationConfig : config.getLocations()) { locations.add( new StorageLocation( locationConfig.getPath(), locationConfig.getMaxSize(), locationConfig.getFreeSpacePercent() ) ); } this.strategy = config.getStorageLocationSelectorStrategy(locations); }
Source:
public void setFlows(final Map<String, Flow> flows) { this.flows = new HashMap<>(flows); }

Target:
public void setFlows(final Map<String, Flow> flows) { this.flows = ImmutableMap.copyOf(flows); }
Source:
void peekBatchMessages() { final String messageId = UUID.randomUUID().toString(); final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, messageId, 0); int maxMessages = 2; StepVerifier.create(sender.send(message) .then(sender.send(message)) .thenMany(receiver.peekBatch(maxMessages))) .expectNextCount(maxMessages) .verifyComplete(); }

Target:
void peekBatchMessages() { final String messageId = UUID.randomUUID().toString(); final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, messageId, 0); int maxMessages = 2; StepVerifier.create(Mono.when(sender.send(message), sender.send(message)) .thenMany(receiver.peekBatch(maxMessages))) .expectNextCount(maxMessages) .verifyComplete(); }
Source:
public static boolean deleteFileOrDir(File f) { if (!f.exists()) { return true; } if (f.isDirectory()) { for (File child : f.listFiles()) { if (!deleteFileOrDir(child)) { return false; } } } Log.i(LOG_TOKEN, "Attempting to delete file: " + f.getAbsolutePath()); return f.delete(); }

Target:
public static boolean deleteFileOrDir(File f) { if (!f.exists()) { return true; } if (f.isDirectory()) { for (File child : f.listFiles()) { if (!deleteFileOrDir(child)) { return false; } } } return f.delete(); }
Source:
private List<String> fetchAllDatastreamNamesFromZk() { String path = KeyBuilder.datastreams(_cluster); if (_zkclient.exists(path)) { return _zkclient.getChildren(path, true); } return Collections.emptyList(); }

Target:
private List<String> fetchAllDatastreamNamesFromZk() { String path = KeyBuilder.datastreams(_cluster); if (_zkclient.exists(path)) { return _zkclient.getChildren(path, true); } else { LOG.warn("Brooklin cluster '{}' is not initialize yet.", _cluster); return Collections.emptyList(); } }
Source:
public void verifyLogging() throws Exception { GatewayResponse gatewayResponse = providerWillAuthorise(); walletAuthoriseService.doAuthorise(charge.getExternalId(), validApplePayDetails); ArgumentCaptor<LoggingEvent> loggingEventArgumentCaptor = ArgumentCaptor.forClass(LoggingEvent.class); verify(mockAppender, times(4)).doAppend(loggingEventArgumentCaptor.capture()); List<LoggingEvent> loggingEvents = loggingEventArgumentCaptor.getAllValues(); assertThat(loggingEvents.stream().anyMatch(le -> le.getFormattedMessage().contains( format("apple-pay authorisation success - charge_external_id=%s, payment provider response=%s", charge.getExternalId(), gatewayResponse.toString())) ), is(true)); }

Target:
public void verifyLogging() throws Exception { GatewayResponse gatewayResponse = providerWillAuthorise(); walletAuthoriseService.doAuthorise(charge.getExternalId(), validApplePayDetails); ArgumentCaptor<LoggingEvent> loggingEventArgumentCaptor = ArgumentCaptor.forClass(LoggingEvent.class); verify(mockAppender, times(4)).doAppend(loggingEventArgumentCaptor.capture()); List<LoggingEvent> loggingEvents = loggingEventArgumentCaptor.getAllValues(); assertThat(loggingEvents.stream().anyMatch(le -> le.getFormattedMessage().contains( format("APPLE_PAY authorisation success - charge_external_id=%s, payment provider response=%s", charge.getExternalId(), gatewayResponse.toString())) ), is(true)); }
Source:
public boolean start() { List<SnapshotVO> dsnapshots = _snapshotDao.listAllByStatus(Snapshot.State.Destroying); for (SnapshotVO snapshotVO : dsnapshots) { try { if (!deleteSnapshot(snapshotVO.getId())) { s_logger.debug("Failed to delete snapshot in destroying state with id " + snapshotVO.getUuid()); } } catch (Exception e) { s_logger.debug("Failed to delete snapshot in destroying state with id " + snapshotVO.getUuid()); } } return true; }

Target:
public boolean start() { List<SnapshotVO> snapshots = _snapshotDao.listAllByStatus(Snapshot.State.Destroying); for (SnapshotVO snapshotVO : snapshots) { try { if (!deleteSnapshot(snapshotVO.getId())) { s_logger.debug("Failed to delete snapshot in destroying state with id " + snapshotVO.getUuid()); } } catch (Exception e) { s_logger.debug("Failed to delete snapshot in destroying state with id " + snapshotVO.getUuid()); } } return true; }
Source:
protected void onLoadFailure(final String resultMessage) { Log.e(Battlelog.TAG, "resultMessage => " + resultMessage); }

Target:
protected void onLoadFailure(final String resultMessage) { Log.e(getClass().getSimpleName(), "resultMessage => " + resultMessage); }
Source:
private static double megaBitToBit(double megaBit) { return megaBit * 1000000; }

Target:
private static double megaBitToBit(double megaBit) { return megaBit * 1_000_000; }
Source:
public void sendNowSync(Event event) { sendNowSync(event); }

Target:
public void sendNowSync(Event event) { sendNow(event); }
Source:
public Object getAdapter(@SuppressWarnings("rawtypes") final Class adapter) { Object result; if ("interface org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidgetProvider".equals(adapter.toString())) { System.out.println(); } if (adapter.isInstance(this)) { result = this; } else { result = this.widget.getAdapter(adapter); if (result == null) { result = super.getAdapter(adapter); } } return result; }

Target:
public Object getAdapter(@SuppressWarnings("rawtypes") final Class adapter) { Object result; if (adapter.isInstance(this)) { result = this; } else { result = this.widget.getAdapter(adapter); if (result == null) { result = super.getAdapter(adapter); } } return result; }
Source:
private void txBeginInternal(boolean allowNestedTransactions) { if (TransactionalContext.isInTransaction()) { TxnContext txnContext = TransactionalContext.getRootContext().getTxnContext(); if (!allowNestedTransactions) { log.error("Current thread already has a transaction started and nested transactions are disabled!"); throw new TransactionAlreadyStartedException(TransactionalContext.getRootContext().toString()); } if (txnContext != null) { log.error("Cannot start new transaction in this thread without ending previous one"); throw new TransactionAlreadyStartedException(TransactionalContext.getRootContext().toString()); } this.txnStartTime = System.nanoTime(); log.warn("Reusing the transactional context created outside this layer!"); return; } this.txnStartTime = System.nanoTime(); Transaction.TransactionBuilder transactionBuilder = this.objectsView .TXBuild() .type(TransactionType.WRITE_AFTER_WRITE); if (isolationLevel.getTimestamp() != Token.UNINITIALIZED) { transactionBuilder.snapshot(isolationLevel.getTimestamp()); } transactionBuilder.build().begin(); TransactionalContext.getRootContext().setTxnContext(this); }

Target:
private void txBeginInternal(boolean allowNestedTransactions) { if (TransactionalContext.isInTransaction()) { TxnContext txnContext = TransactionalContext.getRootContext().getTxnContext(); if (!allowNestedTransactions) { log.error("Nested transactions are disabled & current thread already has a transaction started at..."); for (StackTraceElement st : TransactionalContext.getRootContext().getBeginTxnStackTrace()) { log.error("{}", st); } throw new TransactionAlreadyStartedException(TransactionalContext.getRootContext().toString()); } if (txnContext != null) { log.error("Cannot start new CorfuStore transaction in this thread without ending previous one at..."); for (StackTraceElement st : TransactionalContext.getRootContext().getBeginTxnStackTrace()) { log.error("{}", st); } throw new TransactionAlreadyStartedException(TransactionalContext.getRootContext().toString()); } this.txnStartTime = System.nanoTime(); log.warn("Reusing the transactional context created outside this layer!"); this.iDidNotStartCorfuTxn = true; TransactionalContext.getRootContext().setTxnContext(this); return; } log.debug("TxnContext: begin transaction in namespace {}", namespace); this.txnStartTime = System.nanoTime(); Transaction.TransactionBuilder transactionBuilder = this.objectsView .TXBuild() .type(TransactionType.WRITE_AFTER_WRITE); if (isolationLevel.getTimestamp() != Token.UNINITIALIZED) { transactionBuilder.snapshot(isolationLevel.getTimestamp()); } transactionBuilder.build().begin(); TransactionalContext.getRootContext().setTxnContext(this); }
Source:
public List<String> getDownloadedPluginFilenames() { List<String> names = new ArrayList<>(); for (File file : listPlugins(this.downloadDir)) { names.add(file.getName()); } return names; }

Target:
List<String> getDownloadedPluginFilenames() { List<String> names = new ArrayList<>(); for (File file : listPlugins(this.downloadDir)) { names.add(file.getName()); } return names; }
Source:
public void refresh() { _vdcOptionCache.clear(); List<VdcOption> list = getVdcOptionDao().getAll(); list = moveDependentToEnd(list); for (VdcOption option : list) { try { if (!_vdcOptionCache.containsKey(option.getOptionName()) || !_vdcOptionCache.get(option.getOptionName()).containsKey(option.getVersion()) || isReloadable(option.getOptionName())) { updateOption(option); } } catch (NoSuchFieldException e) { log.error("Not refreshing field '{}': does not exist in class {}.", option.getOptionName(), ConfigValues.class.getSimpleName()); } } }

Target:
public void refresh() { _vdcOptionCache.clear(); List<VdcOption> list = moveDependentToEnd(getVdcOptionDao().getAll()); for (VdcOption option : list) { try { if (!_vdcOptionCache.containsKey(option.getOptionName()) || !_vdcOptionCache.get(option.getOptionName()).containsKey(option.getVersion()) || isReloadable(option.getOptionName())) { updateOption(option); } } catch (NoSuchFieldException e) { log.error("Not refreshing field '{}': does not exist in class {}.", option.getOptionName(), ConfigValues.class.getSimpleName()); } } }
Source:
public WebSocketClientHandshaker07(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl, String httpRequestEncoderName, String httpResponseDecoderName) { super(webSocketURL, version, subprotocol, customHeaders, maxFramePayloadLength, forceCloseTimeoutMillis, absoluteUpgradeUrl, httpRequestEncoderName, httpResponseDecoderName); this.allowExtensions = allowExtensions; this.performMasking = performMasking; this.allowMaskMismatch = allowMaskMismatch; }

Target:
WebSocketClientHandshaker07(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl, String httpRequestEncoderName, String httpResponseDecoderName) { super(webSocketURL, version, subprotocol, customHeaders, maxFramePayloadLength, forceCloseTimeoutMillis, absoluteUpgradeUrl, httpRequestEncoderName, httpResponseDecoderName); this.allowExtensions = allowExtensions; this.performMasking = performMasking; this.allowMaskMismatch = allowMaskMismatch; }
Source:
private Source getSource(final String uriParam) throws XPathException { try { final URI uri = new URI(uriParam); if (uri.getFragment() != null) { throw new XPathException(this, ErrorCodes.FOUT1170, "href argument may not contain fragment identifier"); } final Source source = SourceFactory.getSource(context.getBroker(), "", uri.toASCIIString(), false); if (source == null) { throw new XPathException(this, ErrorCodes.FOUT1170, "Could not find source for: " + uriParam); } if (source.getInputStream()==null) { throw new XPathException(this, ErrorCodes.FOUT1170, "Unable to retrieve bytestream from " + uriParam); } if (source instanceof FileSource && !context.getBroker().getCurrentSubject().hasDbaRole()) { throw new PermissionDeniedException("non-dba user not allowed to read from file system"); } return source; } catch (final IOException | PermissionDeniedException | URISyntaxException e) { throw new XPathException(this, ErrorCodes.FOUT1170, e.getMessage()); } }

Target:
private Source getSource(final String uriParam) throws XPathException { try { final URI uri = new URI(uriParam); if (uri.getFragment() != null) { throw new XPathException(this, ErrorCodes.FOUT1170, "href argument may not contain fragment identifier"); } final Source source = SourceFactory.getSource(context.getBroker(), "", uri.toASCIIString(), false); if (source == null) { throw new XPathException(this, ErrorCodes.FOUT1170, "Could not find source for: " + uriParam); } if (source instanceof FileSource && !context.getBroker().getCurrentSubject().hasDbaRole()) { throw new PermissionDeniedException("non-dba user not allowed to read from file system"); } return source; } catch (final IOException | PermissionDeniedException | URISyntaxException e) { throw new XPathException(this, ErrorCodes.FOUT1170, e.getMessage()); } }
Source:
public Map<String, Object> convert(Map<String, Object> claims) { Assert.notNull(claims, "claims cannot be null"); Map<String, Object> mappedClaims = new HashMap<>(claims); for (Map.Entry<String, Converter<Object, ?>> entry : this.attributeConverters.entrySet()) { Converter<Object, ?> converter = this.attributeConverters.get(entry.getKey()); if (converter != null) { Object claim = claims.get(entry.getKey()); Object mappedClaim = converter.convert(claim); put(mappedClaims, entry.getKey(), mappedClaim); } } Instant issuedAt = (Instant) mappedClaims.get(JwtClaimNames.IAT); Instant expiresAt = (Instant) mappedClaims.get(JwtClaimNames.EXP); if (issuedAt == null && expiresAt != null) { mappedClaims.put(JwtClaimNames.IAT, expiresAt.minusSeconds(1)); } return mappedClaims; }

Target:
public Map<String, Object> convert(Map<String, Object> claims) { Assert.notNull(claims, "claims cannot be null"); Map<String, Object> mappedClaims = new HashMap<>(claims); for (Map.Entry<String, Converter<Object, ?>> entry : this.claimConverters.entrySet()) { String claimName = entry.getKey(); Converter<Object, ?> converter = entry.getValue(); if (converter != null) { Object claim = claims.get(claimName); Object mappedClaim = converter.convert(claim); mappedClaims.compute(claimName, (key, value) -> mappedClaim); } } Instant issuedAt = (Instant) mappedClaims.get(JwtClaimNames.IAT); Instant expiresAt = (Instant) mappedClaims.get(JwtClaimNames.EXP); if (issuedAt == null && expiresAt != null) { mappedClaims.put(JwtClaimNames.IAT, expiresAt.minusSeconds(1)); } return mappedClaims; }
Source:
public String toString() { return "LdapAuthenticationConfig [url=" + url + ", socketFactoryClassName=" + socketFactoryClassName + ", systemUserDn=" + systemUserDn + ", systemUserPassword=" + systemUserPassword + ", parseDn=" + parseDn + ", roleContext=" + roleContext + ", roleFilter=" + roleFilter + ", roleMappingAttribute=" + roleMappingAttribute + ", roleMappingMode=" + roleMappingMode + ", roleNameAttribute=" + roleNameAttribute + ", roleRecursionMaxDepth=" + roleRecursionMaxDepth + ", roleSearchScope=" + roleSearchScope + ", userNameAttribute=" + userNameAttribute + ", passwordAttribute=" + passwordAttribute + ", userContext=" + userContext + ", userFilter=" + userFilter + ", userSearchScope=" + userSearchScope + ", skipAuthentication=" + skipAuthentication + ", getSkipIdentity()=" + getSkipIdentity() + ", getSkipEndpoint()=" + getSkipEndpoint() + ", getSkipRole()=" + getSkipRole() + "]"; }

Target:
public String toString() { return "LdapAuthenticationConfig [url=" + url + ", socketFactoryClassName=" + socketFactoryClassName + ", systemUserDn=" + systemUserDn + ", systemUserPassword=***, parseDn=" + parseDn + ", roleContext=" + roleContext + ", roleFilter=" + roleFilter + ", roleMappingAttribute=" + roleMappingAttribute + ", roleMappingMode=" + roleMappingMode + ", roleNameAttribute=" + roleNameAttribute + ", roleRecursionMaxDepth=" + roleRecursionMaxDepth + ", roleSearchScope=" + roleSearchScope + ", userNameAttribute=" + userNameAttribute + ", passwordAttribute=" + passwordAttribute + ", userContext=" + userContext + ", userFilter=" + userFilter + ", userSearchScope=" + userSearchScope + ", skipAuthentication=" + skipAuthentication + ", getSkipIdentity()=" + getSkipIdentity() + ", getSkipEndpoint()=" + getSkipEndpoint() + ", getSkipRole()=" + getSkipRole() + "]"; }