auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testImagesDoesNotExist() { <START> DiskImage diskImage1 = getNewDiskImage(); DiskImage diskImage2 = getNewDiskImage(); List<DiskImage> diskImagesFromParams = new ArrayList<>(); diskImagesFromParams.addAll(Arrays.asList(diskImage1, diskImage2)); <END> Set<Guid> guidsForDiskImages = new HashSet<>(Arrays.asList(Guid.newGuid(), Guid.newGuid())); cmd.getParameters().setDisks(guidsForDiskImages); doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST)).when(diskExistenceValidator).diskImagesNotExist(); ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST); }</code><technical_language>change in line 280, do need of this</technical_language>

Target:
public void testImagesDoesNotExist() { Set<Guid> guidsForDiskImages = new HashSet<>(Arrays.asList(Guid.newGuid(), Guid.newGuid())); cmd.getParameters().setDiskIds(guidsForDiskImages); doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST)).when(diskExistenceValidator).diskImagesNotExist(); ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST); }
Source:
<code>private void registerNewUsersWithExisting(TokensApi unAuthenticatedTokensApi) throws Exception { mockGitHub(CUSTOM_USERNAME1); mockGoogleHelper(GOOGLE_ACCOUNT_USERNAME1); try { unAuthenticatedTokensApi.addGoogleToken(satellizerJSONForRegistration); Assert.fail(); <START> } catch (Exception e){ <END> Assert.assertEquals("User already exists, cannot register new user", e.getMessage());; } try { unAuthenticatedTokensApi.addToken(satellizerJSONForRegistration); Assert.fail(); } catch (Exception e){ Assert.assertTrue(e.getMessage().contains("already exists")); } }</code><technical_language>narrowest exception required, I in this case need ApiException</technical_language>

Target:
private void registerNewUsersWithExisting(TokensApi unAuthenticatedTokensApi) throws Exception { mockGitHub(CUSTOM_USERNAME1); mockGoogleHelper(GOOGLE_ACCOUNT_USERNAME1); try { unAuthenticatedTokensApi.addGoogleToken(satellizerJSONForRegistration); Assert.fail(); } catch (ApiException e){ Assert.assertEquals("User already exists, cannot register new user", e.getMessage());; } try { unAuthenticatedTokensApi.addToken(satellizerJSONForRegistration); Assert.fail(); } catch (ApiException e){ Assert.assertTrue(e.getMessage().contains("already exists")); } }
Source:
<code>private void removeChildFromLRU(ExpressionInfo child) { String childFullExpression = child.getFullExpr(); VariableObjectId childId = new VariableObjectId(); childId.generateId(childFullExpression, getInternalId()); <START> MIVariableObject childOfChild = lruVariableList.remove(childId); <END> if (childOfChild != null) { childOfChild.removeChildrenFromLRU(); } }</code><technical_language>rename varobjOfChild? childOfChild suggests a child of child</technical_language>

Target:
private void removeChildFromLRU(ExpressionInfo child) { String childFullExpression = child.getFullExpr(); VariableObjectId childId = new VariableObjectId(); childId.generateId(childFullExpression, getInternalId()); MIVariableObject varobjOfChild = lruVariableList.remove(childId); if (varobjOfChild != null) { varobjOfChild.removeChildrenFromLRU(); } }
Source:
<code>public int command(String cmd, Writer out, Writer err) { checkNotNull(cmd, "command"); final WinRm service = getService(); final CommandLine cmdLine = new CommandLine(); cmdLine.setCommand(cmd); final OptionSetType optSetCmd = new OptionSetType(); OptionType optConsolemodeStdin = new OptionType(); optConsolemodeStdin.setName("WINRS_CONSOLEMODE_STDIN"); optConsolemodeStdin.setValue("TRUE"); optSetCmd.getOption().add(optConsolemodeStdin); OptionType optSkipCmdShell = new OptionType(); optSkipCmdShell.setName("WINRS_SKIP_CMD_SHELL"); optSkipCmdShell.setValue("FALSE"); optSetCmd.getOption().add(optSkipCmdShell); numberOfReceiveCalls = 0; CommandResponse cmdResponse = winrmCallRetryConnFailure(new CallableFunction<CommandResponse>() { @Override public CommandResponse call() { setActionToContext((BindingProvider) service, "<LINK_1>"); <START> return service.command(cmdLine, RESOURCE_URI, MAX_ENVELOPER_SIZE, operationTimeout, locale, shellSelector, optSetCmd); <END> } }); String commandId = cmdResponse.getCommandId(); try { return receiveCommand(commandId, out, err); } finally { releaseCommand(commandId); } }</code><technical_language>retry command, result in multiple processes</technical_language>

Target:
public int command(String cmd, Writer out, Writer err) { checkNotNull(cmd, "command"); final WinRm service = getService(); final CommandLine cmdLine = new CommandLine(); cmdLine.setCommand(cmd); final OptionSetType optSetCmd = new OptionSetType(); OptionType optConsolemodeStdin = new OptionType(); optConsolemodeStdin.setName("WINRS_CONSOLEMODE_STDIN"); optConsolemodeStdin.setValue("TRUE"); optSetCmd.getOption().add(optConsolemodeStdin); OptionType optSkipCmdShell = new OptionType(); optSkipCmdShell.setName("WINRS_SKIP_CMD_SHELL"); optSkipCmdShell.setValue("FALSE"); optSetCmd.getOption().add(optSkipCmdShell); numberOfReceiveCalls = 0; setActionToContext((BindingProvider) service, "<LINK_1>"); CommandResponse cmdResponse = service.command(cmdLine, RESOURCE_URI, MAX_ENVELOPER_SIZE, operationTimeout, locale, shellSelector, optSetCmd); String commandId = cmdResponse.getCommandId(); try { return receiveCommand(commandId, out, err); } finally { releaseCommand(commandId); } }
Source:
<code>public int size() { if (countQuery == null) { return UNKNOWN_SIZE; } try (Connection connection = createConnection()) { Statement st = connection.createStatement(); ResultSet res = st.executeQuery(countQuery); int count = 0; if (res.next()) { count = res.getInt(1); } return count; } catch (SQLException e) { log.warn("Could not determine query size by count query"); try (Connection connection = createConnection()) { Statement st = connection.createStatement(); st.setMaxRows(1); ResultSet res = st.executeQuery(sqlQuery); if (res.next()) { return UNKNOWN_SIZE; } else { return 0; } } catch (SQLException e2) { log.error("Could not determine query size by counting query result", e2); <START> return 0; <END> } } }</code><technical_language>cases query is a valid statement executed SELECT COUNT(*) (' + query + ') tmp can't</technical_language>

