auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static String parseValue(String n) { String number_value = CharMatcher.WHITESPACE.removeFrom(n); <START> Pattern number_format = Pattern.compile("((\\d)\\d{0,2})(,?\\d{3})*(\\.[\\d]+)?([MBK]?)"); <END> Matcher m = number_format.matcher(number_value); if (!m.find()) { DAO.severe("This is outputing wrong value. Need to be fixed"); } return number_value; }</code><technical_language>This static member of class</technical_language>

Target:
private static String parseValue(String n) { String number_value = CharMatcher.WHITESPACE.removeFrom(n); Pattern number_format = Pattern.compile("^(\\d{1,3})(((,\\d{3})*)|((\\.\\d+)?[MBK]))?$"); Matcher m = number_format.matcher(number_value); if (!m.find()) { DAO.severe("This is outputing wrong value. Need to be fixed"); } return number_value; }
Source:
<code>private void waitForImageVerification() throws ProtocolAdapterException, ImageTransferException { final Future<Integer> newStatus = EXECUTOR_SERVICE.submit(new ImageTransferStatusChangeWatcher( ImageTransferStatus.VERIFICATION_INITIATED, properties.getVerificationStatusCheckInterval(), <START> properties.verificationStatusCheckTimeout)); <END> int status; try { status = newStatus.get(); } catch (InterruptedException | ExecutionException e) { throw new ProtocolAdapterException("", e); } if (status == ImageTransferStatus.VERIFICATION_FAILED.getValue()) { throw new ImageTransferException(EXCEPTION_MSG_IMAGE_NOT_VERIFIED); } return; }</code><technical_language>getVerificationStatusCheckTimeout() seams more inline access of previous properties</technical_language>

Target:
private void waitForImageVerification() throws ProtocolAdapterException, ImageTransferException { final Future<Integer> newStatus = EXECUTOR_SERVICE.submit(new ImageTransferStatusChangeWatcher( ImageTransferStatus.VERIFICATION_INITIATED, properties.getVerificationStatusCheckInterval(), properties .getVerificationStatusCheckTimeout())); int status; try { status = newStatus.get(); } catch (InterruptedException | ExecutionException e) { throw new ProtocolAdapterException("", e); } if (status == ImageTransferStatus.VERIFICATION_FAILED.getValue()) { throw new ImageTransferException(EXCEPTION_MSG_IMAGE_NOT_VERIFIED); } return; }
Source:
<code>public MetadataMap getMetadata() { if (metadata == null) { <START> metadata = new MetadataMap(); <END> } return metadata; }</code><technical_language>If do this do need @sychronize? If is threadsafe..</technical_language>

