auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void loadFromFile() throws IOException { File settingFile = new File(conf.getInterpreterSettingPath()); if (!settingFile.exists()) { return; } FileInputStream fis = new FileInputStream(settingFile); InputStreamReader isr = new InputStreamReader(fis); BufferedReader bufferedReader = new BufferedReader(isr); StringBuilder sb = new StringBuilder(); InterpreterSetting interpreterSettingObject; String depClassPath = StringUtils.EMPTY; String line; while ((line = bufferedReader.readLine()) != null) { sb.append(line); } isr.close(); fis.close(); String json = sb.toString(); InterpreterInfoSaving info = gson.fromJson(json, InterpreterInfoSaving.class); for (String k : info.interpreterSettings.keySet()) { InterpreterSetting setting = info.interpreterSettings.get(k); setting.getOption().setRemote(true); interpreterSettingObject = interpreterSettingsRef.get(setting.getGroup()); if (interpreterSettingObject == null) { logger.info("can't get InterpreterSetting " + <START> "Information From loaded Interrpeter Setting Ref - ", setting.getGroup()); <END> continue; } depClassPath = interpreterSettingObject.getPath(); setting.setPath(depClassPath); setting.setInterpreterGroupFactory(this); loadInterpreterDependencies(setting); interpreterSettings.put(k, setting); } this.interpreterBindings = info.interpreterBindings; if (info.interpreterRepositories != null) { for (RemoteRepository repo : info.interpreterRepositories) { if (!depResolver.getRepos().contains(repo)) { this.interpreterRepositories.add(repo); } } } }</code><technical_language>is a typo :) Interrpeter -> Interpreter</technical_language>

Target:
private void loadFromFile() throws IOException { File settingFile = new File(conf.getInterpreterSettingPath()); if (!settingFile.exists()) { return; } FileInputStream fis = new FileInputStream(settingFile); InputStreamReader isr = new InputStreamReader(fis); BufferedReader bufferedReader = new BufferedReader(isr); StringBuilder sb = new StringBuilder(); InterpreterSetting interpreterSettingObject; String depClassPath = StringUtils.EMPTY; String line; while ((line = bufferedReader.readLine()) != null) { sb.append(line); } isr.close(); fis.close(); String json = sb.toString(); InterpreterInfoSaving info = gson.fromJson(json, InterpreterInfoSaving.class); for (String k : info.interpreterSettings.keySet()) { InterpreterSetting setting = info.interpreterSettings.get(k); setting.getOption().setRemote(true); interpreterSettingObject = interpreterSettingsRef.get(setting.getGroup()); if (interpreterSettingObject == null) { logger.warn("can't get InterpreterSetting " + "Information From loaded Interpreter Setting Ref - ", setting.getGroup()); continue; } depClassPath = interpreterSettingObject.getPath(); setting.setPath(depClassPath); setting.setInterpreterGroupFactory(this); loadInterpreterDependencies(setting); interpreterSettings.put(k, setting); } this.interpreterBindings = info.interpreterBindings; if (info.interpreterRepositories != null) { for (RemoteRepository repo : info.interpreterRepositories) { if (!depResolver.getRepos().contains(repo)) { this.interpreterRepositories.add(repo); } } } }
Source:
<code><START> public static OpenSpan startSpan(String operation, String parentSpanId) { <END> Preconditions.checkState(currentTrace.get().isEmpty(), "Cannot start a span with explicit parent if the current thread's trace is non-empty"); OpenSpan span = OpenSpan.builder() .spanId(Traces.randomId()) .operation(operation) .parentSpanId(parentSpanId) .build(); currentTrace.get().push(span); return span; }</code><technical_language>parentSpanId checked for empty, for null</technical_language>

Target:
public static OpenSpan startSpan(String operation, String parentSpanId) { Preconditions.checkState(currentTrace.get().isEmpty(), "Cannot start a span with explicit parent if the current thread's trace is non-empty"); validateId(parentSpanId, "parentTraceId must be non-empty: %s"); OpenSpan span = OpenSpan.builder() .spanId(Traces.randomId()) .operation(operation) .parentSpanId(parentSpanId) .build(); currentTrace.get().push(span); return span; }
Source:
<code><START> private BigtableTableAdminSettings.Builder buildBigtableTableAdminSettings() throws IOException { <END> BigtableTableAdminSettings.Builder adminBuilder = BigtableTableAdminSettings.newBuilder() .setProjectId(getProjectId()) .setInstanceId(getInstanceId()); BigtableTableAdminStubSettings.Builder stubSettings = adminBuilder.stubSettings(); buildEndpoints(stubSettings, BIGTABLE_ADMIN_HOST_KEY); buildHeaderProvider(stubSettings); buildCredentialProvider(stubSettings); buildEmulatorSettings(stubSettings); return adminBuilder; }</code><technical_language>above, please return built object</technical_language>

Target:
private BigtableTableAdminSettings buildBigtableTableAdminSettings() throws IOException { BigtableTableAdminSettings.Builder adminBuilder = BigtableTableAdminSettings.newBuilder() .setProjectId(getProjectId()) .setInstanceId(getInstanceId()); BigtableTableAdminStubSettings.Builder stubSettings = adminBuilder.stubSettings(); configureConnection(stubSettings, BIGTABLE_ADMIN_HOST_KEY); configureHeaderProvider(stubSettings); configureCredentialProvider(stubSettings); configureEmulatorSettings(stubSettings); return adminBuilder.build(); }
Source:
<code>public void retrievesForks() throws Exception { <START> final RtForks forks = new RtForks(this.repo()); <END> MatcherAssert.assertThat( forks.iterate("newest"), Matchers.notNullValue() ); }</code><technical_language>wondering do RtForks in MkForksTest tests. test MkForks instead</technical_language>

Target:
public void retrievesForks() throws Exception { final Fork.Smart fork = new Fork.Smart(this.repo().forks().create()); MatcherAssert.assertThat( fork, Matchers.notNullValue() ); MatcherAssert.assertThat( this.repo().forks().iterate("newest"), Matchers.notNullValue() ); }
Source:
<code>protected Command createDeleteViewCommand(GroupRequest deleteRequest) { CompositeCommand cc = new <START> CompositeCommand(StringStatics.BLANK); <END> List<?> toDel = deleteRequest.getEditParts(); if (toDel == null || toDel.isEmpty()) { cc.compose(new ViewDeleteCommand((View) getHost().getModel())); } else { for (int i = 0; i < toDel.size(); i++) { IGraphicalEditPart gep = (IGraphicalEditPart) toDel.get(i); cc.compose(new ViewDeleteCommand((View) gep.getModel())); } } return new ICommandProxy(cc.reduce()); }</code><technical_language>CompositeTransactionalCommand a choice: check behavior of CompositeCommand editparts selected in group ? require undo for user interaction some kind of composite/compound command, transaction created</technical_language>