Target:
public int size() { if (countQuery == null) { return vagueSize(); } try (Connection connection = createConnection()) { Statement st = connection.createStatement(); ResultSet res = st.executeQuery(countQuery); int count = 0; if (res.next()) { count = res.getInt(1); } return count; } catch (SQLException e) { log.warn("Could not determine query size by count query", e); return vagueSize(); } }
Source:
<code><START> public void countLostEvent(TmfTimeRange timeRange, int nbLostEvents, boolean fullRange) { <END> if (timeRange.getStartTime().getValue() < 0 || timeRange.getEndTime().getValue() < 0) { return; } int indexStart = (int) ((timeRange.getStartTime().getValue() - fFirstBucketTime) / fBucketDuration); int indexEnd = (int) ((timeRange.getEndTime().getValue() - fFirstBucketTime) / fBucketDuration); if (!fullRange) { if (timeRange.getEndTime().getValue() > fTimeLimit) { indexEnd = (int) ((fTimeLimit - fFirstBucketTime) / fBucketDuration); } } int nbBucketRange = (indexEnd - indexStart) + 1; int lostEventPerBucket = nbLostEvents / nbBucketRange; int remainLostEvent = nbLostEvents % nbBucketRange; if (fullRange && timeRange.getEndTime().getValue() >= fTimeLimit) { while (timeRange.getEndTime().getValue() >= fTimeLimit) { mergeBuckets(); } } for (int index = indexStart; index <= indexEnd; index++) { fLostEventsBuckets[index] += lostEventPerBucket; if ((index - indexStart) < remainLostEvent) { fLostEventsBuckets[index]++; } } fNbEvents++; fireModelUpdateNotification(nbLostEvents); }</code><technical_language>flag name "fullRange" is misleading. data model fullRange meaning. called purpose</technical_language>

Target:
public void countLostEvent(TmfTimeRange timeRange, int nbLostEvents, boolean fullRange) { if (timeRange.getStartTime().getValue() < 0 || timeRange.getEndTime().getValue() < 0) { return; } int indexStart = (int) ((timeRange.getStartTime().getValue() - fFirstBucketTime) / fBucketDuration); int indexEnd = (int) ((timeRange.getEndTime().getValue() - fFirstBucketTime) / fBucketDuration); if (!fullRange) { if (timeRange.getEndTime().getValue() > fTimeLimit) { indexEnd = (int) ((fTimeLimit - fFirstBucketTime) / fBucketDuration); } } int nbBucketRange = (indexEnd - indexStart) + 1; int lostEventPerBucket = (int) Math.ceil((double) nbLostEvents / nbBucketRange); int lastLostCol = nbLostEvents - lostEventPerBucket * (nbBucketRange -1); if (fullRange && timeRange.getEndTime().getValue() >= fTimeLimit) { while (timeRange.getEndTime().getValue() >= fTimeLimit) { mergeBuckets(); } } indexEnd = Math.min(indexEnd, DEFAULT_NUMBER_OF_BUCKETS); for (int index = indexStart; index <= indexEnd; index++) { if (index == (indexStart + nbBucketRange)) { fLostEventsBuckets[index] += lastLostCol; } else { fLostEventsBuckets[index] += lostEventPerBucket; } } fNbEvents++; fireModelUpdateNotification(nbLostEvents); }
Source:
<code>private static void populateEntry(Cache<Path, LocalMetadataEntry> cache, Path path) { FileStatus fileStatus = new FileStatus(0, true, 0, 0, 0, path); <START> S3AFileStatus s3aStatus = S3AFileStatus.fromFileStatus( <END> fileStatus, Tristate.UNKNOWN, null, null); cache.put(path, new LocalMetadataEntry(new PathMetadata(s3aStatus))); }</code><technical_language>*a lot* of calls this. Cleaner create S3AFileStatus in of cases, yeah</technical_language>

Target:
private static void populateEntry(Cache<Path, LocalMetadataEntry> cache, Path path) { S3AFileStatus s3aStatus = new S3AFileStatus(Tristate.UNKNOWN, path, null); cache.put(path, new LocalMetadataEntry(new PathMetadata(s3aStatus))); }
Source:
<code>public CamusWrapper<String> decode(Message message) { long timestamp = 0; String payloadString; try { <START> payloadString = new String(message.getPayload(), "UTF-8"); <END> } catch (UnsupportedEncodingException e) { log.error("Unable to load UTF-8 encoding, falling back to system default", e); payloadString = new String(message.getPayload()); } return new CamusWrapper<String>(payloadString, System.currentTimeMillis()); }</code><technical_language>I if is reason decode a string. making this a ByteArrayMessageDecoder simpler? for anything! :)</technical_language>

Target:
public CamusWrapper<String> decode(Message message) { String payloadString; try { payloadString = new String(message.getPayload(), "UTF-8"); } catch (UnsupportedEncodingException e) { log.error("Unable to load UTF-8 encoding, falling back to system default", e); payloadString = new String(message.getPayload()); } return new CamusWrapper<String>(payloadString, System.currentTimeMillis()); }
Source:
<code><START> public Violation(String subject) { <END> logger.error( "new Violation(subject) is no longer supported - please use new Violation(OWLEntity) instead."); }</code><technical_language>published public methods, continue work somehow</technical_language>

Target:
public Violation(String subject) { this.subject = subject; }
Source:
<code>public void before(InfinispanServerDriver driver) { databases = new LinkedHashMap<>(databaseTypes.length); for (int i = 0; i < databaseTypes.length; i++) { Database database = initDatabase(databaseTypes[i]); log.infof("Starting database: %s", database.getType()); database.start(); log.infof("Started database: %s", database.getType()); databases.put(databaseTypes[i], database); <START> driver.getConfiguration().properties().put("org.infinispan.server.test."+ database.getType()+".jdbcUrl", database.jdbcUrl()); <END> } }</code><technical_language>formatting weird in this block</technical_language>