Target:
public synchronized MetadataMap getMetadata() { if (metadata == null) { metadata = new MetadataMap(); } return metadata; }
Source:
<code>private void performSimpleTest(HikariDataSource dataSource) throws SQLException { if (jdbcUrl.startsWith("jdbc:tc:db2:")) { <START> return; END> } boolean result = new QueryRunner(dataSource, options.contains(Options.PmdKnownBroken)).query("SELECT 1", rs -> { rs.next(); int resultSetInt = rs.getInt(1); assertEquals("A basic SELECT query succeeds", 1, resultSetInt); return true; }); assertTrue("The database returned a record as expected", result); }</code><technical_language>is a similar query in DB2? like: java String query = "SELECT 1"; if (jdbcUrl.startsWith("jdbc:tc:db2:")) { query = "SELECT ..."; // DB2-friendly query }</technical_language>

Target:
private void performSimpleTest(HikariDataSource dataSource) throws SQLException { String query = "SELECT 1"; if (jdbcUrl.startsWith("jdbc:tc:db2:")) { query = "SELECT 1 FROM SYSIBM.SYSDUMMY1"; } boolean result = new QueryRunner(dataSource, options.contains(Options.PmdKnownBroken)).query(query, rs -> { rs.next(); int resultSetInt = rs.getInt(1); assertEquals("A basic SELECT query succeeds", 1, resultSetInt); return true; }); assertTrue("The database returned a record as expected", result); }
Source:
<code>private String convertPartitionKeyToString(Object partitionKey) { if (partitionKey instanceof String) { return (String) partitionKey; } else if (partitionKey instanceof byte[]) { return new String((byte[]) partitionKey); } else { <START> throw new SamzaException("EventHub system producer doesn't support the key type"); <END> } }</code><technical_language>print unexpected key type</technical_language>

Target:
private String convertPartitionKeyToString(Object partitionKey) { if (partitionKey instanceof String) { return (String) partitionKey; } else if (partitionKey instanceof byte[]) { return new String((byte[]) partitionKey); } else { throw new SamzaException("Unsupported key type: " + partitionKey.getClass().toString()); } }
Source:
<code>public String getText(Object object) { String label = ((DRepresentationDescriptor) object).getName(); if (label == null || <START> label.length() == 0) { <END> EObject objectToAdapt = ((DRepresentationDescriptor) object).getRepresentation(); if (objectToAdapt == null) { objectToAdapt = ((DRepresentationDescriptor) object).getDescription(); } if (objectToAdapt != null) { final IItemLabelProvider labelProvider = (IItemLabelProvider) getRootAdapterFactory().adapt(objectToAdapt, IItemLabelProvider.class); if (labelProvider != null) { label = labelProvider.getText(objectToAdapt); } } } return label; }</code><technical_language>label.length() == 0 -> label.isEmpty()</technical_language>

Target:
public String getText(Object object) { String label = ((DRepresentationDescriptor) object).getName(); if (label == null || label.isEmpty()) { EObject objectToAdapt = ((DRepresentationDescriptor) object).getRepresentation(); if (objectToAdapt == null) { objectToAdapt = ((DRepresentationDescriptor) object).getDescription(); } if (objectToAdapt != null) { final IItemLabelProvider labelProvider = (IItemLabelProvider) getRootAdapterFactory().adapt(objectToAdapt, IItemLabelProvider.class); if (labelProvider != null) { label = labelProvider.getText(objectToAdapt); } } } return label; }
Source:
<code>public void initFromPage(int valueCount, ByteBuffer page, int offset) throws IOException { <START> in = new ByteBufferInputStream(page.duplicate(), offset, page.limit() - offset); <END> this.config = DeltaBinaryPackingConfig.readConfig(in); this.page = page; this.totalValueCount = BytesUtils.readUnsignedVarInt(in); allocateValuesBuffer(); bitWidths = new int[config.miniBlockNumInABlock]; valuesBuffer[valuesBuffered++] = BytesUtils.readZigZagVarInt(in); while (valuesBuffered < totalValueCount) { loadNewBlockToBuffer(); } this.nextOffset = page.limit() - in.available(); }</code><technical_language>is duplicate necessary</technical_language>

Target:
public void initFromPage(int valueCount, ByteBuffer page, int offset) throws IOException { in = new ByteBufferInputStream(page, offset, page.limit() - offset); this.config = DeltaBinaryPackingConfig.readConfig(in); this.page = page; this.totalValueCount = BytesUtils.readUnsignedVarInt(in); allocateValuesBuffer(); bitWidths = new int[config.miniBlockNumInABlock]; valuesBuffer[valuesBuffered++] = BytesUtils.readZigZagVarInt(in); while (valuesBuffered < totalValueCount) { loadNewBlockToBuffer(); } this.nextOffset = page.limit() - in.available(); }
Source:
<code>public void nodeAssignmentSent(String node, boolean successful) { if (!blacklistSendAssignentFailures) { return; } if (!successful) { int failCount = assignmentFailures.getOrDefault(node, 0) + 1; <START> assignmentFailures.put(node, failCount); <END> } }</code><technical_language>Synchronization is needed a race condition current count updating count (line 296 line297) this.assignmentFailures.clear(); assignmentFailures.put(node, failCount);</technical_language>

Target:
public void nodeAssignmentSent(String node, boolean successful) { if (!blacklistSendAssignentFailures) { return; } if (!successful) { synchronized (assignmentFailures) { int failCount = assignmentFailures.getOrDefault(node, 0) + 1; assignmentFailures.put(node, failCount); } } }
Source:
<code>protected boolean migrateAllVms(ExecutionContext parentContext, boolean HAOnly) { boolean succeeded = true; for (VM vm : vms) { if (vm.isHostedEngine()) { <START> if (!canScheduleVm(vm)) { succeeded = false; appendCustomCommaSeparatedValue("failedVms", vm.getName()); log.error("There is no host capable of running the hosted engine VM"); continue; } <END> if (getVds().getStatus() == VDSStatus.NonOperational) { continue; } } if (vm.getStatus() != VMStatus.MigratingFrom && (!HAOnly || vm.isAutoStartup())) { if (!migrateVm(vm, parentContext)) { succeeded = false; appendCustomCommaSeparatedValue("failedVms", vm.getName()); log.error("Failed to migrate VM '{}'", vm.getName()); } } } return succeeded; }</code><technical_language>this block removed. need call scheduler migrating VM</technical_language>

Target:
protected boolean migrateAllVms(ExecutionContext parentContext, boolean HAOnly) { boolean succeeded = true; for (VM vm : vms) { if (vm.isHostedEngine() && getVds().getStatus() == VDSStatus.NonOperational) { continue; } if (vm.getStatus() != VMStatus.MigratingFrom && (!HAOnly || vm.isAutoStartup())) { if (!migrateVm(vm, parentContext)) { succeeded = false; appendCustomCommaSeparatedValue("failedVms", vm.getName()); log.error("Failed to migrate VM '{}'", vm.getName()); } } } return succeeded; }
Source:
<code>private void buffer(Page page) { <START> for (int position = 0; position < page.getPositionCount(); position++) { <END> pageBuilder.declarePosition(); for (int channel = 0; channel < types.size(); channel++) { Type type = types.get(channel); type.appendTo(page.getBlock(channel), position, pageBuilder.getBlockBuilder(channel)); } } if (pageBuilder.isFull()) { flush(); } }</code><technical_language>@sopel39 sueggestion: replace outer loop of CPU vectorization</technical_language>

Target:
private void buffer(Page page) { pageBuilder.declarePositions(page.getPositionCount()); for (int channel = 0; channel < types.size(); channel++) { Type type = types.get(channel); for (int position = 0; position < page.getPositionCount(); position++) { type.appendTo(page.getBlock(channel), position, pageBuilder.getBlockBuilder(channel)); } } if (pageBuilder.isFull()) { flush(); } }
Source:
<code>public void testTemplatedAliasDeclarationValueArgument() throws Exception { parseAndCheckBindings(); BindingAssertionHelper assertionHelper = getAssertionHelper(); ICPPField buff = assertionHelper.assertNonProblem("int buff [Size];", "buff", ICPPField.class); ICPPSpecialization buffRef = assertionHelper.assertNonProblem("myA.buff[0] = 1;", "buff", ICPPSpecialization.class); assertEquals(buff, buffRef.getSpecializedBinding()); <START> assertEquals(buffRef.getTemplateParameterMap().getArgument(0).getNonTypeValue().numericalValue(), Long.valueOf(4)); <END> assertEquals(buffRef.getTemplateParameterMap().getArgument(1).getNonTypeValue().numericalValue(), Long.valueOf(5)); }</code><technical_language>In case order of arguments is wrong needs reversed</technical_language>

Target:
public void testTemplatedAliasDeclarationValueArgument() throws Exception { parseAndCheckBindings(); BindingAssertionHelper assertionHelper = getAssertionHelper(); ICPPField buff = assertionHelper.assertNonProblem("int buff [Size];", "buff", ICPPField.class); ICPPSpecialization buffRef = assertionHelper.assertNonProblem("myA.buff[0] = 1;", "buff", ICPPSpecialization.class); assertEquals(buff, buffRef.getSpecializedBinding()); assertEquals(4L,buffRef.getTemplateParameterMap().getArgument(0).getNonTypeValue().numericalValue()); assertEquals(5L,buffRef.getTemplateParameterMap().getArgument(1).getNonTypeValue().numericalValue()); }
Source:
<code>public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) { if (e.getMessage() != null && e.getMessage() instanceof Position) { Position position = (Position) e.getMessage(); String uniqueId = Context.getDataManager().getDeviceById(position.getDeviceId()).getUniqueId(); StringBuilder s = new StringBuilder(); s.append(formatChannel(e.getChannel())).append(" "); s.append("id: ").append(uniqueId).append(", "); s.append("time: ").append( new SimpleDateFormat(Log.DATE_FORMAT).format(position.getFixTime())).append(", "); s.append("lat: ").append(String.format("%.5f", position.getLatitude())).append(", "); s.append("lon: ").append(String.format("%.5f", position.getLongitude())).append(", "); s.append("speed: ").append(String.format("%.1f", position.getSpeed())).append(", "); s.append("course: ").append(String.format("%.1f", position.getCourse())); <START> if ((position.getAttributes().get(Event.KEY_RESULT) != null)) { <END> s.append(", result: ").append(position.getAttributes().get(Event.KEY_RESULT)); } Log.info(s.toString()); Position lastPosition = Context.getConnectionManager().getLastPosition(position.getDeviceId()); if (lastPosition == null || position.getFixTime().compareTo(lastPosition.getFixTime()) > 0) { Context.getConnectionManager().updatePosition(position); } } }</code><technical_language>Get result for performance</technical_language>