Target:
protected Command createDeleteViewCommand(GroupRequest deleteRequest) { TransactionalEditingDomain editingDomain = getEditingDomain(); if (editingDomain == null) { return null; } CompositeTransactionalCommand cc = new CompositeTransactionalCommand(getEditingDomain(), StringStatics.BLANK); List<?> toDel = deleteRequest.getEditParts(); if (toDel == null || toDel.isEmpty()) { cc.compose(new ViewDeleteCommand(editingDomain, (View) getHost().getModel())); } else { for (int i = 0; i < toDel.size(); i++) { IGraphicalEditPart gep = (IGraphicalEditPart) toDel.get(i); cc.compose(new ViewDeleteCommand(editingDomain, (View) gep.getModel())); } } return new ICommandProxy(cc.reduce()); }
Source:
<code>public void releaseTaskCmdExecutorTest() { ReleaseTaskCmd releaseTaskCmd = new ReleaseTaskCmd("taskId"); <START> assertThat(releaseTaskCmdExecutor).isNotNull(); <END> assertThat(releaseTaskCmdExecutor.getHandledType()).isEqualTo(ReleaseTaskCmd.class); releaseTaskCmdExecutor.execute(releaseTaskCmd); verify(processEngine).releaseTask(releaseTaskCmd); verify(commandResults).send(ArgumentMatchers.<Message<CompleteTaskResults>>any()); }</code><technical_language>removed</technical_language>

Target:
public void releaseTaskCmdExecutorTest() { ReleaseTaskCmd releaseTaskCmd = new ReleaseTaskCmd("taskId"); assertThat(releaseTaskCmdExecutor.getHandledType()).isEqualTo(ReleaseTaskCmd.class); releaseTaskCmdExecutor.execute(releaseTaskCmd); verify(processEngine).releaseTask(releaseTaskCmd); verify(commandResults).send(ArgumentMatchers.<Message<CompleteTaskResults>>any()); }
Source:
<code><START> public RegionLocations(HRegionLocation... locations) { <END> this(RegionInfo.DEFAULT_REPLICA_ID, locations); }</code><technical_language>Is in verification replicaId order is correct? caller is considered responsible/trustworthy</technical_language>

Target:
public RegionLocations(HRegionLocation... locations) { int numNonNullElements = 0; int maxReplicaId = -1; int maxReplicaIdIndex = -1; int index = 0; for (HRegionLocation loc : locations) { if (loc != null) { if (loc.getRegion().getReplicaId() >= maxReplicaId) { maxReplicaId = loc.getRegion().getReplicaId(); maxReplicaIdIndex = index; } } index++; } maxReplicaId = maxReplicaId + (locations.length - (maxReplicaIdIndex + 1) ); if (maxReplicaId + 1 == locations.length) { this.locations = locations; } else { this.locations = new HRegionLocation[maxReplicaId + 1]; for (HRegionLocation loc : locations) { if (loc != null) { this.locations[loc.getRegion().getReplicaId()] = loc; } } } for (HRegionLocation loc : this.locations) { if (loc != null && loc.getServerName() != null){ numNonNullElements++; } } this.numNonNullElements = numNonNullElements; }
Source:
<code>public ByteBuf getCommandLineBytes() throws ImapAsyncClientException { final String base64Folder = BASE64MailboxEncoder.encode(folderName); int qResyncParamSize = 0; String qResyncParamStr = null; if (qResyncParameter != null) { <START> qResyncParamStr = qResyncParameter.buildCommandLine(); <END> qResyncParamSize = qResyncParamStr.length(); } final int len = 2 * base64Folder.length() + ImapClientConstants.PAD_LEN + qResyncParamSize; final ByteBuf sb = Unpooled.buffer(len); sb.writeBytes(op.getBytes(StandardCharsets.US_ASCII)); sb.writeByte(ImapClientConstants.SPACE); final ImapArgumentFormatter formatter = new ImapArgumentFormatter(); formatter.formatArgument(base64Folder, sb, false); if (qResyncParamStr != null) { sb.writeByte(ImapClientConstants.SPACE); sb.writeBytes(qResyncParamStr.getBytes(StandardCharsets.US_ASCII)); } sb.writeBytes(CRLF_B); return sb; }</code><technical_language>move building of command line in here. Do create new String wastes memory</technical_language>

Target:
public ByteBuf getCommandLineBytes() throws ImapAsyncClientException { final String base64Folder = BASE64MailboxEncoder.encode(folderName); int qResyncParameterSize = 0; StringBuilder sb = null; if (qResyncParameter != null) { sb = new StringBuilder(); sb.append("(QRESYNC (").append(qResyncParameter.getUidValidity()).append(ImapClientConstants.SPACE).append(qResyncParameter.getModSeq()); if (qResyncParameter.getKnownUids() != null) { sb.append(ImapClientConstants.SPACE); sb.append(MessageNumberSet.buildString(qResyncParameter.getKnownUids())); } if (qResyncParameter.getSeqMatchData() != null) { sb.append(ImapClientConstants.SPACE).append("("); sb.append(MessageNumberSet.buildString(qResyncParameter.getSeqMatchData().getKnownSequenceSet())); sb.append(ImapClientConstants.SPACE); sb.append(MessageNumberSet.buildString(qResyncParameter.getSeqMatchData().getKnownUidSet())); sb.append(")"); } sb.append("))"); qResyncParameterSize = sb.length(); } final int len = 2 * base64Folder.length() + ImapClientConstants.PAD_LEN + qResyncParameterSize; final ByteBuf byteBuf = Unpooled.buffer(len); byteBuf.writeBytes(op.getBytes(StandardCharsets.US_ASCII)); byteBuf.writeByte(ImapClientConstants.SPACE); final ImapArgumentFormatter formatter = new ImapArgumentFormatter(); formatter.formatArgument(base64Folder, byteBuf, false); if (qResyncParameterSize > 0) { byteBuf.writeByte(ImapClientConstants.SPACE); byteBuf.writeBytes(sb.toString().getBytes(StandardCharsets.US_ASCII)); } byteBuf.writeBytes(CRLF_B); return byteBuf; }
Source:
<code>public Tile getTown() { <START> return null; <END> }</code><technical_language>If want, loop tile here, this removed/implemented this is merged</technical_language>