Target:
public void before(InfinispanServerDriver driver) { databases = new LinkedHashMap<>(databaseTypes.length); for (String dbType : databaseTypes) { Database database = initDatabase(dbType); log.infof("Starting database: %s", database.getType()); database.start(); log.infof("Started database: %s", database.getType()); if (databases.putIfAbsent(dbType, database) != null) { throw new RuntimeException("Duplicate database type " + dbType); } driver.getConfiguration().properties().put("org.infinispan.server.test." + database.getType() + ".jdbcUrl", database.jdbcUrl()); } }
Source:
<code>protected void createMainControl(Composite parent, IEEFFormContainer formContainer) { EEFWidgetFactory widgetFactory = formContainer.getWidgetFactory(); FormData formData = new FormData(); formData.left = new FormAttachment(0, LABEL_WIDTH); formData.right = new FormAttachment(100, 0); int lineCount = description.getLineCount(); if (lineCount > 1) { this.text = widgetFactory.createStyledText(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP); formData.height = lineCount * text.getLineHeight(); } else { this.text = widgetFactory.createStyledText(parent, SWT.NONE); } this.text.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); widgetFactory.paintBordersFor(parent); this.text.setLayoutData(formData); <START> if (!isEnabled()) { this.text.setEnabled(false); this.text.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); } <END> this.controller = new EEFControllersFactory().createTextController(this.description, this.variableManager, this.interpreter, this.editingDomain); }</code><technical_language>this need done in refresh instead of creation of controls</technical_language>