Target:
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) { if (e.getMessage() != null && e.getMessage() instanceof Position) { Position position = (Position) e.getMessage(); String uniqueId = Context.getDataManager().getDeviceById(position.getDeviceId()).getUniqueId(); StringBuilder s = new StringBuilder(); s.append(formatChannel(e.getChannel())).append(" "); s.append("id: ").append(uniqueId).append(", "); s.append("time: ").append( new SimpleDateFormat(Log.DATE_FORMAT).format(position.getFixTime())).append(", "); s.append("lat: ").append(String.format("%.5f", position.getLatitude())).append(", "); s.append("lon: ").append(String.format("%.5f", position.getLongitude())).append(", "); s.append("speed: ").append(String.format("%.1f", position.getSpeed())).append(", "); s.append("course: ").append(String.format("%.1f", position.getCourse())); Object cmdResult = position.getAttributes().get(Event.KEY_RESULT); if (cmdResult != null) { s.append(", result: ").append(cmdResult); } Log.info(s.toString()); Position lastPosition = Context.getConnectionManager().getLastPosition(position.getDeviceId()); if (lastPosition == null || position.getFixTime().compareTo(lastPosition.getFixTime()) > 0) { Context.getConnectionManager().updatePosition(position); } } }
Source:
<code><START> public List<URL> getJobJarAndDependencies(ProgramOptions programOptions) throws FileNotFoundException, ProgramInvocationException { <END> String entryPointClass = programOptions.getEntryPointClassName(); String jarFilePath = programOptions.getJarFilePath(); File jarFile = jarFilePath != null ? getJarFile(jarFilePath) : null; return PackagedProgram .getJobJarAndDependencies(jarFile != null ? jarFile : null, entryPointClass); }</code><technical_language>this package-private public. annotate @VisibleForTesting</technical_language>

Target:
private List<URL> getJobJarAndDependencies(ProgramOptions programOptions) throws CliArgsException { String entryPointClass = programOptions.getEntryPointClassName(); String jarFilePath = programOptions.getJarFilePath(); try { File jarFile = jarFilePath != null ? getJarFile(jarFilePath) : null; return PackagedProgram.getJobJarAndDependencies(jarFile, entryPointClass); } catch (FileNotFoundException | ProgramInvocationException e) { throw new CliArgsException("Could not get job jar and dependencies from JAR file: " + e.getMessage(), e); } }
Source:
<code>public void init(StreamGraph streamGraph, Config config) { try { SamzaSqlApplicationConfig sqlConfig = new SamzaSqlApplicationConfig(config); QueryTranslator queryTranslator = new QueryTranslator(sqlConfig); try { Class.forName("org.apache.calcite.jdbc.Driver"); } catch (ClassNotFoundException e) { throw new SamzaException("Unable to load calcite jdbc driver"); } List<SamzaSqlQueryParser.QueryInfo> queries = sqlConfig.getQueryInfo(); for (SamzaSqlQueryParser.QueryInfo query : queries) { <START> LOG.info("Translating the query to samza stream graph", query.getSelectQuery()); <END> queryTranslator.translate(query, streamGraph); } } catch (Exception e) { LOG.error("SamzaSqlApplication threw exception.", e); throw e; } }</code><technical_language>able throw Exception declaring it</technical_language>

Target:
public void init(StreamGraph streamGraph, Config config) { try { SamzaSqlApplicationConfig sqlConfig = new SamzaSqlApplicationConfig(config); QueryTranslator queryTranslator = new QueryTranslator(sqlConfig); List<SamzaSqlQueryParser.QueryInfo> queries = sqlConfig.getQueryInfo(); for (SamzaSqlQueryParser.QueryInfo query : queries) { LOG.info("Translating the query to samza stream graph", query.getSelectQuery()); queryTranslator.translate(query, streamGraph); } } catch (RuntimeException e) { LOG.error("SamzaSqlApplication threw exception.", e); throw e; } }
Source:
<code>public void saveUnretireProgram_shouldTestSaveUnretireProgram() { Program program = new Program(); Concept concept = Context.getConceptService().getAllConcepts().get(0); <START> User user = Context.getUserService().getAllUsers().get(0); <END> program.setConcept(concept); program.setDescription("test"); program.setName("programTest"); program.setCreator(user); List<Program> list = pws.getAllPrograms(); String uuid = program.getUuid(); pws.retireProgram(program, "abc"); pws.unretireProgram(program); Program program1 = dao.getProgramByUuid(uuid); assertEquals(program, program1); }</code><technical_language>suggestion User testUser = Context.getUserService().getAllUsers().get(0);</technical_language>

Target:
public void saveUnretireProgram_shouldTestSaveUnretireProgram() { Program program = new Program(); Concept concept = Context.getConceptService().getAllConcepts().get(0); User testUser = Context.getUserService().getAllUsers().get(0); program.setConcept(concept); program.setDescription("test"); program.setName("programTest"); program.setCreator(testUser); pws.getAllPrograms(); pws.retireProgram(program, "abc"); pws.unretireProgram(program); Program programToBeAsserted = dao.getProgramByUuid(program.getUuid()); assertEquals(program, programToBeAsserted); }
Source:
<code>public List<VerbDefinition> matchingVerbDefinitions(Activity activity) { <START> Set<VerbDefinition> candidates = Sets.newConcurrentHashSet(verbDefinitionSet); <END> for( VerbDefinition verbDefinition : candidates ) { if( activity.getVerb().equals(verbDefinition.getValue())) { for( ObjectCombination criteria : verbDefinition.getObjects()) { if( filter(activity, criteria) == false ) { verbDefinition.getObjects().remove(criteria); } } } else { candidates.remove(verbDefinition); } if( verbDefinition.getObjects().size() == 0) candidates.remove(verbDefinition); } return Lists.newArrayList(candidates); }</code><technical_language>This clone individual VerbDefinitions mutate below, is changing definitions for users of this instance, other object a reference VerbDefinitions, right</technical_language>