Target:
public Tile getTown() { for (Tile t : baseGrid) { if (t.getTerrain().equals(TerrainType.TOWN)) { return t; } } return null; }
Source:
<code>private void checkVariantInformation(Variant variant, String fileId, String studyId) throws NonVariantException, IncompleteInformationException { VariantSourceEntry variantSourceEntry = variant.getSourceEntry(fileId, studyId); List<Map<String, String>> samplesData = variantSourceEntry.getSamplesData(); if (!samplesData.isEmpty()) { if (samplesData.stream().map(m -> m.get("GT")).noneMatch(this::genotypeHasAlternateAllele)) { throw new NonVariantException("TODO MESSAGE HERE"); } } else { boolean hasAC = checkAttributeIsNotZero(variantSourceEntry, "AC"); boolean hasAF = checkAttributeIsNotZero(variantSourceEntry, "AF"); boolean hasAN = checkAttributeIsNotZero(variantSourceEntry, "AN"); boolean hasGTC = checkAttributeIsNotZero(variantSourceEntry, "GTC"); <START> if (!hasAC && !hasAF && !hasAN && !hasGTC) { <END> throw new IncompleteInformationException(variant); } } }</code><technical_language>sense fail if get only? AC only</technical_language>

Target:
protected void checkVariantInformation(Variant variant, String fileId, String studyId) throws NonVariantException, IncompleteInformationException { if (variant.getAlternate().equalsIgnoreCase(variant.getReference())) { throw new NonVariantException("The variant " + variant + " reference and alternate alleles are the same"); } if (variant.getAlternate().equals(".")) { throw new NonVariantException("The variant " + variant + " has no alternate allele"); } }
Source:
<code>private void addCatalogSourceDescriptor(Set<SourceDescriptor> descriptors) { if (descriptors != null) { if (catalog != null) { <START> final Set<ContentType> cachedContentTypes; <END> final Optional<Set<ContentType>> contentTypesOptional = contentTypesCache.getCachedValueForSource(catalog); if (contentTypesOptional.isPresent()) { cachedContentTypes = contentTypesOptional.get(); } else { LOGGER.debug("Unknown ContentTypes for the local catalog"); cachedContentTypes = Collections.emptySet(); } SourceDescriptorImpl descriptor = new SourceDescriptorImpl( this.getId(), cachedContentTypes, sourceActionRegistry.list(catalog)); if (this.getVersion() != null) { descriptor.setVersion(this.getVersion()); } descriptor.setAvailable(isSourceAvailable(catalog)); descriptors.add(descriptor); } } }</code><technical_language>this work instead? suggestion final Set<ContentType> cachedContentTypes = contentTypesCache.getCachedValueForSource(catalog) .orElseGet(() -> { LOGGER.debug("Unknown ContentTypes for local catalog"); return Collections.emptySet(); });</technical_language>

Target:
private void addCatalogSourceDescriptor(Set<SourceDescriptor> descriptors) { if (descriptors != null) { if (catalog != null) { final SourceDescriptorImpl descriptor = new SourceDescriptorImpl( this.getId(), contentTypesCache .getCachedValueForSource(catalog) .orElseGet( () -> { LOGGER.debug("Unknown content types for the localSource"); return Collections.emptySet(); }), sourceActionRegistry.list(catalog)); if (this.getVersion() != null) { descriptor.setVersion(this.getVersion()); } descriptor.setAvailable(isSourceAvailable(catalog)); descriptors.add(descriptor); } } }
Source:
<code>public void hasMimeType() throws Exception { matcher.init(FakeMatcherConfig.builder() .matcherName("HasMimeType") .condition(MIME_TYPES) .build()); <START> assertNotNull(matcher.match(mail)); <END> }</code><technical_language>more explicit is null? sould list of recipients</technical_language>

Target:
public void hasMimeType() throws MessagingException { matcher.init(FakeMatcherConfig.builder() .matcherName("HasMimeType") .condition(MIME_TYPES) .build()); assertThat(matcher.match(mail)).containsAll(mail.getRecipients()); }
Source:
<code>public byte[][] getByteParams(byte[]... args) { ArrayList<byte[]> byteParams = new ArrayList<>(); for (byte[] arg : args) { byteParams.add(arg); } if (contains(NX)) { byteParams.add(SafeEncoder.encode(NX)); } if (contains(XX)) { byteParams.add(SafeEncoder.encode(XX)); } <START> if (contains(GET)) { byteParams.add(SafeEncoder.encode(GET)); } <END> if (contains(EX)) { byteParams.add(SafeEncoder.encode(EX)); byteParams.add(Protocol.toByteArray((int) getParam(EX))); } if (contains(PX)) { byteParams.add(SafeEncoder.encode(PX)); byteParams.add(Protocol.toByteArray((long) getParam(PX))); } return byteParams.toArray(new byte[byteParams.size()][]); }</code><technical_language>Move this if block if blocks</technical_language>

Target:
public byte[][] getByteParams(byte[]... args) { ArrayList<byte[]> byteParams = new ArrayList<>(); for (byte[] arg : args) { byteParams.add(arg); } if (contains(NX)) { byteParams.add(SafeEncoder.encode(NX)); } if (contains(XX)) { byteParams.add(SafeEncoder.encode(XX)); } if (contains(EX)) { byteParams.add(SafeEncoder.encode(EX)); byteParams.add(Protocol.toByteArray((int) getParam(EX))); } if (contains(PX)) { byteParams.add(SafeEncoder.encode(PX)); byteParams.add(Protocol.toByteArray((long) getParam(PX))); } if (contains(GET)) { byteParams.add(SafeEncoder.encode(GET)); } return byteParams.toArray(new byte[byteParams.size()][]); }
Source:
<code>public void testNull() { <START> org.eclipse.papyrus.sysml14.nattable.requirement.tester.RequirementTableTester <END> tableRequirementTester = new org.eclipse.papyrus.sysml14.nattable.requirement.tester.RequirementTableTester(); IStatus emptyNotAllowed = tableRequirementTester.isAllowed(null); Assert.assertEquals("The tester should not work on a null entry", IStatus.ERROR, emptyNotAllowed.getSeverity()); }</code><technical_language>import</technical_language>

Target:
public void testNull() { RequirementTableTester tableRequirementTester = new RequirementTableTester(); IStatus emptyNotAllowed = tableRequirementTester.isAllowed(null); Assert.assertEquals("The tester should not work on a null entry", IStatus.ERROR, emptyNotAllowed.getSeverity()); }
Source:
<code>ParametrizedTypeType(Symbol.TypeSymbol symbol, Map<TypeVariableType, Type> typeSubstitution) { super(symbol); this.rawType = symbol.getType(); this.typeSubstitution = typeSubstitution; <START> if (rawType.isTagged(UNKNOWN)) { <END> this.tag = UNKNOWN; } }</code><technical_language>I this done this level. I tend constructing a ParametrizedTypeType ParametrizedTypeCache return unknown type altogether unknown ParametrizedTypeType (IMO) lead confusion</technical_language>