Target:
protected void createMainControl(Composite parent, IEEFFormContainer formContainer) { EEFWidgetFactory widgetFactory = formContainer.getWidgetFactory(); FormData formData = new FormData(); formData.left = new FormAttachment(0, LABEL_WIDTH); formData.right = new FormAttachment(100, 0); int lineCount = description.getLineCount(); if (lineCount > 1) { this.text = widgetFactory.createStyledText(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP); formData.height = lineCount * text.getLineHeight(); } else { this.text = widgetFactory.createStyledText(parent, SWT.NONE); } this.text.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); widgetFactory.paintBordersFor(parent); this.text.setLayoutData(formData); this.controller = new EEFControllersFactory().createTextController(this.description, this.variableManager, this.interpreter, this.editingDomain); }
Source:
<code>private void setHandshakeSuccess() { handshakePromise.trySuccess(ctx.channel()); if (logger.isDebugEnabled()) { logger.debug("{} HANDSHAKEN: {}", ctx.channel(), engine.getSession().getCipherSuite()); } ctx.fireUserEventTriggered(SslHandshakeCompletionEvent.SUCCESS); <START> if (TlsMasterKeyHandler.DoNothingTlsMasterKeyHandler.INSTANCE != masterKeyHandler) { <END> logMasterSecret(engine, masterKeyHandler); } if (readDuringHandshake && !ctx.channel().config().isAutoRead()) { readDuringHandshake = false; ctx.read(); } }</code><technical_language>@fzakaria patch I change do in a ChannelInboundHandler adjust SslHandler all. do this: java class TlsMasterKeyHandler extends ChannelInboundHandlerAdapter { @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { if (evt instanceof SslHandshakeCompletionEvent) { SslHandler handler = ctx.pipeline().get(SslHandler.class); SSLEngine engine = handler.engine(); ..... // Do logging here. } ctx.fireUserEventTriggered(evt); } } This user add extra handler pipeline if interested in this... WDYT</technical_language>

Target:
private void setHandshakeSuccess() { handshakePromise.trySuccess(ctx.channel()); if (logger.isDebugEnabled()) { logger.debug("{} HANDSHAKEN: {}", ctx.channel(), engine.getSession().getCipherSuite()); } ctx.fireUserEventTriggered(SslHandshakeCompletionEvent.SUCCESS); if (readDuringHandshake && !ctx.channel().config().isAutoRead()) { readDuringHandshake = false; ctx.read(); } }
Source:
<code>private void waitUntilExpectedProgress(long expectedProgress, int maxTimeToCheck) throws InterruptedException { int sleptSoFar = 0; while (expectedProgress != index.hardDeleter.getProgress()) { sleptSoFar += 5; Thread.sleep(5); <START> if (sleptSoFar == maxTimeToCheck) { <END> fail("HardDelete failed to catch up in " + maxTimeToCheck); } index.hardDeleter.preLogFlush(); index.hardDeleter.postLogFlush(); } }</code><technical_language>=</technical_language>

Target:
private void waitUntilExpectedProgress(long expectedProgress, int maxTimeToCheck) throws InterruptedException { int sleptSoFar = 0; while (expectedProgress != index.hardDeleter.getProgress()) { sleptSoFar += 5; Thread.sleep(5); if (sleptSoFar >= maxTimeToCheck) { fail("HardDelete failed to catch up in " + maxTimeToCheck); } index.hardDeleter.preLogFlush(); index.hardDeleter.postLogFlush(); } }
Source:
<code>public void start(final Environment env) { startThread(new CommandRunnable() { @Override public void run() throws Exception { if (!currentUser.getCapabilities().canCreateProject()) { String msg = String.format( "fatal: %s does not have \"Create Project\" capability.", currentUser.getUserName()); throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, msg); } PrintWriter p = toPrintWriter(out); parseCommandLine(); try { if (!suggestParent) { if (projectName == null) { throw new UnloggedFailure(1, "Error: Project name is required."); } final CreateProjectArgs args = new CreateProjectArgs(); args.setProjectName(projectName); args.ownerIds = ownerIds; args.newParent = newParent; args.permissionsOnly = permissionsOnly; args.projectDescription = projectDescription; args.submitType = submitType; args.contributorAgreements = contributorAgreements; args.signedOffBy = signedOffBy; args.contentMerge = contentMerge; args.changeIdRequired = requireChangeID; args.branch = branch; args.createEmptyCommit = createEmptyCommit; final CreateProject createProject = CreateProjectFactory.create(args); createProject.createProject(); } else { List<Project.NameKey> parentCandidates = retrieveParentCandidatesFactory.create().get(); for (Project.NameKey parent : parentCandidates) { p.print(parent + "\n"); } } } catch (ProjectCreationFailedException err) { <START> throw new UnloggedFailure(1, "Fatal: " + err.getMessage(), err); <END> } finally { p.flush(); } } }); }</code><technical_language>s/Fatal/fatal</technical_language>

Target:
public void start(final Environment env) { startThread(new CommandRunnable() { @Override public void run() throws Exception { if (!currentUser.getCapabilities().canCreateProject()) { String msg = String.format( "fatal: %s does not have \"Create Project\" capability.", currentUser.getUserName()); throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, msg); } PrintWriter p = toPrintWriter(out); parseCommandLine(); try { if (!suggestParent) { if (projectName == null) { throw new UnloggedFailure(1, "fatal: Project name is required."); } final CreateProjectArgs args = new CreateProjectArgs(); args.setProjectName(projectName); args.ownerIds = ownerIds; args.newParent = newParent; args.permissionsOnly = permissionsOnly; args.projectDescription = projectDescription; args.submitType = submitType; args.contributorAgreements = contributorAgreements; args.signedOffBy = signedOffBy; args.contentMerge = contentMerge; args.changeIdRequired = requireChangeID; args.branch = branch; args.createEmptyCommit = createEmptyCommit; final CreateProject createProject = CreateProjectFactory.create(args); createProject.createProject(); } else { List<Project.NameKey> parentCandidates = retrieveParentCandidatesFactory.create().get(); for (Project.NameKey parent : parentCandidates) { p.print(parent + "\n"); } } } catch (ProjectCreationFailedException err) { throw new UnloggedFailure(1, "fatal: " + err.getMessage(), err); } finally { p.flush(); } } }); }
Source:
<code>public ShardSyncTaskManager(ShardDetector shardDetector, LeaseRefresher leaseRefresher, InitialPositionInStreamExtended initialPositionInStream, boolean cleanupLeasesUponShardCompletion, boolean ignoreUnexpectedChildShards, long shardSyncIdleTimeMillis, ExecutorService executorService, MetricsFactory metricsFactory) { <START> this(shardDetector, leaseRefresher, initialPositionInStream, cleanupLeasesUponShardCompletion, ignoreUnexpectedChildShards, shardSyncIdleTimeMillis, executorService, metricsFactory, new ShardSyncer()); <END> }</code><technical_language>depend ShardSyncTaskManager creating ShardSyncer, instead handle creation in DynamoDBLeaseManagementFactory</technical_language>

Target:
public ShardSyncTaskManager(ShardDetector shardDetector, LeaseRefresher leaseRefresher, InitialPositionInStreamExtended initialPositionInStream, boolean cleanupLeasesUponShardCompletion, boolean ignoreUnexpectedChildShards, long shardSyncIdleTimeMillis, ExecutorService executorService, MetricsFactory metricsFactory) { this.shardDetector = shardDetector; this.leaseRefresher = leaseRefresher; this.initialPositionInStream = initialPositionInStream; this.cleanupLeasesUponShardCompletion = cleanupLeasesUponShardCompletion; this.ignoreUnexpectedChildShards = ignoreUnexpectedChildShards; this.shardSyncIdleTimeMillis = shardSyncIdleTimeMillis; this.executorService = executorService; this.hierarchicalShardSyncer = new HierarchicalShardSyncer(); this.metricsFactory = metricsFactory; }
Source:
<code>public ShardConsumer(RecordsPublisher recordsPublisher, ExecutorService executorService, ShardInfo shardInfo, Optional<Long> logWarningForTaskAfterMillis, ShardConsumerArgument shardConsumerArgument, TaskExecutionListener taskExecutionListener) { this(recordsPublisher, executorService, shardInfo, logWarningForTaskAfterMillis, shardConsumerArgument, <START> taskExecutionListener, ConsumerStates.INITIAL_STATE, <END> ShardConsumer.metricsWrappingFunction(shardConsumerArgument.metricsFactory()), 8); }</code><technical_language>Is a reason for changing order for chained constructor? If add new parameter end of list</technical_language>

Target:
public ShardConsumer(RecordsPublisher recordsPublisher, ExecutorService executorService, ShardInfo shardInfo, Optional<Long> logWarningForTaskAfterMillis, ShardConsumerArgument shardConsumerArgument, TaskExecutionListener taskExecutionListener) { this(recordsPublisher, executorService, shardInfo, logWarningForTaskAfterMillis, shardConsumerArgument, ConsumerStates.INITIAL_STATE, ShardConsumer.metricsWrappingFunction(shardConsumerArgument.metricsFactory()), 8, taskExecutionListener); }
Source:
<code>protected void init(SlotProvider<IInventory, ItemStack> slots) { int base = 0; this.addSpanningChild(new GridInventoryLensImpl(base, 9, this.upperChest / 9, 9, slots)); base += this.upperChest; this.addSpanningChild(new GridInventoryLensImpl(base, 9, this.lowerChest / 9, 9, slots)); <START> base += lowerChest; <END> for (int i = base; i < this.slotCount(); i++) { this.addSpanningChild(new SlotLensImpl(i), SlotIndex.of(i)); } }</code><technical_language>this</technical_language>

Target:
protected void init(SlotProvider<IInventory, ItemStack> slots) { int base = 0; this.addSpanningChild(new GridInventoryLensImpl(base, 9, this.upperChest / 9, 9, slots)); base += this.upperChest; this.addSpanningChild(new GridInventoryLensImpl(base, 9, this.lowerChest / 9, 9, slots)); base += this.lowerChest; for (int i = base; i < this.slotCount(); i++) { this.addSpanningChild(new SlotLensImpl(i), SlotIndex.of(i)); } }
Source:
<code>@NonNull public static Flow get(@NonNull Context context) { Flow flow = InternalContextWrapper.getFlow(context); if (null == flow) { <START> throw new IllegalStateException("The passed context must be wrapped with Flow!"); <END> } return flow; }</code><technical_language>helpful if this message carried explanation of needed done, wasn't: Setting Flow in Activity, a rough description of missing</technical_language>

Target:
@NonNull public static Flow get(@NonNull Context context) { Flow flow = InternalContextWrapper.getFlow(context); if (null == flow) { throw new IllegalStateException("Context was not wrapped with flow. " + "Make sure attachBaseContext was overridden in your main activity"); } return flow; }
Source:
<code>public abstract @Nullable PcapPacket parseNextPacket() throws IOException, BadPcapFileException, BadPacketException; public abstract void skipNextPacket() throws IOException, BadPcapFileException; public abstract void seekPacket(long rank) throws IOException, BadPcapFileException; <START> public abstract PcapTimestampScale getTimestampPrecision(); <END> public synchronized long getTotalNbPackets() throws IOException, BadPcapFileException { if (fTotalNumberPackets == -1) { long rank = fCurrentRank; fCurrentRank = fFileIndex.floorKey(rank); while (hasNextPacket()) { skipNextPacket(); } fTotalNumberPackets = fCurrentRank; fCurrentRank = rank; seekPacket(rank); } return fTotalNumberPackets; }</code><technical_language>This method sense for PcapNg depends interfaceId of packet. in PcapOldFile</technical_language>

Target:
public abstract @Nullable PcapPacket parseNextPacket() throws IOException, BadPcapFileException, BadPacketException; public abstract void skipNextPacket() throws IOException, BadPcapFileException; public abstract void seekPacket(long rank) throws IOException, BadPcapFileException; public abstract PcapTimestampScale getTimestampPrecision(); public abstract long getTimeAccuracy(); public abstract long getTimeZoneCorrection(); public abstract long getSnapShotLength(); public abstract long getDataLinkType(); public synchronized long getTotalNbPackets() throws IOException, BadPcapFileException { if (fTotalNumberPackets == -1) { long rank = fCurrentRank; fCurrentRank = fFileIndex.floorKey(rank); while (hasNextPacket()) { skipNextPacket(); } fTotalNumberPackets = fCurrentRank; fCurrentRank = rank; seekPacket(rank); } return fTotalNumberPackets; }
Source:
<code>private StackTraceElement[] getStackTrace(Thread thread) { StackTraceElement[] threadStack; try { <START> threadStack = thread.getStackTrace(); <END> } catch (SecurityException e) { threadStack = new StackTraceElement[0]; } return threadStack; }</code><technical_language>returns a local</technical_language>

Target:
private StackTraceElement[] getStackTrace(Thread thread) { try { return thread.getStackTrace(); } catch (SecurityException e) { return new StackTraceElement[0]; } }
Source:
<code>public void setup() throws IOException { <START> System.out.println("SETUP CALLED AT " + +System.currentTimeMillis()); <END> if (ComplexMetrics.getSerdeForType("hyperUnique") == null) { ComplexMetrics.registerSerde("hyperUnique", new HyperUniquesSerde(Hashing.murmur3_128())); } schemaInfo = BenchmarkSchemas.SCHEMA_MAP.get(schema); BenchmarkDataGenerator gen = new BenchmarkDataGenerator( schemaInfo.getColumnSchemas(), RNG_SEED, schemaInfo.getDataInterval(), rowsPerSegment ); incIndex = makeIncIndex(); for (int j = 0; j < rowsPerSegment; j++) { InputRow row = gen.nextRow(); if (j % 10000 == 0) { System.out.println(j + " rows generated."); } incIndex.add(row); } File tmpFile = File.createTempFile("FilterPartitionBenchmark-" + System.currentTimeMillis(), ".TEMPDIR"); tmpFile.delete(); tmpFile.mkdirs(); System.out.println(tmpFile.getAbsolutePath() + " isFile: " + tmpFile.isFile() + " isDir:" + tmpFile.isDirectory()); tmpFile.deleteOnExit(); indexFile = INDEX_MERGER_V9.persist( incIndex, tmpFile, new IndexSpec() ); qIndex = INDEX_IO.loadIndex(indexFile); }</code><technical_language>log.info plx</technical_language>

Target:
public void setup() throws IOException { log.info("SETUP CALLED AT " + System.currentTimeMillis()); if (ComplexMetrics.getSerdeForType("hyperUnique") == null) { ComplexMetrics.registerSerde("hyperUnique", new HyperUniquesSerde(Hashing.murmur3_128())); } schemaInfo = BenchmarkSchemas.SCHEMA_MAP.get(schema); BenchmarkDataGenerator gen = new BenchmarkDataGenerator( schemaInfo.getColumnSchemas(), RNG_SEED, schemaInfo.getDataInterval(), rowsPerSegment ); incIndex = makeIncIndex(); for (int j = 0; j < rowsPerSegment; j++) { InputRow row = gen.nextRow(); if (j % 10000 == 0) { log.info(j + " rows generated."); } incIndex.add(row); } File tmpFile = Files.createTempDir(); log.info("Using temp dir: " + tmpFile.getAbsolutePath()); tmpFile.deleteOnExit(); indexFile = INDEX_MERGER_V9.persist( incIndex, tmpFile, new IndexSpec() ); qIndex = INDEX_IO.loadIndex(indexFile); }
Source:
<code>public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { if (junitImported) { return super.visit(node, data); } ASTImplementsList impl = node.getFirstChildOfType(ASTImplementsList.class); if (impl != null && impl.jjtGetParent().equals(node)) { for (int ix = 0; ix < impl.jjtGetNumChildren(); ix++) { Node child = impl.jjtGetChild(ix); if (child.getClass() != ASTClassOrInterfaceType.class) { continue; } ASTClassOrInterfaceType type = (ASTClassOrInterfaceType) child; if (isJUnitTest(type)) { junitImported = true; return super.visit(node, data); } } } <START> if (node.jjtGetNumChildren() != 0 && node.jjtGetChild(0) instanceof ASTExtendsList) { <END> ASTClassOrInterfaceType type = node.jjtGetChild(0).getFirstChildOfType(ASTClassOrInterfaceType.class); if (isJUnitTest(type)) { junitImported = true; return super.visit(node, data); } } return super.visit(node, data); }</code><technical_language>This block checking interfaces (above) simplified methods getSuperInterfacesTypeNodes getSuperClassTypeNode of ASTClassOrInterfaceDeclaration</technical_language>

Target:
public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { if (junitImported) { return super.visit(node, data); } for (final ASTClassOrInterfaceType type : node.getSuperInterfacesTypeNodes()) { if (isJUnitTest(type)) { junitImported = true; return super.visit(node, data); } } ASTClassOrInterfaceType type = node.getSuperClassTypeNode(); if (type != null && isJUnitTest(type)) { junitImported = true; return super.visit(node, data); } return super.visit(node, data); }
Source:
<code>public void should_exclude() { quickFix.invoke(project, mock(Editor.class), mock(PsiFile.class)); <START> assertFalse(settings.isRuleActive("rule")); <END> verify(submitter).submitOpenFilesAuto(TriggerType.BINDING_UPDATE); }</code><technical_language>suggestion assertThat(settings.isRuleActive("rule")).isFalse(); need import JUnit's assertions here, AssertJ</technical_language>

Target:
public void should_exclude() { quickFix.invoke(project, mock(Editor.class), mock(PsiFile.class)); assertThat(settings.isRuleExplicitlyDisabled("rule")).isTrue(); verify(submitter).submitOpenFilesAuto(TriggerType.BINDING_UPDATE); }
Source:
<code>public static void openUrlInBrowser(final Context context, final String url) { final Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(url)); final String defaultBrowserPackageName = getDefaultBrowserPackageName(context); if (defaultBrowserPackageName.equals("android")) { <START> openUrlBrowserChooser(context, url); <END> } else { intent.setPackage(defaultBrowserPackageName); context.startActivity(intent); } }</code><technical_language>Move intent instantiation code else branch, is needed</technical_language>