Target:
public List<VerbDefinition> matchingVerbDefinitions(Activity activity) { Set<VerbDefinition> matches = Sets.newConcurrentHashSet(); for( VerbDefinition verbDefinition : verbDefinitionSet ) { VerbDefinition verbDefinitionCopy = SerializationUtil.cloneBySerialization(verbDefinition); if( activity.getVerb().equals(verbDefinition.getValue())) { for( ObjectCombination criteria : verbDefinitionCopy.getObjects()) { if( filter(activity, criteria) == false ) { verbDefinitionCopy.getObjects().remove(criteria); } } if( verbDefinitionCopy.getObjects().size() > 0) matches.add(verbDefinitionCopy); } } return Lists.newArrayList(matches); }
Source:
<code>public void shouldCountWorkspacesInStatus() throws Exception { <START> activityManager.countWorkspacesInStatus(WorkspaceStatus.STARTING, 0L); <END> verify(workspaceActivityDao).countWorkspacesInStatus(eq(WorkspaceStatus.STARTING), eq(0L)); }</code><technical_language>nice check activityManager return received DAO</technical_language>

Target:
public void shouldCountWorkspacesInStatus() throws Exception { when(workspaceActivityDao.countWorkspacesInStatus(eq(WorkspaceStatus.STARTING), eq(0L))) .thenReturn(15L); long count = activityManager.countWorkspacesInStatus(WorkspaceStatus.STARTING, 0L); verify(workspaceActivityDao).countWorkspacesInStatus(eq(WorkspaceStatus.STARTING), eq(0L)); assertEquals(15L, count); }
Source:
<code>public Connection createConnection(String queryString) throws SQLException, NoDriverFoundException { final Properties info = new Properties(); info.put("user", this.getUsername()); info.put("password", this.getPassword()); final String url = constructUrlForConnection(queryString); final Driver jdbcDriverInstance = getJdbcDriverInstance(); SQLException lastException = null; try { long start = System.currentTimeMillis(); while (System.currentTimeMillis() < start + (1000 * connectTimeoutSeconds) && isRunning()) { try { logger().debug("Trying to create JDBC connection using to with properties: {}", driver.getClass().getName(), url, info); return jdbcDriverInstance.connect(url, info); } catch (SQLException e) { lastException = e; <START> Thread.sleep(1000L); <END> } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } throw new SQLException("Could not create new connection", lastException); }</code><technical_language>1s is a bit much, ~100ms</technical_language>

Target:
public Connection createConnection(String queryString) throws SQLException, NoDriverFoundException { final Properties info = new Properties(); info.put("user", this.getUsername()); info.put("password", this.getPassword()); final String url = constructUrlForConnection(queryString); final Driver jdbcDriverInstance = getJdbcDriverInstance(); SQLException lastException = null; try { long start = System.currentTimeMillis(); while (System.currentTimeMillis() < start + (1000 * connectTimeoutSeconds) && isRunning()) { try { logger().debug("Trying to create JDBC connection using to with properties: {}", driver.getClass().getName(), url, info); return jdbcDriverInstance.connect(url, info); } catch (SQLException e) { lastException = e; Thread.sleep(100L); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } throw new SQLException("Could not create new connection", lastException); }
Source:
<code>public void start() { supervisorTaskChecker = Execs.scheduledSingleThreaded("intermediary-data-manager-%d"); supervisorTaskChecker.scheduleAtFixedRate( () -> { for (StorageLocation location : intermediarySegmentsLocations) { final File[] dirsPerSupervisorTask = location.getPath().listFiles(); if (dirsPerSupervisorTask != null) { for (File supervisorTaskDir : dirsPerSupervisorTask) { final String supervisorTaskId = supervisorTaskDir.getName(); supervisorTaskCheckTimes.computeIfAbsent( supervisorTaskId, k -> DateTimes.nowUtc().plus(intermediaryPartitionTimeout) ); } } } }, intermediaryPartitionDiscoveryPeriodSec, intermediaryPartitionDiscoveryPeriodSec, TimeUnit.SECONDS ); supervisorTaskChecker.scheduleAtFixedRate( () -> { final DateTime now = DateTimes.nowUtc(); final Set<String> expiredSupervisorTasks = new HashSet<>(); for (Entry<String, DateTime> entry : supervisorTaskCheckTimes.entrySet()) { final String supervisorTaskId = entry.getKey(); final DateTime checkTime = entry.getValue(); if (checkTime.isAfter(now)) { expiredSupervisorTasks.add(supervisorTaskId); } } final Map<String, TaskStatus> taskStatuses = indexingServiceClient.getTaskStatuses(expiredSupervisorTasks); RuntimeException exception = null; for (Entry<String, TaskStatus> entry : taskStatuses.entrySet()) { final String supervisorTaskId = entry.getKey(); final TaskStatus status = entry.getValue(); if (status.getStatusCode().isComplete()) { try { deletePartitions(supervisorTaskId); } catch (IOException e) { if (exception == null) { exception = new RuntimeException(e); } else { exception.addSuppressed(e); } } } } if (exception != null) { <START> throw exception; <END> } }, intermediaryPartitionCleanupPeriodSec, intermediaryPartitionCleanupPeriodSec, TimeUnit.SECONDS ); }</code><technical_language>this code is running in a scheduler , do throw exception in end instead of logging happened</technical_language>

Target:
public void start() { supervisorTaskChecker = Execs.scheduledSingleThreaded("intermediary-data-manager-%d"); supervisorTaskChecker.scheduleAtFixedRate( () -> { try { discoverSupervisorTaskPartitions(); } catch (Exception e) { log.warn(e, "Error while discovering supervisorTasks"); } }, intermediaryPartitionDiscoveryPeriodSec, intermediaryPartitionDiscoveryPeriodSec, TimeUnit.SECONDS ); supervisorTaskChecker.scheduleAtFixedRate( () -> { try { deleteExpiredSuprevisorTaskPartitionsIfNotRunning(); } catch (InterruptedException e) { log.error(e, "Error while cleaning up partitions for expired supervisors"); } catch (Exception e) { log.warn(e, "Error while cleaning up partitions for expired supervisors"); } }, intermediaryPartitionCleanupPeriodSec, intermediaryPartitionCleanupPeriodSec, TimeUnit.SECONDS ); }
Source:
<code>public void load(GlowEnderman entity, CompoundTag compound) { super.load(entity, compound); final MaterialData[] carried = {null}; if (!compound.readShort("carried", id -> { Material type = Material.getMaterial(id); if (type != null && type != Material.AIR) { carried[0] = new MaterialData(type); } })) { compound.readString("carried", id -> { if (!id.isEmpty()) { if (!id.contains(":")) { id = "minecraft:" + id; } Material type = ItemIds.getBlock(id); if (type == null) { type = ItemIds.getItem(id); } if (type != null && type != Material.AIR) { carried[0] = new MaterialData(type); } } }); } <START> if (carried[0] != null) { <END> compound.readShort("carriedData", data -> carried[0].setData((byte) data)); entity.setCarriedMaterial(carried[0]); } }</code><technical_language>Chaining beneficial well</technical_language>

Target:
public void load(GlowEnderman entity, CompoundTag compound) { super.load(entity, compound); compound.tryGetMaterial("carried") .map(MaterialData::new) .ifPresent(carried -> { compound.readShort("carriedData", data -> carried.setData((byte) data)); entity.setCarriedMaterial(carried); }); }
Source:
<code>public static void main(String[] args) throws IOException { if (args.length != 1) usage("nassau-binaryfile-perf-test <input-file>"); String inputFilename = args[0]; MessageCounter counter = new MessageCounter(); BinaryFILEStatusListener statusListener = new BinaryFILEStatusListener() { @Override public void endOfSession() { } }; BinaryFILEStatusParser parser = new BinaryFILEStatusParser(counter, statusListener); <START> double seconds; <END> try (BinaryFILEReader reader = BinaryFILEReader.open(new File(inputFilename), parser)) { long started = System.nanoTime(); while (reader.read() >= 0); long finished = System.nanoTime(); seconds = (finished - started) / (1000.0 * 1000 * 1000); } long messages = counter.getMessageCount(); System.out.printf("Results:\n"); System.out.printf("\n"); System.out.printf(" Messages: %10d\n", messages); System.out.printf(" Time: %13.2f s\n", seconds); System.out.printf(" Throughput: %13.2f messages/s\n", messages / seconds); System.out.printf("\n"); }</code><technical_language>extending this try block incorporate result printouts slightly prettier need for declaration of seconds. do think</technical_language>

Target:
public static void main(String[] args) throws IOException { if (args.length != 1) usage("nassau-binaryfile-perf-test <input-file>"); String inputFilename = args[0]; MessageCounter counter = new MessageCounter(); BinaryFILEStatusListener statusListener = new BinaryFILEStatusListener() { @Override public void endOfSession() { } }; BinaryFILEStatusParser parser = new BinaryFILEStatusParser(counter, statusListener); try (BinaryFILEReader reader = BinaryFILEReader.open(new File(inputFilename), parser)) { long started = System.nanoTime(); while (reader.read() >= 0); long finished = System.nanoTime(); double seconds = (finished - started) / (1000.0 * 1000 * 1000); long messages = counter.getMessageCount(); System.out.printf("Results:\n"); System.out.printf("\n"); System.out.printf(" Messages: %10d\n", messages); System.out.printf(" Time: %13.2f s\n", seconds); System.out.printf(" Throughput: %13.2f messages/s\n", messages / seconds); System.out.printf("\n"); } }
Source:
<code>public boolean doesDependencyExist( String parameterName ) { return dependencyGraph .values() .stream() .flatMap( Set::stream ) <START> .anyMatch( s -> s.compareTo( parameterName ) == 0 ); <END> }</code><technical_language>Is this checking if strings equal</technical_language>

Target:
public boolean doesDependencyExist( String parameterName ) { return dependencyGraph .values() .stream() .flatMap( Set::stream ) .anyMatch( s -> s.equals( parameterName ) ); }
Source:
<code>public RaptorSessionProperties(StorageManagerConfig config) { sessionProperties = ImmutableList.of( stringProperty( EXTERNAL_BATCH_ID, "Two-phase commit batch ID", null, true), dataSizeSessionProperty( READER_MAX_MERGE_DISTANCE, "Reader: Maximum size of gap between two reads to merge into a single read", config.getOrcMaxMergeDistance(), false), dataSizeSessionProperty( READER_MAX_READ_SIZE, "Reader: Maximum size of a single read", config.getOrcMaxReadSize(), false), dataSizeSessionProperty( READER_STREAM_BUFFER_SIZE, "Reader: Size of buffer for streaming reads", config.getOrcStreamBufferSize(), false), dataSizeSessionProperty( READER_TINY_STRIPE_THRESHOLD, "Reader: Threshold below which an ORC stripe or file will read in its entirety", config.getOrcTinyStripeThreshold(), false), booleanProperty( READER_LAZY_READ_SMALL_RANGES, "Experimental: Reader: Read small file segments lazily", config.isOrcLazyReadSmallRanges(), false), integerProperty( ONE_SPLIT_PER_BUCKET_THRESHOLD, "Experimental: Maximum bucket count at which to produce multiple splits per bucket", config.getOneSplitPerBucketThreshold(), false), booleanProperty( ORC_ZSTD_JNI_DECOMPRESSION_ENABLED, "use JNI based std decompression for reading ORC files", config.isZstdJniDecompressionEnabled(), true), dataSizeSessionProperty( MAX_BUFFER_SIZE, <START> "Max buffer size.", <END> config.getMaxBufferSize(), false)); }</code><technical_language>nit: "Raptor page writer max buffer size."</technical_language>

Target:
public RaptorSessionProperties(StorageManagerConfig config) { sessionProperties = ImmutableList.of( stringProperty( EXTERNAL_BATCH_ID, "Two-phase commit batch ID", null, true), dataSizeSessionProperty( READER_MAX_MERGE_DISTANCE, "Reader: Maximum size of gap between two reads to merge into a single read", config.getOrcMaxMergeDistance(), false), dataSizeSessionProperty( READER_MAX_READ_SIZE, "Reader: Maximum size of a single read", config.getOrcMaxReadSize(), false), dataSizeSessionProperty( READER_STREAM_BUFFER_SIZE, "Reader: Size of buffer for streaming reads", config.getOrcStreamBufferSize(), false), dataSizeSessionProperty( READER_TINY_STRIPE_THRESHOLD, "Reader: Threshold below which an ORC stripe or file will read in its entirety", config.getOrcTinyStripeThreshold(), false), booleanProperty( READER_LAZY_READ_SMALL_RANGES, "Experimental: Reader: Read small file segments lazily", config.isOrcLazyReadSmallRanges(), false), integerProperty( ONE_SPLIT_PER_BUCKET_THRESHOLD, "Experimental: Maximum bucket count at which to produce multiple splits per bucket", config.getOneSplitPerBucketThreshold(), false), booleanProperty( ORC_ZSTD_JNI_DECOMPRESSION_ENABLED, "use JNI based std decompression for reading ORC files", config.isZstdJniDecompressionEnabled(), true), dataSizeSessionProperty( WRITER_MAX_BUFFER_SIZE, "Raptor page writer max buffer size", config.getMaxBufferSize(), false)); }
Source:
<code>public Extended80211Payload(final ByteBuf buffer) throws InvalidPacketException { this.ciphersuite = new CipherSuite(buffer); <START> this.data = new Opaque(buffer, Optional.empty(), buffer1 -> Opaque.parseBytes(buffer1)); <END> }</code><technical_language>Revert this</technical_language>

Target:
public Extended80211Payload(final ByteBuf buffer) throws InvalidPacketException { this.ciphersuite = new CipherSuite(buffer); this.data = new Opaque(buffer, Optional.empty(), Opaque::parseBytes); }
Source:
<code>public void jjtClose() { if (beginLine == -1 && (children == null || children.length == 0)) { beginColumn = parser.token.beginColumn; } if (beginLine == -1) { beginLine = parser.token.beginLine; } endLine = parser.token.endLine; endColumn = parser.token.endColumn; <START> if (endLine < beginLine) { <END> beginLine = endLine; beginColumn = endColumn; } if (endLine == beginLine && endColumn < beginColumn) { beginColumn = endColumn; } }</code><technical_language>avoid of (in jjtOpen/Close) if instead of fields of AbstractNode, delegated method calls tokens, eg: <LINK_0></technical_language>

Target:
public void jjtClose() { if (parser.token.next == jjtGetFirstToken()) { Token next = parser.token.next; Token implicit = new Token(IMPLICIT_TOKEN, ""); implicit.beginColumn = next.beginColumn; implicit.endColumn = next.beginColumn - 1; implicit.beginLine = next.beginLine; implicit.endLine = next.beginLine; implicit.next = next; if (next.specialToken != null) { next.specialToken.next = implicit; implicit.specialToken = next.specialToken; } next.specialToken = implicit; jjtSetFirstToken(implicit); jjtSetLastToken(implicit); } }
Source:
<code>public RunLengthEncodedBlock(Block value, int positionCount) { requireNonNull(value, "value is null"); if (value.getPositionCount() != 1) { throw new IllegalArgumentException(format("Expected value to contain a single position but has %s positions", value.getPositionCount())); } if (value instanceof RunLengthEncodedBlock) { throw new IllegalArgumentException(format("Value can not be an instance of a %s", getClass().getName())); } if (positionCount < 0) { throw new IllegalArgumentException("positionCount is negative"); } <START> this.value = value <END> this.positionCount = positionCount; }</code><technical_language>syntax typo (Add position checks in RunLenghtEncodedBlock commit)</technical_language>

Target:
public RunLengthEncodedBlock(Block value, int positionCount) { requireNonNull(value, "value is null"); if (value.getPositionCount() != 1) { throw new IllegalArgumentException(format("Expected value to contain a single position but has %s positions", value.getPositionCount())); } if (value instanceof RunLengthEncodedBlock) { this.value = ((RunLengthEncodedBlock) value).getValue(); } else { this.value = value; } if (positionCount < 0) { throw new IllegalArgumentException("positionCount is negative"); } this.positionCount = positionCount; }
Source:
<code>public static boolean isDefaultClient(ClientRegistration clientRegistration) { <START> return AADWebAppConfiguration.AZURE_CLIENT_REGISTRATION_ID.equals( <END> clientRegistration.getClientName()); }</code><technical_language>Move AZURE_CLIENT_REGISTRATION_ID AADClientRegistrationRepository.java, more related client registration</technical_language>

Target:
public static boolean isDefaultClient(ClientRegistration clientRegistration) { return AZURE_CLIENT_REGISTRATION_ID.equals( clientRegistration.getClientName()); }
Source:
<code>public static APIQueryControlResult submitQuery(final Configuration configuration) throws IOException, InjectionException, URISyntaxException, StreamTypeMismatchException { final Injector injector = Tang.Factory.getTang().newInjector(configuration); final String source1Socket = injector.getNamedInstance(UnionLeftSourceAddress.class); final String source2Socket = injector.getNamedInstance(UnionRightSourceAddress.class); final TextSocketSourceConfiguration localTextSocketSource1Conf = MISTExampleUtils.getLocalTextSocketSourceConf(source1Socket); final TextSocketSourceConfiguration localTextSocketSource2Conf = MISTExampleUtils.getLocalTextSocketSourceConf(source2Socket); final TextSocketSinkConfiguration localTextSocketSinkConf = MISTExampleUtils.getLocalTextSocketSinkConf(); final MISTBiPredicate<String, String> joinPred = (s1, s2) -> s1.equals(s2); <START> final ApplyStatefulFunction<Tuple2<String, String>, String> applyStatefulFunction = new CollectStringTupleState(); <END> final MISTQueryBuilder queryBuilder = new MISTQueryBuilder(); final ContinuousStream sourceStream1 = queryBuilder.socketTextStream(localTextSocketSource1Conf); final ContinuousStream sourceStream2 = queryBuilder.socketTextStream(localTextSocketSource2Conf); sourceStream1 .join(sourceStream2, joinPred, new TimeWindowInformation(5000, 5000)) .applyStatefulWindow(applyStatefulFunction) .textSocketOutput(localTextSocketSinkConf); final MISTQuery query = queryBuilder.build(); return MISTExampleUtils.submit(query, configuration); }</code><technical_language>good rename CollectStringTupleState</technical_language>

Target:
public static APIQueryControlResult submitQuery(final Configuration configuration) throws IOException, InjectionException, URISyntaxException, StreamTypeMismatchException { final Injector injector = Tang.Factory.getTang().newInjector(configuration); final String source1Socket = injector.getNamedInstance(UnionLeftSourceAddress.class); final String source2Socket = injector.getNamedInstance(UnionRightSourceAddress.class); final TextSocketSourceConfiguration localTextSocketSource1Conf = MISTExampleUtils.getLocalTextSocketSourceConf(source1Socket); final TextSocketSourceConfiguration localTextSocketSource2Conf = MISTExampleUtils.getLocalTextSocketSourceConf(source2Socket); final TextSocketSinkConfiguration localTextSocketSinkConf = MISTExampleUtils.getLocalTextSocketSinkConf(); final MISTBiPredicate<String, String> joinPred = (s1, s2) -> s1.equals(s2); final ApplyStatefulFunction<Tuple2<String, String>, String> applyStatefulFunction = new FoldStringTupleFunction(); final MISTQueryBuilder queryBuilder = new MISTQueryBuilder(); final ContinuousStream sourceStream1 = queryBuilder.socketTextStream(localTextSocketSource1Conf); final ContinuousStream sourceStream2 = queryBuilder.socketTextStream(localTextSocketSource2Conf); sourceStream1 .join(sourceStream2, joinPred, new TimeWindowInformation(5000, 5000)) .applyStatefulWindow(applyStatefulFunction) .textSocketOutput(localTextSocketSinkConf); final MISTQuery query = queryBuilder.build(); return MISTExampleUtils.submit(query, configuration); }
Source:
<code>private void populateSelectedIssues(Optional<TurboIssue> selectedIssue) { selectedIssues.getChildren().clear(); FlowPane selectedIssueCards = getSelectedIssuesPane(selectedIssue); if (!selectedIssueCards.getChildren().isEmpty()) { <START> selectedIssues.getChildren().addAll(createRepoTitle(selectedIssue.get().getRepoId()), selectedIssueCards); <END> } }</code><technical_language>If selected issue is guaranteed this point, method instead of optional</technical_language>

Target:
private void populateSelectedIssues(Optional<TurboIssue> selectedIssue) { selectedIssues.getChildren().clear(); FlowPane selectedIssueCards = getSelectedIssuesPane(selectedIssue); selectedIssue.ifPresent(issue -> selectedIssues.getChildren().addAll(createRepoTitle(issue.getRepoId()), selectedIssueCards)); }
Source:
<code>public FileGenerator(String _filename) { filename = _filename; try { File file = new File(filename); FileInputStream in = new FileInputStream(file); reader = new BufferedReader(new InputStreamReader(in)); } catch(IOException e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>errors caught else? Is a reason exceptions printed instead of thrown previously</technical_language>

Target:
public FileGenerator(String _filename) { filename = _filename; reloadFile(); }
Source:
<code>private InvocationStage handleTxWriteCommand(InvocationContext ctx, AbstractDataWriteCommand command, Object key) throws Throwable { try { CacheEntry entry = ctx.lookupEntry(command.getKey()); if (entry == null) { if (isLocalModeForced(command) || command.hasFlag(Flag.SKIP_REMOTE_LOOKUP) || command.loadType() == VisitableCommand.LoadType.DONT_LOAD) { <START> entryFactory.wrapExternalEntry(ctx, key, null, true, command.hasFlag(Flag.IGNORE_RETURN_VALUES)); <END> } else { return invokeNextAsync(ctx, command, remoteGet(ctx, command, true)).handle( (rCtx, rCommand, rv, t) -> updateMatcherForRetry((WriteCommand) rCommand)); } } return invokeNext(ctx, command).handle((rCtx, rCommand, rv, t) -> updateMatcherForRetry((WriteCommand) rCommand)); } catch (Throwable t) { updateMatcherForRetry(command); throw t; } }</code><technical_language>Feels skipRead true here, used</technical_language>

Target:
private BasicInvocationStage handleTxWriteCommand(InvocationContext ctx, AbstractDataWriteCommand command, Object key) throws Throwable { try { if (!ctx.isOriginLocal() && !cdl.localNodeIsOwner(command.getKey())) { return returnWith(null); } CacheEntry entry = ctx.lookupEntry(command.getKey()); if (entry == null) { if (isLocalModeForced(command) || command.hasFlag(Flag.SKIP_REMOTE_LOOKUP) || !needsPreviousValue(ctx, command)) { entryFactory.wrapExternalEntry(ctx, key, null, true); } else { return invokeNextAsync(ctx, command, remoteGet(ctx, command, command.getKey(), true)).handle( (rCtx, rCommand, rv, t) -> updateMatcherForRetry((WriteCommand) rCommand)); } } return invokeNext(ctx, command).handle((rCtx, rCommand, rv, t) -> updateMatcherForRetry((WriteCommand) rCommand)); } catch (Throwable t) { updateMatcherForRetry(command); throw t; } }
Source:
<code>protected void onExportChanged() { boolean externalNetwork = (Boolean) getExport().getEntity(); getExternalProviders().setIsChangable(externalNetwork); getIsVmNetwork().setIsChangable(!externalNetwork && isSupportBridgesReportByVDSM()); <START> getHasMtu().setIsChangable(!externalNetwork && isMTUOverrideSupported()); <END> if (externalNetwork) { getIsVmNetwork().setEntity(true); getHasMtu().setEntity(false); } Iterable<NetworkClusterModel> networkClusters = getNetworkClusterList().getItems(); if (networkClusters != null) { for (NetworkClusterModel networkCluster : networkClusters) { if (!(Boolean) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.SupportCustomDeviceProperties, networkCluster.getEntity().getcompatibility_version().getValue())) { networkCluster.setIsChangable(!externalNetwork); networkCluster.setAttached(!externalNetwork); } networkCluster.setRequired(!externalNetwork); } } super.onExportChanged(); }</code><technical_language>of lines moved methods calculating desired state dependencies, I in another file</technical_language>

Target:
protected void onExportChanged() { boolean externalNetwork = (Boolean) getExport().getEntity(); getExternalProviders().setIsChangable(externalNetwork); getIsVmNetwork().setIsChangable(!externalNetwork && isSupportBridgesReportByVDSM()); if (externalNetwork) { getIsVmNetwork().setEntity(true); } Iterable<NetworkClusterModel> networkClusters = getNetworkClusterList().getItems(); if (networkClusters != null) { for (NetworkClusterModel networkCluster : networkClusters) { if (!(Boolean) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.SupportCustomDeviceProperties, networkCluster.getEntity().getcompatibility_version().getValue())) { networkCluster.setIsChangable(!externalNetwork); networkCluster.setAttached(!externalNetwork); } networkCluster.setRequired(!externalNetwork); } } super.onExportChanged(); }
Source:
<code>public void shouldCreateStandbyTask() { <START> final MockProcessor mockProcessor = new MockProcessor(); <END> internalTopologyBuilder.addSource(null, "source1", null, null, null, topic1); internalTopologyBuilder.addProcessor("processor1", () -> mockProcessor, "source1"); internalTopologyBuilder.addStateStore(new MockKeyValueStoreBuilder("myStore", true), "processor1"); final StreamThread.StandbyTaskCreator standbyTaskCreator = createStandbyTaskCreator(internalTopologyBuilder); final StandbyTask standbyTask = standbyTaskCreator.createTask( new MockConsumer<>(OffsetResetStrategy.EARLIEST), new TaskId(1, 2), Collections.emptySet()); assertThat(standbyTask, not(nullValue())); }</code><technical_language>reuse initialization code for L1068 - L1070</technical_language>

Target:
public void shouldCreateStandbyTask() { setupInternalTopologyWithoutState(); internalTopologyBuilder.addStateStore(new MockKeyValueStoreBuilder("myStore", true), "processor1"); final StandbyTask standbyTask = createStandbyTask(); assertThat(standbyTask, not(nullValue())); }
Source:
<code><START> public ExchangeClientStatus getStatus() <END> { int bufferedPages; synchronized (this) { bufferedPages = pageBuffer.size(); if (bufferedPages > 0 && pageBuffer.peekLast() == NO_MORE_PAGES) { bufferedPages--; } } ImmutableList.Builder<PageBufferClientStatus> exchangeStatus = ImmutableList.builder(); for (HttpPageBufferClient client : allClients.values()) { exchangeStatus.add(client.getStatus()); } return new ExchangeClientStatus(bufferBytes, maxBufferBytes, averageBytesPerRequest, successfulRequests, bufferedPages, noMoreLocations, exchangeStatus.build()); }</code><technical_language>pretty this violates Java memory model. fields bufferBytes bottom read a lock. reorder code allClients loop is synchronized lock for rest of code</technical_language>

Target:
public ExchangeClientStatus getStatus() { ImmutableList.Builder<PageBufferClientStatus> pageBufferClientStatusBuilder = ImmutableList.builder(); for (HttpPageBufferClient client : allClients.values()) { pageBufferClientStatusBuilder.add(client.getStatus()); } List<PageBufferClientStatus> pageBufferClientStatus = pageBufferClientStatusBuilder.build(); synchronized (this) { int bufferedPages = pageBuffer.size(); if (bufferedPages > 0 && pageBuffer.peekLast() == NO_MORE_PAGES) { bufferedPages--; } return new ExchangeClientStatus(bufferBytes, maxBufferBytes, averageBytesPerRequest, successfulRequests, bufferedPages, noMoreLocations, pageBufferClientStatus); } }
Source:
<code>public PermissionTypeColumn() { <START> makeSortable(Comparator.comparing(p -> !resources.userImage().equals(p))); <END> }</code><technical_language>This aligned original implementation</technical_language>

Target:
public PermissionTypeColumn() { makeSortable(Comparator.comparing(p -> !resources.userImage().equals(getValue(p)))); }
Source:
<code>public String getDescription(String ruleKey) { ConnectedRuleDetails details = ruleDetails(ruleKey); if (details == null) { return null; } String extendedDescription = details.getExtendedDescription(); if (extendedDescription.isEmpty()) { return details.getHtmlDescription(); } <START> return details.getHtmlDescription() + "<br/><br/>" + details.getExtendedDescription(); <END> }</code><technical_language>suggestion return details.getHtmlDescription() + "<br/><br/>" + extendedDescription;</technical_language>

Target:
public String getDescription(String ruleKey) { ConnectedRuleDetails details = ruleDetails(ruleKey); if (details == null) { return null; } String extendedDescription = details.getExtendedDescription(); if (extendedDescription.isEmpty()) { return details.getHtmlDescription(); } return details.getHtmlDescription() + "<br/><br/>" + extendedDescription; }
Source:
<code><START> public static String quote(String string) { <END> if (string == null || string.length() == 0) { return "\"\""; } char c = 0; int i; int len = string.length(); StringBuilder sb = new StringBuilder(len + 4); String t; sb.append('"'); for (i = 0; i < len; i += 1) { c = string.charAt(i); switch (c) { case '\\': case '"': case '/': sb.append('\\'); sb.append(c); break; case '\b': sb.append("\\b"); break; case '\t': sb.append("\\t"); break; case '\n': sb.append("\\n"); break; case '\f': sb.append("\\f"); break; case '\r': sb.append("\\r"); break; default: if (c < ' ') { t = "000" + Integer.toHexString(c); sb.append("\\u" + t.substring(t.length() - 4)); } else { sb.append(c); } } } sb.append('"'); return sb.toString(); }</code><technical_language>![CRITICAL](<LINK_0> Cyclomatic Complexity of this method "quote" is 14 is greater 10 authorized. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
private static String quote(String string) { if (string == null || string.length() == 0) { return "\"\""; } char c; int i; int len = string.length(); StringBuilder sb = new StringBuilder(len + 4); String t; sb.append('"'); for (i = 0; i < len; i += 1) { c = string.charAt(i); switch (c) { case '\\': case '"': case '/': sb.append('\\'); sb.append(c); break; case '\b': sb.append("\\b"); break; case '\t': sb.append("\\t"); break; case '\n': sb.append("\\n"); break; case '\f': sb.append("\\f"); break; case '\r': sb.append("\\r"); break; default: if (c < ' ') { t = "000" + Integer.toHexString(c); sb.append("\\u" + t.substring(t.length() - 4)); } else { sb.append(c); } } } sb.append('"'); return sb.toString(); }