Target:
ParametrizedTypeType(Symbol.TypeSymbol symbol, Map<TypeVariableType, Type> typeSubstitution) { super(symbol); this.rawType = symbol.getType(); this.typeSubstitution = typeSubstitution; }
Source:
<code>public void testWithTimerTask() { <START> Task<?> task = delayedValue("value", 5, TimeUnit.SECONDS).withTimeout(2, TimeUnit.SECONDS); <END> runAndWaitException(task, TimeoutException.class); Assert.assertTrue(_traceCaptureListener.isDone()); Trace trace = _traceCaptureListener.getTrace(); Assert.assertNotNull(trace); Optional<ShallowTrace> timerTrace = findTraceByName(trace, "withTimeout"); Assert.assertTrue(timerTrace.isPresent()); Assert.assertEquals(timerTrace.get().getResultType(), ResultType.ERROR); Optional<ShallowTrace> valueTrace = findTraceByName(trace, "value"); Assert.assertTrue(valueTrace.isPresent()); Assert.assertEquals(valueTrace.get().getResultType(), ResultType.EARLY_FINISH); }</code><technical_language>IIUC this test 2s complete? change timeout smaller e.g. 50ms</technical_language>

Target:
public void testWithTimerTask() { Task<?> task = delayedValue("value", 1000, TimeUnit.MILLISECONDS).withTimeout(50, TimeUnit.MILLISECONDS); runAndWaitException(task, TimeoutException.class); Assert.assertTrue(_traceCaptureListener.isDone()); Trace trace = _traceCaptureListener.getTrace(); Assert.assertNotNull(trace); Optional<ShallowTrace> timerTrace = findTraceByName(trace, "withTimeout"); Assert.assertTrue(timerTrace.isPresent()); Assert.assertEquals(timerTrace.get().getResultType(), ResultType.ERROR); Optional<ShallowTrace> valueTrace = findTraceByName(trace, "value"); Assert.assertTrue(valueTrace.isPresent()); Assert.assertEquals(valueTrace.get().getResultType(), ResultType.EARLY_FINISH); }
Source:
<code><START> public GatewayProxyFactoryBean itemReadEventsListener() { <END> GatewayProxyFactoryBean factoryBean = new GatewayProxyFactoryBean(ItemReadListener.class); factoryBean.setDefaultRequestChannel(listenerChannels.itemReadEvents()); return factoryBean; }</code><technical_language>want GatewayProxy method for read listener result in item wire. A custom listener error is a approach (I realize this I yesterday ;)</technical_language>

Target:
public ItemReadListener itemReadEventsListener() { return new EventEmittingItemReadEventsListener(listenerChannels.itemReadEvents()); }
Source:
<code>private void loadBuiltInJavaFunctions(ImmutableMap.Builder<Integer, UserDefinedFunctionRunner> builder) { <START> builder.put(21025, new UserDefinedFunctionRunner("FORMAT_TIMESTAMP", 21025, "format_timestamp", new JavaBuiltInFunctions())); <END> }</code><technical_language>I comfortable magic numbers 21025. possibly implement a getFunctionID() function in FunctionForVoltDB</technical_language>

Target:
private void loadBuiltInJavaFunctions(ImmutableMap.Builder<Integer, UserDefinedFunctionRunner> builder) { String[] functionNames = {"format_timestamp"}; for (String functionName : functionNames) { int functionID = FunctionForVoltDB.getFunctionID(functionName); builder.put(functionID, new UserDefinedFunctionRunner(functionName, functionID, functionName, new JavaBuiltInFunctions())); } }
Source:
<code>private boolean isAbruptFinallyBlock(Tree.Kind jumpKind) { if (isInFinally.isEmpty()) { <START> return false; <END> } Tree.Kind blockKind = isInFinally.peek(); switch (blockKind) { case BLOCK: return true; case FOR_STATEMENT: case FOR_EACH_STATEMENT: case WHILE_STATEMENT: case DO_STATEMENT: case SWITCH_STATEMENT: return handleControlFlowInFinally(jumpKind); case METHOD: default: return false; } }</code><technical_language>covering this branch? in tests? a case case</technical_language>

Target:
private boolean isAbruptFinallyBlock(Tree.Kind jumpKind) { if (treeKindStack.isEmpty()) { return false; } Tree.Kind blockKind = treeKindStack.peek(); switch (blockKind) { case BLOCK: return true; case FOR_STATEMENT: case FOR_EACH_STATEMENT: case WHILE_STATEMENT: case DO_STATEMENT: case SWITCH_STATEMENT: return handleControlFlowInFinally(jumpKind); case METHOD: default: return false; } }
Source:
<code>protected void executeCommand() { try { addVmToDb(); VM vm = getVm(); <START> if (!vm.hasImages()) { <END> endVmRelatedOps(); } else { processImages(); } } catch (RuntimeException e) { MacPoolManager.getInstance().freeMacs(macsAdded); throw e; } setSucceeded(true); }</code><technical_language>I write !vm.getImages().isEmpty() in condition instead refactoring, I guess this is a matter of style..</technical_language>

Target:
protected void executeCommand() { try { addVmToDb(); VM vm = getVm(); if (vm.getImages().isEmpty()) { endVmRelatedOps(); } else { processImages(); } } catch (RuntimeException e) { MacPoolManager.getInstance().freeMacs(macsAdded); throw e; } setSucceeded(true); }
Source:
<code>long webkit_download_decide_destination(long download, long suggested_filename) { <START> int length = C.strlen (suggested_filename); <END> byte[] bytes = new byte[length]; C.memmove (bytes, suggested_filename, length); final String fileName = new String (Converter.mbcsToWcs (bytes)); if (!browser.isDisposed ()) { FileDialog dialog = new FileDialog (browser.getShell (), SWT.SAVE); dialog.setFileName (fileName); String title = Compatibility.getMessage ("SWT_FileDownload"); dialog.setText (title); String path = dialog.open (); if (path != null) { path = URI_FILEROOT + path; byte[] uriBytes = Converter.wcsToMbcs (path, true); WebKitGTK.webkit_download_set_allow_overwrite (download, true); WebKitGTK.webkit_download_set_destination (download, uriBytes); OS.g_object_ref (download); browser.getDisplay().asyncExec(() -> { openDownloadWindow (download, fileName); }); } } return 0; }</code><technical_language>if this is webkit2 only, add a 'assert WEBKIT2 .. ' of sorts? clear code is reached webkit 1 webkit2. If reached both, I add "assert WEBKIT1 || WEBKIT2".</technical_language>