Target:
public static void openUrlInBrowser(final Context context, final String url) { final String defaultBrowserPackageName = getDefaultBrowserPackageName(context); if (defaultBrowserPackageName.equals("android")) { openInDefaultApp(context, url); } else { final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); intent.setPackage(defaultBrowserPackageName); context.startActivity(intent); } }
Source:
<code>private JSONObject readJSONObjFromWire(SocketChannel sc, String remoteAddressForErrorMsg) throws IOException, JSONException { try { ByteBuffer lengthBuffer = ByteBuffer.allocate(4); while (lengthBuffer.remaining() > 0) { int read = sc.read(lengthBuffer); if (read == -1) { throw new EOFException(remoteAddressForErrorMsg); } } lengthBuffer.flip(); int length = lengthBuffer.getInt(); if (length > 16 * 1024) { throw new IOException( "Length prefix on wire for expected JSON string is greater than 16K max."); } if (length < 2) { throw new IOException( "Length prefix on wire for expected JSON string is less than minimum document size of 2."); } ByteBuffer messageBytes = ByteBuffer.allocate(length); while (messageBytes.hasRemaining()) { int read = sc.read(messageBytes); if (read == -1) { throw new EOFException(remoteAddressForErrorMsg); } } messageBytes.flip(); JSONObject jsObj = new JSONObject(new String(messageBytes.array(), StandardCharsets.UTF_8)); return jsObj; } catch (IOException | JSONException ex) { <START> sc.close(); <END> throw ex; } }</code><technical_language>I if processSSC() is a place catch close socket</technical_language>