Target:
long webkit_download_decide_destination(long download, long suggested_filename) { assert WEBKIT2 : WebKitGTK.Webkit2AssertMsg; final String fileName = getString(suggested_filename); if (!browser.isDisposed ()) { FileDialog dialog = new FileDialog (browser.getShell (), SWT.SAVE); dialog.setFileName (fileName); String title = Compatibility.getMessage ("SWT_FileDownload"); dialog.setText (title); String path = dialog.open (); if (path != null) { path = URI_FILEROOT + path; byte[] uriBytes = Converter.wcsToMbcs (path, true); WebKitGTK.webkit_download_set_allow_overwrite (download, true); WebKitGTK.webkit_download_set_destination (download, uriBytes); OS.g_object_ref (download); browser.getDisplay().asyncExec(() -> { openDownloadWindow (download, fileName); }); } } return 0; }
Source:
<code>protected void onGooglePlayServicesReady() { SupportMapFragment fragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); map = fragment.getMap(); map.setMyLocationEnabled(true); map.getUiSettings().setZoomControlsEnabled(false); map.getUiSettings().setMyLocationButtonEnabled(false); ParseQuery<ParseObject> query = ParseQuery.getQuery("Request"); Intent i = getIntent(); <START> String requestId = i.getStringExtra(Constants.REQUEST_ID); <END> Request.getByObjectId(requestId, new ModelCallback<Request>() { @Override public void onModelFound(Request req) { request = req; RequestDetailActivity.this.updateRequestDetail(); } @Override public void onModelError(Throwable e) { RequestDetailActivity.this.onError(e); } }); }</code><technical_language>I if constant defined in a generic constants class, class intent? preference if for latter, works kind of interface does: "I Activity A, I need Intent data B"</technical_language>

Target:
protected void onGooglePlayServicesReady() { SupportMapFragment fragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); map = fragment.getMap(); map.setMyLocationEnabled(true); map.getUiSettings().setZoomControlsEnabled(false); map.getUiSettings().setMyLocationButtonEnabled(false); Intent i = getIntent(); String requestId = i.getStringExtra(REQUEST_ID); Request.getByObjectId(requestId, new ModelCallback<Request>() { @Override public void onModelFound(Request req) { request = req; RequestDetailActivity.this.updateRequestDetail(); } @Override public void onModelError(Throwable e) { RequestDetailActivity.this.onError(e); } }); }
Source:
<code>public void testReleaseResource() throws Exception { final CompletableFuture<SlotRequest> slotRequestFuture = new CompletableFuture<>(); resourceManagerGateway.setRequestSlotConsumer(slotRequestFuture::complete); try (SlotPoolImpl slotPool = createAndSetUpSlotPool()) { slotPool.registerTaskManager(taskManagerLocation.getResourceID()); SlotRequestId requestId1 = new SlotRequestId(); CompletableFuture<PhysicalSlot> future1 = requestNewAllocatedSlot( slotPool, requestId1 ); final SlotRequest slotRequest = slotRequestFuture.get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS); CompletableFuture<PhysicalSlot> future2 = requestNewAllocatedSlot( slotPool, new SlotRequestId() ); final SlotOffer slotOffer = new SlotOffer( slotRequest.getAllocationId(), 0, DEFAULT_TESTING_PROFILE); assertTrue(slotPool.offerSlot(taskManagerLocation, taskManagerGateway, slotOffer)); PhysicalSlot slot1 = future1.get(1, TimeUnit.SECONDS); assertTrue(future1.isDone()); assertFalse(future2.isDone()); final CompletableFuture<?> releaseFuture = new CompletableFuture<>(); SingleLogicalSlot logicalSlot = SingleLogicalSlot.allocateFromPhysicalSlot( requestId1, slot1, Locality.UNKNOWN, new DummySlotOwner(), true ); logicalSlot.tryAssignPayload(new DummyPayload(releaseFuture)); slotPool.releaseTaskManager(taskManagerLocation.getResourceID(), null); <START> releaseFuture.get(1, TimeUnit.SECONDS); <END> assertFalse(logicalSlot.isAlive()); Thread.sleep(10); assertFalse(future2.isDone()); } }</code><technical_language>releaseFuture.get(); work</technical_language>

Target:
public void testReleaseResource() throws Exception { final CompletableFuture<SlotRequest> slotRequestFuture = new CompletableFuture<>(); resourceManagerGateway.setRequestSlotConsumer(slotRequestFuture::complete); try (SlotPoolImpl slotPool = createAndSetUpSlotPool(resourceManagerGateway)) { final SlotRequestId requestId1 = new SlotRequestId(); final CompletableFuture<PhysicalSlot> future1 = requestNewAllocatedSlot( slotPool, requestId1); final SlotRequest slotRequest = slotRequestFuture.get(TIMEOUT.toMilliseconds(), TimeUnit.MILLISECONDS); final CompletableFuture<PhysicalSlot> future2 = requestNewAllocatedSlot( slotPool, new SlotRequestId()); assertTrue(registerAndOfferSlot(taskManagerLocation, slotPool, slotRequest.getAllocationId())); final PhysicalSlot slot1 = future1.get(1, TimeUnit.SECONDS); assertTrue(future1.isDone()); assertFalse(future2.isDone()); final CompletableFuture<?> releaseFuture = new CompletableFuture<>(); final SingleLogicalSlot logicalSlot = SingleLogicalSlot.allocateFromPhysicalSlot( requestId1, slot1, Locality.UNKNOWN, new DummySlotOwner(), true); logicalSlot.tryAssignPayload(new DummyPayload(releaseFuture)); slotPool.releaseTaskManager(taskManagerLocation.getResourceID(), null); releaseFuture.get(); assertFalse(logicalSlot.isAlive()); Thread.sleep(10); assertFalse(future2.isDone()); } }
Source:
<code>protected void ExecuteVmCommand() { super.ExecuteVmCommand(); <START> getParameters().OriginalTemplate = getVm().getvmt_guid(); <END> VmTemplateHandler.lockVmTemplateInTransaction(getParameters().OriginalTemplate, getCompensationContext()); getVm().setvmt_guid(VmTemplateHandler.BlankVmTemplateId); getVm().getStaticData().setQuotaId(getParameters().getVmStaticData().getQuotaId()); DbFacade.getInstance().getVmStaticDAO().update(getVm().getStaticData()); if (getTaskIdList().isEmpty()) { EndSuccessfully(); } }</code><technical_language>a lock is freed super.ExecuteVmCommand(); , is means status of entity in DB is changed after, race is left</technical_language>

Target:
protected void ExecuteVmCommand() { VmTemplateHandler.lockVmTemplateInTransaction(getParameters().OriginalTemplate, getCompensationContext()); super.ExecuteVmCommand(); getParameters().OriginalTemplate = getVm().getvmt_guid(); getVm().setvmt_guid(VmTemplateHandler.BlankVmTemplateId); getVm().getStaticData().setQuotaId(getParameters().getVmStaticData().getQuotaId()); DbFacade.getInstance().getVmStaticDAO().update(getVm().getStaticData()); if (getTaskIdList().isEmpty()) { EndSuccessfully(); } }
Source:
<code>EditorActivityDelayer() { <START> display = SWTUtils.getDisplay(); <END> Objects.requireNonNull(display, "CTOR invoked from non SWT Thread"); }</code><technical_language>This is reason builds fail. is load display workbench. request display fly in method calls instead avoid issues context tests? is *very* annoying mock SWT stuff. I work for a single test class, executing test suites, complains SWT library is loaded another classloader (as wants execute SarosEclipseContextTest SarosEclipseContextFactoryTest). I idea solve this. I get PowerMock suppress mock CTOR call EditorManager EditorActivityDelayer success</technical_language>

Target:
EditorActivityDelayer() { display = SWTUtils.getDisplay(); }
Source:
<code><START> public static void failTaskWithoutVdsmId(final AsyncTasks task) { <END> task.getTaskParameters().setTaskGroupSuccess(false); ExecutionHandler.endTaskStep(task.getStepId(), JobExecutionStatus.FAILED); removeTaskFromDbByTaskId(task.getTaskId()); if (task.getTaskType() == AsyncTaskType.unknown) { return; } ThreadPoolUtil.execute(new Runnable() { @SuppressWarnings("synthetic-access") @Override public void run() { NGuid stepId = task.getStepId(); ExecutionContext context = null; if (stepId != null) { context = ExecutionHandler.createFinalizingContext(stepId.getValue()); } Backend.getInstance().endAction(task.getaction_type(), task.getActionParameters(), new CommandContext(context)); } }); }</code><technical_language>WithoutdVsmTaskId</technical_language>

Target:
public static void failTaskWithoutVdsmId(final AsyncTasks task) { ThreadPoolUtil.execute(new Runnable() { @SuppressWarnings("synthetic-access") @Override public void run() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Object>() { @Override public Object runInTransaction() { logAndFailTaskWithoutVdsmId(task); return null; } }); } }); }
Source:
<code>public <T> AggregatedPage<T> mapResults(SearchResponse response, Class<T> clazz, Pageable pageable) { <START> long totalHits = response.getHits().getTotalHits().value; <END> float maxScore = response.getHits().getMaxScore(); List<T> results = new ArrayList<>(); for (SearchHit hit : response.getHits()) { if (hit != null) { T result = null; String hitSourceAsString = hit.getSourceAsString(); if (!StringUtils.isEmpty(hitSourceAsString)) { result = mapEntity(hitSourceAsString, clazz); } else { result = mapEntity(hit.getFields().values(), clazz); } setPersistentEntityId(result, hit.getId(), clazz); setPersistentEntityVersion(result, hit.getVersion(), clazz); setPersistentEntityScore(result, hit.getScore(), clazz); populateScriptFields(result, hit); results.add(result); } } return new AggregatedPageImpl<T>(results, pageable, totalHits, response.getAggregations(), response.getScrollId(), maxScore); }</code><technical_language>Yikes! Lucene API is leaking here</technical_language>

Target:
public <T> AggregatedPage<T> mapResults(SearchResponse response, Class<T> clazz, Pageable pageable) { long totalHits = SearchHitsUtil.getTotalCount(response.getHits()); float maxScore = response.getHits().getMaxScore(); List<T> results = new ArrayList<>(); for (SearchHit hit : response.getHits()) { if (hit != null) { T result = null; String hitSourceAsString = hit.getSourceAsString(); if (!StringUtils.isEmpty(hitSourceAsString)) { result = mapEntity(hitSourceAsString, clazz); } else { result = mapEntity(hit.getFields().values(), clazz); } setPersistentEntityId(result, hit.getId(), clazz); setPersistentEntityVersion(result, hit.getVersion(), clazz); setPersistentEntityScore(result, hit.getScore(), clazz); populateScriptFields(result, hit); results.add(result); } } return new AggregatedPageImpl<T>(results, pageable, totalHits, response.getAggregations(), response.getScrollId(), maxScore); }
Source:
<code>public long getMaxTime() { Long maxTime = extractTimeValue(_maxValueMap.get(_timeColumnName)); if (maxTime != null) { return maxTime; <START> } <END> return Long.MIN_VALUE; }</code><technical_language>this is in HLRealtimeSegmentDataManager</technical_language>

Target:
public long getMaxTime() { Long maxTime = extractTimeValue(getMaxVal(_timeColumnName)); if (maxTime != null) { return maxTime; } return Long.MIN_VALUE; }
Source:
<code>private Scenario giveResourcesToPlayerForRoadBuilding(int moveOrder) { return scenario <START> .nextRandomDiceValues(asList(moveOrder, moveOrder, 6, 6, 6, 6)) <END> .THROW_DICE(moveOrder) .END_TURN(moveOrder) .THROW_DICE(moveOrder == 1 ? 2 : moveOrder == 2 ? 3 : 1) .END_TURN(moveOrder == 1 ? 2 : moveOrder == 2 ? 3 : 1) .THROW_DICE(moveOrder == 1 ? 3 : moveOrder == 2 ? 1 : 2) .END_TURN(moveOrder == 1 ? 3 : moveOrder == 2 ? 1 : 2); }</code><technical_language>is easier read if set next random values dice is thrown, time is needed</technical_language>