Target:
private JSONObject readJSONObjFromWire(SocketChannel sc, String remoteAddressForErrorMsg) throws IOException, JSONException { ByteBuffer lengthBuffer = ByteBuffer.allocate(4); while (lengthBuffer.remaining() > 0) { int read = sc.read(lengthBuffer); if (read == -1) { throw new EOFException(remoteAddressForErrorMsg); } } lengthBuffer.flip(); int length = lengthBuffer.getInt(); if (length > 16 * 1024) { throw new IOException( "Length prefix on wire for expected JSON string is greater than 16K max."); } if (length < 2) { throw new IOException( "Length prefix on wire for expected JSON string is less than minimum document size of 2."); } ByteBuffer messageBytes = ByteBuffer.allocate(length); while (messageBytes.hasRemaining()) { int read = sc.read(messageBytes); if (read == -1) { throw new EOFException(remoteAddressForErrorMsg); } } messageBytes.flip(); JSONObject jsObj = new JSONObject(new String(messageBytes.array(), StandardCharsets.UTF_8)); return jsObj; }
Source:
<code>@Test public void testJsonLength() { <START> String query = "select json_length(\"product_name\", 'lax $') from \"product\""; <END> final String expected = "SELECT JSON_LENGTH(\"product_name\" FORMAT JSON, 'lax $')\n" + "FROM \"foodmart\".\"product\""; sql(query).ok(expected); }</code><technical_language>I add another case for syntax json_length(value)</technical_language>

Target:
@Test public void testJsonLength() { String query = "select json_length(\"product_name\", 'lax $'), " + "json_length(\"product_name\") from \"product\""; final String expected = "SELECT JSON_LENGTH(\"product_name\" FORMAT JSON, 'lax $'), " + "JSON_LENGTH(\"product_name\" FORMAT JSON)\n" + "FROM \"foodmart\".\"product\""; sql(query).ok(expected); }
Source:
<code>public long freeMemory(long windowId) throws IOException { long memoryFreed = 0; Long clearWindowId; <START> while ((clearWindowId = committedData.floorKey(windowId)) != null) { <END> Map<Slice, BucketedValue> windowData = committedData.remove(clearWindowId); for (Map.Entry<Slice, BucketedValue> entry: windowData.entrySet()) { memoryFreed += entry.getKey().length + entry.getValue().getSize(); } } fileCache.clear(); if (cachedBucketMetas != null) { for (BucketsFileSystem.TimeBucketMeta tbm : cachedBucketMetas.values()) { FileAccess.FileReader reader = readers.remove(tbm.getTimeBucketId()); if (reader != null) { memoryFreed += tbm.getSizeInBytes(); reader.close(); } } } sizeInBytes.getAndAdd(-memoryFreed); windowsForFreeMemory.add(windowId); return memoryFreed; }</code><technical_language>floorKey remove call is O(log n) loop is O(n log n). a normal ordered iteration O(n) instead</technical_language>

Target:
public long freeMemory(long windowId) throws IOException { long memoryFreed = 0; Iterator<Map.Entry<Long, Map<Slice, BucketedValue>>> entryIter = committedData.entrySet().iterator(); while (entryIter.hasNext()) { Map.Entry<Long, Map<Slice, BucketedValue>> bucketEntry = entryIter.next(); if (bucketEntry.getKey() > windowId) { break; } Map<Slice, BucketedValue> windowData = bucketEntry.getValue(); entryIter.remove(); for (Map.Entry<Slice, BucketedValue> entry : windowData.entrySet()) { memoryFreed += entry.getKey().length + entry.getValue().getSize(); } } fileCache.clear(); if (cachedBucketMetas != null) { for (BucketsFileSystem.TimeBucketMeta tbm : cachedBucketMetas.values()) { FileAccess.FileReader reader = readers.remove(tbm.getTimeBucketId()); if (reader != null) { memoryFreed += tbm.getSizeInBytes(); reader.close(); } } } sizeInBytes.getAndAdd(-memoryFreed); windowsForFreeMemory.add(windowId); return memoryFreed; }
Source:
<code>public void execute() { dataObject.addNestedClass( nestedClass ); DataObjectChangeEvent event = new DataObjectChangeEvent( ChangeType.NESTED_CLASS_ADD_CHANGE, <START> getContext().getContextId(), getSource(), getDataObject(), null, null, nestedClass ); <END> notifyChange( event ); }</code><technical_language>Ok, I this is more serious I reusing existing code, making it. this code base this bugs. runs it, fix it. is a long line of parameters here. I a quick DataObjectChangeEvent some sort of builder. do new DataObjectChangeEvent().withCurrentDataObject( getDataObject() ).withNewValue( nestedClass );. desing patterns is, I prefer Builder for situations, this is in it. problem long constructors is, hard is here. Another problem is passing in nulls is path NPEs</technical_language>