Target:
private Scenario giveResourcesToPlayerForRoadBuilding(int moveOrder) { return scenario .nextRandomDiceValues(asList(moveOrder, moveOrder)) .THROW_DICE(moveOrder) .END_TURN(moveOrder) .nextRandomDiceValues(asList(6, 6)) .THROW_DICE(moveOrder == 1 ? 2 : moveOrder == 2 ? 3 : 1) .END_TURN(moveOrder == 1 ? 2 : moveOrder == 2 ? 3 : 1) .nextRandomDiceValues(asList(6, 6)) .THROW_DICE(moveOrder == 1 ? 3 : moveOrder == 2 ? 1 : 2) .END_TURN(moveOrder == 1 ? 3 : moveOrder == 2 ? 1 : 2); }
Source:
<code>protected void parseConfiguration(ServerConfiguration conf) { tableIdToTableName = new HashMap<>(); poolNameToRegexPattern = new HashMap<>(); <START> for (Entry<String,String> table : getTableOperations().tableIdMap().entrySet()) { <END> tableIdToTableName.put(table.getValue(), table.getKey()); Map<String,String> customProps = conf.getTableConfiguration(table.getValue()).getAllPropertiesWithPrefix(Property.TABLE_ARBITRARY_PROP_PREFIX); if (null != customProps && customProps.size() > 0) { for (Entry<String,String> customProp : customProps.entrySet()) { String tableName = customProp.getKey().substring(HOST_BALANCER_PREFIX.length()); String regex = customProp.getValue(); poolNameToRegexPattern.put(tableName, Pattern.compile(regex)); } } } String oobProperty = conf.getConfiguration().get(HOST_BALANCER_OOB_CHECK); if (null != oobProperty) { oobCheckMillis = AccumuloConfiguration.getTimeInMillis(oobProperty); } String poolRecheckProperty = conf.getConfiguration().get(HOST_BALANCER_POOL_RECHECK_KEY); if (null != poolRecheckProperty) { poolRecheckMillis = AccumuloConfiguration.getTimeInMillis(poolRecheckProperty); } String ipBased = conf.getConfiguration().get(HOST_BALANCER_REGEX_USING_IPS); if (null != ipBased) { isIpBasedRegex = Boolean.parseBoolean(ipBased); } }</code><technical_language>if a new table is created balance is initialized, properties updated define a pool for table? Also, if a table is renamed</technical_language>

Target:
protected void parseConfiguration(ServerConfiguration conf) { TableOperations t = getTableOperations(); if (null == t) { throw new RuntimeException("Table Operations cannot be null"); } tableIdToTableName = new HashMap<>(); poolNameToRegexPattern = new HashMap<>(); for (Entry<String,String> table : t.tableIdMap().entrySet()) { tableIdToTableName.put(table.getValue(), table.getKey()); Map<String,String> customProps = conf.getTableConfiguration(table.getValue()).getAllPropertiesWithPrefix(Property.TABLE_ARBITRARY_PROP_PREFIX); if (null != customProps && customProps.size() > 0) { for (Entry<String,String> customProp : customProps.entrySet()) { if (customProp.getKey().startsWith(HOST_BALANCER_PREFIX)) { String tableName = customProp.getKey().substring(HOST_BALANCER_PREFIX.length()); String regex = customProp.getValue(); poolNameToRegexPattern.put(tableName, Pattern.compile(regex)); } } } } String oobProperty = conf.getConfiguration().get(HOST_BALANCER_OOB_CHECK); if (null != oobProperty) { oobCheckMillis = AccumuloConfiguration.getTimeInMillis(oobProperty); } String poolRecheckProperty = conf.getConfiguration().get(HOST_BALANCER_POOL_RECHECK_KEY); if (null != poolRecheckProperty) { poolRecheckMillis = AccumuloConfiguration.getTimeInMillis(poolRecheckProperty); } String ipBased = conf.getConfiguration().get(HOST_BALANCER_REGEX_USING_IPS); if (null != ipBased) { isIpBasedRegex = Boolean.parseBoolean(ipBased); } }
Source:
<code>public static Object[] inject(final Parameter[] parameters, final Set<InjectableParameter> filters, final Object[] args, final Method injectionMethod, final ITestContext context, final ITestResult testResult) { if (filters != null && !filters.isEmpty()) { final ArrayList<Object> arguments = new ArrayList<Object>(args.length); final Queue<ObjectHolder> queue = new ArrayDeque<ObjectHolder>(args.length); for (int i = 0; i < args.length; i++) { queue.add(new ObjectHolder(args[i])); } final boolean currentTestMethod = filters.contains(InjectableParameter.CURRENT_TEST_METHOD); final boolean iTestContext = filters.contains(InjectableParameter.ITEST_CONTEXT); final boolean iTestResult = filters.contains(InjectableParameter.ITEST_RESULT); final boolean xmlTest = filters.contains(InjectableParameter.XML_TEST); boolean firstMethodInjected = false; for (final Parameter parameter : parameters) { boolean injected = false; if (currentTestMethod && !firstMethodInjected) { if (canInject(parameter, InjectableParameter.CURRENT_TEST_METHOD)) { arguments.add(injectionMethod); firstMethodInjected = true; injected = true; } } <START> if (!injected && iTestContext) { <END> if (canInject(parameter, InjectableParameter.ITEST_CONTEXT)) { arguments.add(context); injected = true; } } if (!injected && iTestResult) { if (canInject(parameter, InjectableParameter.ITEST_RESULT)) { arguments.add(testResult); injected = true; } } if (!injected && xmlTest) { if (canInject(parameter, InjectableParameter.XML_TEST)) { arguments.add(context != null ? context.getCurrentXmlTest() : null); injected = true; } } if (!injected) { arguments.add(queue.poll().get()); } } final Object[] injectedArray = new Object[arguments.size()]; return arguments.toArray(injectedArray); } else { return args; } }</code><technical_language>a big: if (!injected) { ... } ?</technical_language>

Target:
public static Object[] inject(final Parameter[] parameters, final Set<InjectableParameter> filters, final Object[] args, final Method injectionMethod, final ITestContext context, final ITestResult testResult) { if (filters != null && !filters.isEmpty()) { final ArrayList<Object> arguments = new ArrayList<>(args.length); final ListBackedImmutableQueue<Object> queue = new ListBackedImmutableQueue<>(args); boolean firstMethodInjected = false; for (final Parameter parameter : parameters) { boolean inject = false; Object injectObject = null; for (final InjectableParameter injectableParameter : filters) { inject = canInject(parameter, injectableParameter); switch (injectableParameter) { case CURRENT_TEST_METHOD: injectObject = injectionMethod; if (inject && !firstMethodInjected) { firstMethodInjected = true; } else { inject = false; } break; case ITEST_CONTEXT: injectObject = context; break; case ITEST_RESULT: injectObject = testResult; break; case XML_TEST: injectObject = context != null ? context.getCurrentXmlTest() : null; break; default: break; } if (inject) { arguments.add(injectObject); break; } } if (!inject) { arguments.add(queue.poll()); } } final Object[] injectedArray = new Object[arguments.size()]; return arguments.toArray(injectedArray); } else { return args; } }
Source:
<code>private CompletionStage<RestResponse> getStats(RestRequest request) { <START> NettyRestResponse.Builder responseBuilder = checkCacheManager(request); <END> if (responseBuilder.getHttpStatus() == NOT_FOUND) return completedFuture(responseBuilder.build()); CacheContainerStats containerStats = Security.doAs(request.getSubject(), (PrivilegedAction<CacheContainerStats>) () -> cacheManager.getStats()); try { byte[] bytes = objectMapper.writeValueAsBytes(containerStats); responseBuilder.contentType(APPLICATION_JSON) .entity(bytes) .status(OK); } catch (JsonProcessingException e) { responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR); } return completedFuture(responseBuilder.build()); }</code><technical_language>suggestion cacheManager::getStats);</technical_language>