Target:
public void execute() { dataObject.addNestedClass( nestedClass ); DataModelerEvent event = new DataObjectChangeEvent() .withChangeType( ChangeType.NESTED_CLASS_ADD_CHANGE ) .withOldValue( null ) .withNewValue( nestedClass ) .withContextId( getContext().getContextId() ) .withSource( getSource() ) .withCurrentDataObject( getDataObject() ); notifyChange( event ); }
Source:
<code>private RootBeanDefinition getRootBeanDefinition(String mode) { <START> if (StringUtils.hasLength(mode)) { <END> if (isEmbeddedServerEnabled(mode)) { return new RootBeanDefinition(this.embeddedServers.get(mode).getContainerClass(), null, null); } } else { for (Map.Entry<String, EmbeddedLdapServer> entry : this.embeddedServers.entrySet()) { EmbeddedLdapServer ldapServer = entry.getValue(); if (ClassUtils.isPresent(ldapServer.getClassName(), getClass().getClassLoader())) { return new RootBeanDefinition(ldapServer.getContainerClass(), null, null); } } } throw new IllegalStateException("Embedded LDAP server is not provided"); }</code><technical_language>is a lot of duplication in code. This block similar resolveEmbeddedLdapServer</technical_language>

Target:
private RootBeanDefinition getRootBeanDefinition(String mode) { if (isApacheDsEnabled(mode)) { return new RootBeanDefinition(APACHEDS_CONTAINER_CLASSNAME, null, null); } else if (isUnboundidEnabled(mode)) { return new RootBeanDefinition(UNBOUNDID_CONTAINER_CLASSNAME, null, null); } throw new IllegalStateException("Embedded LDAP server is not provided"); }
Source:
<code>public ChartsetFigure(ActionListener addChartHandler) { add(new Label(StackedchartsImages.getImage( StackedchartsImages.DESC_CHARTSET))); chartsetHeader = new DirectionalLabel(Activator.FONT_12); chartsetHeader.setText("Chart Set"); chartsetHeader.setTextAlignment(PositionConstants.TOP); if (boldFont == null) <START> { <END> FontData fontData = Display.getDefault().getActiveShell().getFont() .getFontData()[0]; boldFont = new Font(Display.getDefault(), new FontData(fontData.getName(), fontData.getHeight(), SWT.BOLD)); } chartsetHeader.setFont(boldFont); add(chartsetHeader); Button button = new Button(StackedchartsImages.getImage( StackedchartsImages.DESC_ADD)); button.setToolTip(new Label("Add new chart")); button.addActionListener(addChartHandler); add(button); }</code><technical_language>@dinkoivanov - I change display **Current** **Default** for next lines, avoid NPE error restoring a session empty Stacked Charts View visible. I claim completely understand works other doesn't. But, is ok you</technical_language>

Target:
public ChartsetFigure(ActionListener addChartHandler) { add(new Label(StackedchartsImages.getImage( StackedchartsImages.DESC_CHARTSET))); chartsetHeader = new DirectionalLabel(Activator.FONT_12); chartsetHeader.setText("Chart Set"); chartsetHeader.setTextAlignment(PositionConstants.TOP); add(chartsetHeader); Button button = new Button(StackedchartsImages.getImage( StackedchartsImages.DESC_ADD)); button.setToolTip(new Label("Add new chart")); button.addActionListener(addChartHandler); add(button); }
Source:
<code>public void unannounceTask(String taskId) { try { curatorFramework.delete().guaranteed().forPath(getTaskPathForId(taskId)); } catch (Exception e) { <START> log.warn("Could not delete task path for task[%s], looks like it already went away", taskId); <END> } }</code><technical_language>this log line is swallowing exception. difficult debug :)</technical_language>

Target:
public void unannounceTask(String taskId) { try { curatorFramework.delete().guaranteed().forPath(getTaskPathForId(taskId)); } catch (Exception e) { log.warn(e, "Could not delete task path for task[%s]", taskId); } }
Source:
<code>public DefaultProblem read(JsonReader in) throws IOException { <START> URI type = null; <END> String title = null; StatusType status = null; Map<String, Object> parameters = new HashMap<>(); String detail = null; URI instance = null; ThrowableProblem cause = null; in.beginObject(); while (in.hasNext()) { String name = in.nextName(); switch (name) { case "type": type = TYPE_ADAPTER.read(in); break; case "title": title = STRING.read(in); break; case "status": status = statusAdapter.read(in); break; case "detail": detail = STRING.read(in); break; case "instance": instance = TypeAdapters.URI.read(in); break; case "cause": cause = throwableProblemAdapter.read(in); break; default: parameters.put(name, gson.fromJson(in, Object.class)); break; } } in.endObject(); return new DefaultProblem(type, title, status, detail, instance, cause, parameters); }</code><technical_language>If a ProblemBuilder for this need local variable: java final ProblemBuilder builder = Problem.builder(); in.beginObject(); while (in.hasNext()) { String name = in.nextName(); switch (name) { case "type": builder.withType(TYPE_ADAPTER.read(in)); break; case "title": builder.withTitle(STRING.read(in)); break; // TODO }</technical_language>

Target:
public DefaultProblem read(JsonReader in) throws IOException { ProblemBuilder builder = new ProblemBuilder(); in.beginObject(); while (in.hasNext()) { String name = in.nextName(); switch (name) { case "type": builder.withType(TYPE.read(in)); break; case "title": builder.withTitle(STRING.read(in)); break; case "status": builder.withStatus(statusAdapter.read(in)); break; case "detail": builder.withDetail(STRING.read(in)); break; case "instance": builder.withInstance(URI.read(in)); break; case "cause": builder.withCause(throwableProblemAdapter.read(in)); break; default: builder.with(name, gson.fromJson(in, Object.class)); break; } } in.endObject(); return (DefaultProblem) builder.build(); }
Source:
<code>private String readInputLine(ReadLineHandler readLineHandler) { try { createTerminalConnection(readLineHandler); } catch (IOException e) { <START> e.printStackTrace(); <END> } return readLineHandler.getLine(); }</code><technical_language>this log a proper error - find example line 65 change</technical_language>

Target:
private String readInputLine(ReadLineHandler readLineHandler) { try { createTerminalConnection(readLineHandler); } catch (IOException e) { throw ROOT_LOGGER.noConsoleAvailable(); } return readLineHandler.getLine(); }
Source:
<code>private Checkpoint convertToCheckpoint(BlobItem blobItem) { Checkpoint checkpoint = new Checkpoint(); logger.info("Found blob for partition {}", blobItem.getName()); String[] names = blobItem.getName().split(BLOB_PATH_SEPARATOR); checkpoint.setFullyQualifiedNamespace(names[0]); <START> checkpoint.setEventHubName(names[1]); <END> checkpoint.setConsumerGroup(names[2]); checkpoint.setPartitionId(names[4]); if (CoreUtils.isNullOrEmpty(blobItem.getMetadata())) { logger.warning("No metadata available for blob {}", blobItem.getName()); return checkpoint; } blobItem.getMetadata().forEach((key, value) -> { switch (key) { case SEQUENCE_NUMBER: checkpoint.setSequenceNumber(Long.parseLong(value)); break; case OFFSET: checkpoint.setOffset(Long.parseLong(value)); break; default: break; } }); return checkpoint; }</code><technical_language>Iirc, Checkpoint is a fluent model? more idiomatic do chained method invocations</technical_language>

Target:
private Mono<Checkpoint> convertToCheckpoint(BlobItem blobItem) { String[] names = blobItem.getName().split(BLOB_PATH_SEPARATOR); logger.info("Found blob for partition {}", blobItem.getName()); if (names.length == 5) { if (CoreUtils.isNullOrEmpty(blobItem.getMetadata())) { logger.warning("No metadata available for blob {}", blobItem.getName()); return Mono.empty(); } Map<String, String> metadata = blobItem.getMetadata(); Checkpoint checkpoint = new Checkpoint() .setFullyQualifiedNamespace(names[0]) .setEventHubName(names[1]) .setConsumerGroup(names[2]) .setPartitionId(names[4]) .setSequenceNumber(Long.parseLong(metadata.get(SEQUENCE_NUMBER))) .setOffset(Long.parseLong(metadata.get(OFFSET))); return Mono.just(checkpoint); } return Mono.empty(); }
Source:
<code>public void testNotificationMessageWithInvalidConfig() throws Exception { startMockServer(1); byte requestBytes[] = new byte[48 + CONFIG_BYTES_LENGTH]; <START> ByteBuffer requestBuffer = ByteBuffer.wrap(requestBytes); <END> requestBuffer.clear(); requestBuffer.putInt(ServerState.LOOKING.ordinal()); requestBuffer.putLong(1); requestBuffer.putLong(0); requestBuffer.putLong(0); requestBuffer.putLong(0); requestBuffer.putInt(FastLeaderElection.Notification.CURRENTVERSION); requestBuffer.putInt(CONFIG_BYTES_LENGTH); requestBuffer.put(CONFIG_BYTES); mockCnxManager.toSend(0L, requestBuffer); sendValidNotifications(1, 0); leaderElectionThread.join(5000); if (leaderElectionThread.isAlive()) { Assert.fail("Leader election thread didn't join, something went wrong."); } }</code><technical_language>*FastLeaderElection.buildMsg(ServerState.LOOKING.ordinal(), 1, 0, 0, 0, CONFIG_BYTES)* work here? same</technical_language>

Target:
public void testNotificationMessageWithInvalidConfig() throws Exception { startMockServer(1); ByteBuffer requestBuffer = FastLeaderElection.buildMsg(ServerState.LOOKING.ordinal(), 1, 0, 0, 0, CONFIG_BYTES); mockCnxManager.toSend(0L, requestBuffer); sendValidNotifications(1, 0); leaderElectionThread.join(5000); if (leaderElectionThread.isAlive()) { Assert.fail("Leader election thread didn't join, something went wrong."); } }
Source:
<code>public static void verifySecureStorageOfPassword(String username, String server, boolean shouldExist, ServerType serverType) { WorkbenchPreferenceDialog workbenchPreferenceDialog = new WorkbenchPreferenceDialog(); StoragePreferencePage secureStoragePreferencePage = new StoragePreferencePage(); new WorkbenchShell().setFocus(); workbenchPreferenceDialog.open(); new WorkbenchPreferenceDialog().select(secureStoragePreferencePage); secureStoragePreferencePage.selectContentTab(); boolean exists = secureStoragePreferencePage.passwordExists("[Default Secure Storage]", getPluginId(serverType), server, username); workbenchPreferenceDialog.ok(); <START> assertTrue(shouldExist ? "Password wasn't present in secure storage while it." <END> : "Password was present in secure storage but shouldn't.", shouldExist == exists); }</code><technical_language>while should, perhaps</technical_language>

Target:
public static void verifySecureStorageOfPassword(String username, String server, boolean shouldExist, ServerType serverType) { WorkbenchPreferenceDialog workbenchPreferenceDialog = new WorkbenchPreferenceDialog(); StoragePreferencePage secureStoragePreferencePage = new StoragePreferencePage(); new WorkbenchShell().setFocus(); workbenchPreferenceDialog.open(); new WorkbenchPreferenceDialog().select(secureStoragePreferencePage); secureStoragePreferencePage.selectContentTab(); boolean exists = secureStoragePreferencePage.passwordExists("[Default Secure Storage]", getPluginId(serverType), server, username); workbenchPreferenceDialog.ok(); assertTrue(shouldExist ? "Password wasn't present in secure storage while it should." : "Password was present in secure storage but it shouldn't.", shouldExist == exists); }