Target:
private CompletionStage<RestResponse> getStats(RestRequest request) { NettyRestResponse.Builder responseBuilder = checkCacheManager(request); if (responseBuilder.getHttpStatus() == NOT_FOUND) return completedFuture(responseBuilder.build()); CacheContainerStats stats = cacheManager.getStats(); try { byte[] bytes = objectMapper.writeValueAsBytes(stats); responseBuilder.contentType(APPLICATION_JSON) .entity(bytes) .status(OK); } catch (JsonProcessingException e) { responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR); } return completedFuture(responseBuilder.build()); }
Source:
<code>private static Object literalValue(RexLiteral literal) { Comparable value = RexLiteral.value(literal); String dateTimeFormatISO = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; switch (literal.getTypeName()) { case TIMESTAMP: case TIMESTAMP_WITH_LOCAL_TIME_ZONE: assert value instanceof TimestampString; final SimpleDateFormat dateFormatter = new SimpleDateFormat(dateTimeFormatISO, Locale.ROOT); <START> dateFormatter.setTimeZone(DateTimeUtils.UTC_ZONE); <END> return dateFormatter.format(literal.getValue2()); case DATE: assert value instanceof DateString; return value.toString(); default: return literal.getValue3(); } }</code><technical_language>codes reuse in DataTimeUtils</technical_language>

Target:
private static Object literalValue(RexLiteral literal) { Comparable value = RexLiteral.value(literal); switch (literal.getTypeName()) { case TIMESTAMP: case TIMESTAMP_WITH_LOCAL_TIME_ZONE: assert value instanceof TimestampString; final SimpleDateFormat dateFormatter = getDateFormatter(ISO_DATETIME_FRACTIONAL_SECOND_FORMAT); return dateFormatter.format(literal.getValue2()); case DATE: assert value instanceof DateString; return value.toString(); default: return literal.getValue3(); } }
Source:
<code>private void validate() { boolean remote = (fFlags & REMOTE) > 0; StringBuilder sb = new StringBuilder(); String hostBinary = fHostBinaryText.getText().trim(); if ( hostBinary.isEmpty() ) { sb.append( ( remote ) ? Messages.GdbDebugNewExecutableCommand_Host_binary_must_be_specified : Messages.GdbDebugNewExecutableCommand_Binary_must_be_specified ); } else { File file = new File( hostBinary ); if ( !file.exists() ) { sb.append( ( remote ) ? Messages.GdbDebugNewExecutableCommand_Host_binary_file_does_not_exist : Messages.GdbDebugNewExecutableCommand_Binary_file_does_not_exist ); } else if ( file.isDirectory() ) { sb.append( ( remote ) ? Messages.GdbDebugNewExecutableCommand_Invalid_host_binary : Messages.GdbDebugNewExecutableCommand_Invalid_binary ); } } if ( fTargetBinaryText != null ) { if ( fTargetBinaryText.getText().trim().length() == 0 ) { if ( sb.length() != 0 ) { <START> sb.append('\n'); <END> } sb.append( Messages.GdbDebugNewExecutableCommand_Binary_on_target_must_be_specified ); } } setErrorMessage( ( sb.length() != 0 ) ? sb.toString() : null ); getButton( IDialogConstants.OK_ID ).setEnabled( getErrorMessage() == null ); }</code><technical_language>add a space alignment nicer? "\n "</technical_language>

Target:
private void validate() { boolean remote = (fFlags & REMOTE) > 0; StringBuilder sb = new StringBuilder(); String hostBinary = fHostBinaryText.getText().trim(); if ( hostBinary.isEmpty() ) { sb.append( ( remote ) ? Messages.GdbDebugNewExecutableCommand_Host_binary_must_be_specified : Messages.GdbDebugNewExecutableCommand_Binary_must_be_specified ); } else { File file = new File( hostBinary ); if ( !file.exists() ) { sb.append( ( remote ) ? Messages.GdbDebugNewExecutableCommand_Host_binary_file_does_not_exist : Messages.GdbDebugNewExecutableCommand_Binary_file_does_not_exist ); } else if ( file.isDirectory() ) { sb.append( ( remote ) ? Messages.GdbDebugNewExecutableCommand_Invalid_host_binary : Messages.GdbDebugNewExecutableCommand_Invalid_binary ); } } if ( fTargetBinaryText != null ) { if ( fTargetBinaryText.getText().trim().length() == 0 ) { if ( sb.length() != 0 ) { sb.append( "\n " ); } sb.append( Messages.GdbDebugNewExecutableCommand_Binary_on_target_must_be_specified ); } } setErrorMessage( ( sb.length() != 0 ) ? sb.toString() : null ); getButton( IDialogConstants.OK_ID ).setEnabled( getErrorMessage() == null ); }
Source:
<code>private Map<String, String> parseParameters(String rawParameters) { Map<String, String> result; Properties properties = new Properties(); try { properties.load(new StringReader(rawParameters)); result = new HashMap<>(); for (String key : properties.stringPropertyNames()) { if (!Objects.equals(key, "")) { result.put(key, properties.getProperty(key)); } } <START> } catch (IOException e) { <END> result = new HashMap<>(); } return result; }</code><technical_language>ignore silently exception: add a logger inform it</technical_language>

Target:
private Properties parseParameters(String rawParameters) { Properties properties = new Properties(); try { properties.load(new StringReader(rawParameters)); } catch (IOException e) { LOGGER.warn("Failed to parse UIX parameters [{}]. Cause [{}].", rawParameters, ExceptionUtils.getRootCauseMessage(e)); } return properties; }
Source:
<code>public synchronized MethodInfo postLoadMethodOrNull() { <START> if (isPostLoadMethodMapped) { <END> return postLoadMethod; } Collection<MethodInfo> possiblePostLoadMethods = methodsInfo.findMethodInfoBy(methodInfo -> methodInfo.hasAnnotation(PostLoad.class)); if(possiblePostLoadMethods.size() > 1) { throw new MetadataException(String.format("Cannot have more than one post load method annotated with @PostLoad for class '%s'", this.className)); } this.postLoadMethod = possiblePostLoadMethods.stream().findFirst().orElse(null); return postLoadMethod; }</code><technical_language>This get true..</technical_language>

Target:
public synchronized MethodInfo postLoadMethodOrNull() { initPostLoadMethod(); return postLoadMethod; }