auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void startIdentifiedAtlasDbTransactionGivesUsTimestampsInSequence() { UUID requestorUuid = UUID.randomUUID(); StartIdentifiedAtlasDbTransactionResponse firstResponse = startIdentifiedAtlasDbTransaction(requestorUuid); StartIdentifiedAtlasDbTransactionResponse secondResponse = startIdentifiedAtlasDbTransaction(requestorUuid); <START> List<Long> temporalSequence = ImmutableList.of( <END> firstResponse.immutableTimestamp().getImmutableTimestamp(), firstResponse.startTimestampAndPartition().timestamp(), secondResponse.startTimestampAndPartition().timestamp()); assertThat(temporalSequence).isSorted(); }</code><technical_language>verify IT1 <= IT2 < ST2</technical_language>

Target:
public void startIdentifiedAtlasDbTransactionGivesUsTimestampsInSequence() { UUID requestorUuid = UUID.randomUUID(); StartIdentifiedAtlasDbTransactionResponse firstResponse = startIdentifiedAtlasDbTransaction(requestorUuid); StartIdentifiedAtlasDbTransactionResponse secondResponse = startIdentifiedAtlasDbTransaction(requestorUuid); assertThat(ImmutableList.of( firstResponse.immutableTimestamp().getImmutableTimestamp(), firstResponse.startTimestampAndPartition().timestamp(), secondResponse.startTimestampAndPartition().timestamp())).isSorted(); assertThat(ImmutableList.of( firstResponse.immutableTimestamp().getImmutableTimestamp(), secondResponse.immutableTimestamp().getImmutableTimestamp(), secondResponse.startTimestampAndPartition().timestamp())).isSorted(); }
Source:
<code>private void interpolate(long lo, long hi, Record mapRecord, long x1, long x2, MapValue x1Value, MapValue x2value) { computeYPoints(x1Value, x2value); for (long x = lo; x < hi; x = sampler.nextTimestamp(x)) { final MapValue result = findDataMapValue3(mapRecord, x); assert result != null && result.getByte(0) == 1; for (int i = 0; i < groupByTwoPointFunctionCount; i++) { GroupByFunction function = groupByTwoPointFunctions.getQuick(i); <START> InterpolationUtil.INTERPOLATE_GAP.interpolateGapAndStore(function, result, sampler.getBucketSize(), x1Value, x2value); <END> } for (int i = 0; i < groupByScalarFunctionCount; i++) { GroupByFunction function = groupByScalarFunctions.getQuick(i); interpolatorFunctions.getQuick(i).interpolateAndStore(function, result, x, x1, x2, yData + i * 16, yData + i * 16 + 8); } result.putByte(0, (byte) 0); } }</code><technical_language>inline</technical_language>

Target:
private void interpolate(long lo, long hi, Record mapRecord, long x1, long x2, MapValue x1Value, MapValue x2value) { computeYPoints(x1Value, x2value); for (long x = lo; x < hi; x = sampler.nextTimestamp(x)) { final MapValue result = findDataMapValue3(mapRecord, x); assert result != null && result.getByte(0) == 1; for (int i = 0; i < groupByTwoPointFunctionCount; i++) { GroupByFunction function = groupByTwoPointFunctions.getQuick(i); InterpolationUtil.interpolateGap(function, result, sampler.getBucketSize(), x1Value, x2value); } for (int i = 0; i < groupByScalarFunctionCount; i++) { GroupByFunction function = groupByScalarFunctions.getQuick(i); interpolatorFunctions.getQuick(i).interpolateAndStore(function, result, x, x1, x2, yData + i * 16, yData + i * 16 + 8); } result.putByte(0, (byte) 0); } }
Source:
<code>protected OrderedSequenceNumber<Long> createSequenceNumber(Long sequenceNumber) { <START> return null; <END> }</code><technical_language>UnsupportedOperationException</technical_language>

Target:
protected OrderedSequenceNumber<Long> createSequenceNumber(Long sequenceNumber) { throw new UnsupportedOperationException(); }
Source:
<code>public List<GitUser> getCommiters() throws GitException { <START> List<GitUser> gitUsers = new ArrayList<GitUser>(); <END> try { LogCommand logCommand = getGit().log(); for (RevCommit commit : logCommand.call()) { PersonIdent committerIdentity = commit.getCommitterIdent(); GitUser gitUser = newDto(GitUser.class).withName(committerIdentity.getName()) .withEmail(committerIdentity.getEmailAddress()); if (!gitUsers.contains(gitUser)) { gitUsers.add(gitUser); } } } catch (GitAPIException exception) { throw new GitException(exception.getMessage(), exception); } return gitUsers; }</code><technical_language>remove diamond operator</technical_language>

Target:
public List<GitUser> getCommiters() throws GitException { List<GitUser> gitUsers = new ArrayList<>(); try { LogCommand logCommand = getGit().log(); for (RevCommit commit : logCommand.call()) { PersonIdent committerIdentity = commit.getCommitterIdent(); GitUser gitUser = newDto(GitUser.class).withName(committerIdentity.getName()) .withEmail(committerIdentity.getEmailAddress()); if (!gitUsers.contains(gitUser)) { gitUsers.add(gitUser); } } } catch (GitAPIException exception) { throw new GitException(exception.getMessage(), exception); } return gitUsers; }
Source:
<code>public static Polygon parsePoints(String pointsStr, double growFactor) { String[] arr = pointsStr.split(","); <START> double[] lats = new double[arr.length /2]; <END> double[] lons = new double[arr.length /2]; for (int j = 0; j < arr.length; j++) { if (j % 2 == 0) { lats[j / 2] = Double.parseDouble(arr[j]); } else { lons[(j - 1) / 2] = Double.parseDouble(arr[j]); } } return new Polygon(lats, lons, growFactor); }</code><technical_language>@andreylh need a small length check. E.g. if arr.length%2==1 throw IllegalArgumentException("incorrect polygon specified")</technical_language>

Target:
public static Polygon parsePoints(String pointsStr, double growFactor) { String[] arr = pointsStr.split(","); if (arr.length % 2 == 1) throw new IllegalArgumentException("incorrect polygon specified"); double[] lats = new double[arr.length /2]; double[] lons = new double[arr.length /2]; for (int j = 0; j < arr.length; j++) { if (j % 2 == 0) { lats[j / 2] = Double.parseDouble(arr[j]); } else { lons[(j - 1) / 2] = Double.parseDouble(arr[j]); } } return new Polygon(lats, lons, growFactor); }
Source:
<code>protected boolean isPasswordValid(String password) { String regularExpression = this.realmConfiguration.getUserStoreProperty (LDAPServerManagerConstants.SERVICE_PASSWORD_REGEX_PROPERTY); if (regularExpression == null) { regularExpression = LDAPServerManagerConstants.DEFAULT_BE_PASSWORD_REGULAR_EXPRESSION; } log.info("Using service password format - " + regularExpression); <START> return password != null && password.length() >= 1 && <END> isFormatCorrect(regularExpression, password); }</code><technical_language>StringUtils.isNotEmpty()</technical_language>

Target:
protected boolean isPasswordValid(String password) { String regularExpression = this.realmConfiguration.getUserStoreProperty (LDAPServerManagerConstants.SERVICE_PASSWORD_REGEX_PROPERTY); if (regularExpression == null) { regularExpression = LDAPServerManagerConstants.DEFAULT_BE_PASSWORD_REGULAR_EXPRESSION; } log.info("Using service password format - " + regularExpression); return StringUtils.isNotEmpty(password) && isFormatCorrect(regularExpression, password); }
Source:
<code>private String createRererencedCompositeDebugMsg(ReferencedComposite refComposite){ StringBuilder sb = new StringBuilder(); if (refComposite == null){ <START> sb.append(" no referenced composite specified"); <END> } else { sb.append(" referenced composite '"+refComposite.getClass()+"'"); } return sb.toString(); }</code><technical_language>Please change appended text " referenced composite specified". result in "Looking active widget class type some.package.Widget referenced composite specified...."</technical_language>

Target:
private String createRererencedCompositeDebugMsg(ReferencedComposite refComposite){ StringBuilder sb = new StringBuilder(); if (refComposite == null){ sb.append(" with no referenced composite specified"); } else { sb.append(" with referenced composite "+refComposite.getClass()); } return sb.toString(); }
Source:
<code>public List<BetaDiscreteWithEventOutput> getModel(final String id) { <START> return this.models.get(id); <END> }</code><technical_language>here, a copy of list is a reference it</technical_language>

Target:
public ImmutableList<BetaDiscreteWithEventOutput> getModel(final String id) { return ImmutableList.copyOf(this.models.get(id)); }
Source:
<code>public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { { "255.255.255.255", 0xffffffffL }, { "1.1.1.1", 0x01010101 }, { "1.255.4.255", 0x01ff04ff }, { "0.128.0.7", 0x00800007 }, { "1.2.3.4", 0x01020304 }, <START> { "127.63.31.7", 0x7f3f1f07 }, <END> { "0.0.0.1", 0x00000001 }, { "1.1.1.1", 0x01010101 }, }); }</code><technical_language>In opinion, this test case is useless - verify this is valid a human eye..</technical_language>

Target:
public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { { "255.255.255.255", 0xffffffffL }, { "1.1.1.1", 0x01010101 }, { "1.255.4.255", 0x01ff04ff }, { "0.128.0.7", 0x00800007 }, { "1.2.3.4", 0x01020304 }, { "0.0.0.1", 0x00000001 }, { "1.1.1.1", 0x01010101 }, }); }
Source:
<code><START> public boolean contains(T value) { <END> PairNodes<T> pair = search(value); if (pair.R == null || pair.R.value != value) { return false; } return true; }</code><technical_language>LockFreeSetImpl<String> lfs = new LockFreeSetImpl<>(); lfs.add(new String("one")); System.out.println(lfs.contains("one")); ==> false</technical_language>

Target:
public boolean contains(T value) { Node<T> current = head.next.getReference(); while(current != null && !current.value.equals(value)) { current = current.next.getReference(); } return current != null && !current.next.isMarked() && current.value.compareTo(value) == 0; }
Source:
<code>public static List<HaxeNamedComponent> getAllNamedSubComponentsFromClassType(HaxeClass haxeClass, HaxeComponentType... fromTypes) { List<HaxeNamedComponent> components = getNamedSubComponents(haxeClass); List<HaxeComponentType> types = Arrays.asList(fromTypes); HaxeComponentType type = HaxeComponentType.typeOf(haxeClass); if (types.contains(type)) { components.addAll(getNamedSubComponents(haxeClass)); } <START> PsiClass[] supers = haxeClass.getSupers(); for (PsiClass superComponent : supers) { type = HaxeComponentType.typeOf(superComponent); if (types.contains(type)) { components.addAll(getNamedSubComponents((HaxeClass)superComponent)); } } <END> return components; }</code><technical_language>duplicating this loop (which level in hierarchy), recursive</technical_language>

Target:
public static List<HaxeNamedComponent> getAllNamedSubComponentsFromClassType(HaxeClass haxeClass, HaxeComponentType... fromTypes) { List<HaxeNamedComponent> components = getNamedSubComponents(haxeClass); List<HaxeComponentType> types = Arrays.asList(fromTypes); components.addAll(Stream.of(haxeClass.getSupers()) .filter(superComponent -> types.contains(HaxeComponentType.typeOf(superComponent))) .map(superComponent -> getAllNamedSubComponentsFromClassType((HaxeClass)superComponent, fromTypes)) .flatMap(Collection::stream) .collect(Collectors.toList())); if (types.contains(HaxeComponentType.typeOf(haxeClass))) { components.addAll(getNamedSubComponents(haxeClass)); } return components; }
Source:
<code>public void sum(Vector vector) { <START> this.entryX += vector.entryX; <END> this.entryY += vector.entryY; }</code><technical_language>I suggest vector's getter methods get entryX entryY properties</technical_language>

Target:
public void sum(Vector vector) { this.entryX += vector.getX(); this.entryY += vector.getY(); }
Source:
<code><START> public OAuth2ResourceServerConfigurer<B> resourceServer() throws Exception { <END> if (this.resourceServerConfigurer == null) { this.initResourceServerConfigurer(); } return this.resourceServerConfigurer; }</code><technical_language>Remove throws Exception thrown</technical_language>

Target:
public OAuth2ResourceServerConfigurer<B> resourceServer() { if (this.resourceServerConfigurer == null) { this.initResourceServerConfigurer(); } return this.resourceServerConfigurer; }
Source:
<code>public HeaderBearerTokenResolver(String header) { <START> Assert.notNull(header, "header cannot be null"); <END> Assert.hasText(header, "header cannot be empty"); this.header = header; }</code><technical_language>Is a need asserts? reason prefer is I want user get error, fix it, get another. nonNull is implied hasText, give user error message repair problems</technical_language>

Target:
public HeaderBearerTokenResolver(String header) { Assert.hasText(header, "header cannot be empty"); this.header = header; }
Source:
<code>public static void main(String... args) throws IOException, ClassNotFoundException { try (Ignite ignite = Ignition.start("examples/config/example-ignite-ml.xml")) { System.out.println(">>> Ignite grid started."); ModelStorage storage = ModelStorageFactory.getModelStorage(ignite); ModelDescriptorStorage descStorage = ModelDescriptorStorageFactory.getModelDescriptorStorage(ignite); System.out.println("Saving model into model storage..."); byte[] mdl = serialize((IgniteFunction<byte[], byte[]>)i -> i); storage.mkdirs("/"); storage.putFile("/my_model", mdl); System.out.println("Saving model descriptor into model descriptor storage..."); ModelDescriptor desc = new ModelDescriptor( "MyModel", "My Cool Model", new ModelSignature("", "", ""), <START> new ModelStorageInfModelReader("/my_model"), <END> new IgniteFunctionInfModelParser<>() ); descStorage.put("my_model", desc); System.out.println("List saved models..."); for (IgniteBiTuple<String, ModelDescriptor> model : descStorage) System.out.println("-> {'" + model.getKey() + "' : " + model.getValue() + "}"); System.out.println("Load saved model descriptor..."); desc = descStorage.get("my_model"); System.out.println("Build inference model..."); SingleInfModelBuilder mdlBuilder = new SingleInfModelBuilder(); try (InfModel<byte[], byte[]> infMdl = mdlBuilder.build(desc.getReader(), desc.getParser())) { System.out.println("Make inference..."); for (int i = 0; i < 10; i++) { Integer res = deserialize(infMdl.predict(serialize(i))); System.out.println(i + " -> " + res); } } } }</code><technical_language>InfModelReaderOnModelStorage</technical_language>

Target:
public static void main(String... args) throws IOException, ClassNotFoundException { try (Ignite ignite = Ignition.start("examples/config/example-ignite-ml.xml")) { System.out.println(">>> Ignite grid started."); ModelStorage storage = new ModelStorageFactory().getModelStorage(ignite); ModelDescriptorStorage descStorage = new ModelDescriptorStorageFactory().getModelDescriptorStorage(ignite); System.out.println("Saving model into model storage..."); byte[] mdl = serialize((IgniteFunction<byte[], byte[]>)i -> i); storage.mkdirs("/"); storage.putFile("/my_model", mdl); System.out.println("Saving model descriptor into model descriptor storage..."); ModelDescriptor desc = new ModelDescriptor( "MyModel", "My Cool Model", new ModelSignature("", "", ""), new ModelStorageInfModelReader("/my_model"), new IgniteFunctionInfModelParser<>() ); descStorage.put("my_model", desc); System.out.println("List saved models..."); for (IgniteBiTuple<String, ModelDescriptor> model : descStorage) System.out.println("-> {'" + model.getKey() + "' : " + model.getValue() + "}"); System.out.println("Load saved model descriptor..."); desc = descStorage.get("my_model"); System.out.println("Build inference model..."); SingleInfModelBuilder mdlBuilder = new SingleInfModelBuilder(); try (InfModel<byte[], byte[]> infMdl = mdlBuilder.build(desc.getReader(), desc.getParser())) { System.out.println("Make inference..."); for (int i = 0; i < 10; i++) { Integer res = deserialize(infMdl.predict(serialize(i))); System.out.println(i + " -> " + res); } } } }
Source:
<code>public boolean txnCommitContainsAll(List<Data> data) { for (Data datum : data) { <START> if (getItemQueue().stream().noneMatch(item -> datum.equals(item.getData()))) { <END> return false; } } return true; }</code><technical_language>cache getItemQueue().stream()</technical_language>

Target:
public boolean txnCommitContainsAll(List<Data> data) { for (Data datum : data) { if (itemQueueContains(datum)) { return false; } } return true; }
Source:
<code>public void performAlign(int offset, int width) { int plotAreaOffset = fXYViewer.getPointAreaOffset(); int sashOffset = Math.max(1, offset - plotAreaOffset); int total = fSashForm.getBounds().width; int width1 = (int) (sashOffset / (float) total * 1000); int width2 = (int) ((total - sashOffset) / (float) total * 1000); fSashForm.setWeights(new int[] { width1, width2 }); <START> fSashForm.layout(); <END> }</code><technical_language>need calculate righ margin account for width</technical_language>

Target:
public void performAlign(int offset, int width) { int plotAreaOffset = fXYViewer.getPointAreaOffset(); int sashOffset = Math.max(1, offset - plotAreaOffset); int total = fSashForm.getBounds().width; int width1 = (int) (sashOffset / (float) total * 1000); int width2 = (int) ((total - sashOffset) / (float) total * 1000); fSashForm.setWeights(new int[] { width1, width2 }); fSashForm.layout(); Composite composite = fXYViewerContainer; GridLayout layout = (GridLayout) composite.getLayout(); int timeAxisWidth = getAvailableWidth(offset); int marginSize = timeAxisWidth - width; layout.marginRight = Math.max(0, marginSize); composite.layout(); }
Source:
<code>private static void questionableMethodsAllowedToBlock(BlockHound.Builder builder) { builder.allowBlockingCallsInside(BasicComponentRegistryImpl.class.getName(), "prepareWrapperChange"); builder.allowBlockingCallsInside(BasicComponentRegistryImpl.class.getName(), "awaitWrapperState"); builder.allowBlockingCallsInside(JGroupsTransport.class.getName(), "sendCommand"); <START> builder.allowBlockingCallsInside(JGroupsTransport.class.getName(), "sendResponse"); <END> builder.allowBlockingCallsInside(ClusterTopologyManagerImpl.class.getName(), "prepareJoin"); builder.allowBlockingCallsInside(ClusterTopologyManagerImpl.class.getName(), "updateClusterState"); }</code><technical_language>Do need add individual JGroups protocol methods well, if 2, JChannel#send</technical_language>

Target:
private static void questionableMethodsAllowedToBlock(BlockHound.Builder builder) { builder.allowBlockingCallsInside(BasicComponentRegistryImpl.class.getName(), "prepareWrapperChange"); builder.allowBlockingCallsInside(BasicComponentRegistryImpl.class.getName(), "awaitWrapperState"); builder.allowBlockingCallsInside(ClusterTopologyManagerImpl.class.getName(), "prepareJoin"); builder.allowBlockingCallsInside(ClusterTopologyManagerImpl.class.getName(), "updateClusterState"); }
Source:
<code>public Message<?> preSend(Message<?> message, MessageChannel channel) { Message<?> sentMessage = null; if (this.klazz.isAssignableFrom(message.getPayload().getClass())) { Object contentTypeFromMessage = message.getHeaders().get(MessageHeaders.CONTENT_TYPE); if (contentTypeFromMessage == null) { sentMessage = MessageConverterConfigurer.this.messageBuilderFactory .fromMessage(message) .setHeader(MessageHeaders.CONTENT_TYPE, this.contentType) .build(); } else { sentMessage = message; } } else { Object converted = this.input ? this.messageConverter.fromMessage(message, this.klazz) : this.messageConverter.toMessage(message.getPayload(), message.getHeaders(), null); if (converted != null) { <START> Message<?> convertedMessage = (Message<?>) converted; <END> Object contentType = convertedMessage.getHeaders().get(MessageHeaders.CONTENT_TYPE); if (contentType instanceof MimeType) { sentMessage = MessageConverterConfigurer.this.messageBuilderFactory .fromMessage(convertedMessage).setHeader( MessageHeaders.CONTENT_TYPE, contentType.toString()).build(); } else { sentMessage = convertedMessage; } } } if (sentMessage != null) { return sentMessage; } else { throw new MessageConversionException("Cannot convert " + message + " to " + this.contentType); } }</code><technical_language>this fail fromMessage calls</technical_language>

Target:
public Message<?> preSend(Message<?> message, MessageChannel channel) { Message<?> sentMessage = null; if (this.klazz.isAssignableFrom(message.getPayload().getClass())) { Object contentTypeFromMessage = message.getHeaders().get(MessageHeaders.CONTENT_TYPE); if (contentTypeFromMessage == null) { sentMessage = MessageConverterConfigurer.this.messageBuilderFactory .fromMessage(message) .setHeader(MessageHeaders.CONTENT_TYPE, this.contentType) .build(); } else { sentMessage = message; } } else { Object converted = this.input ? this.messageConverter.fromMessage(message, this.klazz) : this.messageConverter.toMessage(message.getPayload(), message.getHeaders()); if (converted instanceof Message) { sentMessage = (Message<?>) converted; } else { sentMessage = MessageConverterConfigurer.this.messageBuilderFactory.withPayload(converted) .copyHeaders(message.getHeaders()).setHeaderIfAbsent(MessageHeaders.CONTENT_TYPE, this.mimeType).build(); } } if (sentMessage == null) { throw new MessageConversionException("Cannot convert " + message + " to " + this.contentType); } return sentMessage; }
Source:
<code>private void freezeVm() { <START> if (!isLiveSnapshotApplicable() || !isCinderDisksExist()) { <END> return; } VDSReturnValue returnValue; try { returnValue = runVdsCommand(VDSCommandType.Freeze, new VdsAndVmIDVDSParametersBase(getVds().getId(), getVmId())); } catch (EngineException e) { handleFreezeVmFailure(e); return; } if (!returnValue.getSucceeded()) { handleFreezeVmFailure(new EngineException(EngineError.freezeErr)); } }</code><technical_language>Please considert moving this line 238, change this positive condition</technical_language>

Target:
private void freezeVm() { if (!shouldFreezeVm()) { return; } VDSReturnValue returnValue; try { returnValue = runVdsCommand(VDSCommandType.Freeze, new VdsAndVmIDVDSParametersBase(getVds().getId(), getVmId())); } catch (EngineException e) { handleFreezeVmFailure(e); return; } if (!returnValue.getSucceeded()) { handleFreezeVmFailure(new EngineException(EngineError.freezeErr)); } else { auditLogDirector.log(this, AuditLogType.FREEZE_VM_SUCCESS); } }
Source:
<code>public static void main(String[] args) { <START> new SpringApplicationBuilder().sources(SchedulerTaskLauncherApplication.class).bannerMode(Banner.Mode.OFF).run(args); <END> }</code><technical_language>I new apps put spring.main.banner-mode in application.yml want put other stuff logging settings, etc</technical_language>

Target:
public static void main(String[] args) { new SpringApplicationBuilder().sources(SchedulerTaskLauncherApplication.class).run(args); }
Source:
<code>public CompletableFuture<Collection<LogInfo>> requestLogList(Time timeout) { return CompletableFuture.supplyAsync(() -> { final String logDir = taskManagerConfiguration.getTaskManagerLogDir(); if (logDir != null) { final File[] logFiles = new File(logDir).listFiles(); if (logFiles == null) { throw new CompletionException(new FlinkException(String.format("There isn't a log file in TaskExecutor’s log dir %s.", logDir))); } return Arrays.stream(logFiles) .filter(File::isFile) .map(logFile -> new LogInfo(logFile.getName(), logFile.length())) .collect(Collectors.toList()); } return Collections.emptyList(); <START> }, taskExecutorServices.getIOExecutor()); <END> }</code><technical_language>I declare a field initialize in constructor: /** kvState registration service in task manager. */ private final KvStateService kvStateService; private final Executor ioExecutor; // --------- job manager connections ----------- this.kvStateService = taskExecutorServices.getKvStateService(); this.ioExecutor = taskExecutorServices.getIOExecutor(); this.resourceManagerLeaderRetriever = haServices.getResourceManagerLeaderRetriever();</technical_language>

Target:
public CompletableFuture<Collection<LogInfo>> requestLogList(Time timeout) { return CompletableFuture.supplyAsync(() -> { final String logDir = taskManagerConfiguration.getTaskManagerLogDir(); if (logDir != null) { final File[] logFiles = new File(logDir).listFiles(); if (logFiles == null) { throw new CompletionException(new FlinkException(String.format("There isn't a log file in TaskExecutor’s log dir %s.", logDir))); } return Arrays.stream(logFiles) .filter(File::isFile) .map(logFile -> new LogInfo(logFile.getName(), logFile.length())) .collect(Collectors.toList()); } return Collections.emptyList(); }, ioExecutor); }
Source:
<code>public Map<String, String> retrieveKeycloakAttributes() throws ServerException { Map<String, String> keycloakUserAttributes; try { keycloakUserAttributes = <START> requestFactory.fromUrl(keyclockCurrentUserInfoUrl).request().asProperties(); <END> } catch (IOException | ApiException e) { LOG.warn("Exception during retrieval of the Keycloak user profile", e); throw new ServerException("Exception during retrieval of the Keycloak user profile", e); } return keycloakUserAttributes; }</code><technical_language>write return instead of saving a local variable return of try block</technical_language>

Target:
public Map<String, String> retrieveKeycloakAttributes() throws ServerException { try { return requestFactory.fromUrl(keyclockCurrentUserInfoUrl).request().asProperties(); } catch (IOException | ApiException e) { LOG.warn("Exception during retrieval of the Keycloak user profile", e); throw new ServerException("Exception during retrieval of the Keycloak user profile", e); } }
Source:
<code>public Message<?> receive(long timeout) { try { if (this.receiveTimeout < 0) { this.latch.await(); } else { if (!this.latch.await(this.receiveTimeout, TimeUnit.MILLISECONDS)) { this.clientTimedOut = true; } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } <START> this.clientHasReceived = true; <END> return this.message; }</code><technical_language>this set if latch.await returned true? in current impl I a difference clientTimedOut is checked prior clientHasReceived in if/else below, order a fragile assumption</technical_language>

Target:
public Message<?> receive(long timeout) { try { if (this.receiveTimeout < 0) { this.latch.await(); this.clientHasReceived = true; } else { if (this.latch.await(this.receiveTimeout, TimeUnit.MILLISECONDS)) { this.clientHasReceived = true; } else { this.clientTimedOut = true; } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } return this.message; }
Source:
<code>public void testRestartedRM() throws Exception { MiniYARNCluster cluster = new MiniYARNCluster( "testRestartedRMNegative", NODE_MANAGER_COUNT, 1, 1); <START> YarnClient rmClient = YarnClient.createYarnClient(); <END> try { cluster.init(conf); cluster.start(); final Configuration yarnConf = cluster.getConfig(); rmClient = YarnClient.createYarnClient(); rmClient.init(yarnConf); rmClient.start(); List<NodeReport> nodeReports = rmClient.getNodeReports(); Assert.assertEquals( "The proxy didn't get expected number of node reports", NODE_MANAGER_COUNT, nodeReports.size()); } finally { if (rmClient != null) { rmClient.stop(); } cluster.stop(); } }</code><technical_language>put inits try</technical_language>

Target:
public void testRestartedRM() throws Exception { MiniYARNCluster cluster = new MiniYARNCluster("testRestartedRMNegative", NUMNODEMANAGERS, 1, 1); YarnClient rmClient = YarnClient.createYarnClient(); try { cluster.init(conf); cluster.start(); final Configuration yarnConf = cluster.getConfig(); rmClient = YarnClient.createYarnClient(); rmClient.init(yarnConf); rmClient.start(); List <NodeReport> nodeReports = rmClient.getNodeReports(); assertEquals( "The proxy didn't get expected number of node reports", NUMNODEMANAGERS, nodeReports.size()); } finally { if (rmClient != null) { rmClient.stop(); } cluster.stop(); } }
Source:
<code>public void reportAsHeaders(HttpServletResponse rsp) { rsp.addHeader("X-You-Are-Authenticated-As",authentication.getName()); <START> GrantedAuthority[] authorities = authentication.getAuthorities(); <END> for (int i = 0; i < authorities.length; i++) { if (i == MAX_REPORTED_AUTHORITIES) { rsp.addHeader("X-You-Are-In-Group", "<" + (authorities.length - i) + " more>"); break; } else { rsp.addHeader("X-You-Are-In-Group", authorities[i].getAuthority()); } } rsp.addHeader("X-Required-Permission", permission.getId()); for (Permission p=permission.impliedBy; p!=null; p=p.impliedBy) { rsp.addHeader("X-Permission-Implied-By", p.getId()); } }</code><technical_language>do need report this is a whoAmI reports this in a nicer (and users check headers, scripts action)</technical_language>

Target:
public void reportAsHeaders(HttpServletResponse rsp) { rsp.addHeader("X-You-Are-Authenticated-As",authentication.getName()); if (REPORT_GROUP_HEADERS) { for (GrantedAuthority auth : authentication.getAuthorities()) { rsp.addHeader("X-You-Are-In-Group",auth.getAuthority()); } } else { rsp.addHeader("X-You-Are-In-Group-Disabled", "JENKINS-39402: use -Dhudson.security.AccessDeniedException2.REPORT_GROUP_HEADERS=true or use /whoAmI to diagnose"); } rsp.addHeader("X-Required-Permission", permission.getId()); for (Permission p=permission.impliedBy; p!=null; p=p.impliedBy) { rsp.addHeader("X-Permission-Implied-By", p.getId()); } }
Source:
<code>public void shouldConvertToHashMap() { final Function<Integer, Integer> keyMapper = i -> AbstractMapTest.md5(Integer.toString(i) + " unique line value").hashCode(); final Value<Integer> value = of(9, 5, 1); Map<Integer, Integer> map = value.toMap(v -> Tuple.of(keyMapper.apply(v), v)); if (value.isSingleValued()) { map = map.put(keyMapper.apply(5), 5).put(keyMapper.apply(1), 1); } assertThat(map.mkString(", ")).isEqualTo( "(110427681, 5), " + <START> "(663160547, 1), " + <END> "(1571254982, 9)"); }</code><technical_language>splitting string reappending it? Consider putting operator in front more obvious (and format better). ... simply java assertThat(map.mkString(", ")) .isEqualTo("(110427681, 5), (663160547, 1), (1571254982, 9)");</technical_language>

Target:
public void shouldConvertToHashMap() { final Value<Integer> value = of(9, 5, 1); final Map<Integer, Integer> map = value.toMap(i -> Tuple.of(i, i)); if (value.isSingleValued()) { assertThat(map).isEqualTo(HashMap.of(9, 9)); } else { assertThat(map).isEqualTo(HashMap.of(1, 1, 5, 5, 9, 9)); } }
Source:
<code>public static Filter fromOldFormat( String includeDatabases, String excludeDatabases, String includeTables, String excludeTables, String blacklistDatabases, String blacklistTables, String includeValues ) throws InvalidFilterException { ArrayList<String> filterRules = new ArrayList<>(); if ( blacklistDatabases != null ) { for ( String s : blacklistDatabases.split(",") ) filterRules.add("blacklist: " + s + ".*"); } if ( blacklistTables != null ) { for (String s : blacklistTables.split(",")) filterRules.add("blacklist: *." + s); } if ( includeDatabases != null || includeTables != null ) { filterRules.add("exclude: *.*"); } if ( includeDatabases != null ) { for ( String s : includeDatabases.split(",") ) filterRules.add("include: " + s + ".*"); } if ( excludeDatabases != null ) { <START> for (String s : includeDatabases.split(",")) <END> filterRules.add("exclude: " + s + ".*"); } if ( includeTables != null ) { for ( String s : includeTables.split(",") ) filterRules.add("include: *." + s); } if ( excludeTables != null ) { for ( String s : excludeTables.split(",") ) filterRules.add("exclude: *." + s); } return new Filter(String.join(", ", filterRules), includeValues); }</code><technical_language>excludeDatabases</technical_language>

Target:
public static Filter fromOldFormat( String includeDatabases, String excludeDatabases, String includeTables, String excludeTables, String blacklistDatabases, String blacklistTables, String includeValues ) throws InvalidFilterException { ArrayList<String> filterRules = new ArrayList<>(); if ( blacklistDatabases != null ) { for ( String s : blacklistDatabases.split(",") ) filterRules.add("blacklist: " + s + ".*"); } if ( blacklistTables != null ) { for (String s : blacklistTables.split(",")) filterRules.add("blacklist: *." + s); } if ( includeDatabases != null || includeTables != null ) { filterRules.add("exclude: *.*"); } if ( includeDatabases != null ) { for ( String s : includeDatabases.split(",") ) filterRules.add("include: " + s + ".*"); } if ( excludeDatabases != null ) { for (String s : excludeDatabases.split(",")) filterRules.add("exclude: " + s + ".*"); } if ( includeTables != null ) { for ( String s : includeTables.split(",") ) filterRules.add("include: *." + s); } if ( excludeTables != null ) { for ( String s : excludeTables.split(",") ) filterRules.add("exclude: *." + s); } if (includeValues != null && !"".equals(includeValues)) { for (String s : includeValues.split(",")) { String[] columnAndValue = s.split("="); filterRules.add("exclude: *.*." + columnAndValue[0] + "=*"); filterRules.add("include: *.*." + columnAndValue[0] + "=" + columnAndValue[1]); } } String filterRulesAsString = String.join(", ", filterRules); LOGGER.warn("using exclude/include/includeColumns is deprecated. Please update your configuration to use: "); LOGGER.warn("filter = \"" + filterRulesAsString + "\""); return new Filter(filterRulesAsString); }
Source:
<code>private static String computeIntervalPattern(Map<String, String> prefsMap) { String ssecFmt = computeSubSecFormat(prefsMap); <START> return "TTT." + ssecFmt; END> }</code><technical_language>TIME_ELAPSED_FMT + '.' + ssecFmt; in case change defines some point</technical_language>

Target:
private static String computeIntervalPattern(Map<String, String> prefsMap) { String ssecFmt = computeSubSecFormat(prefsMap); return ITmfTimePreferencesConstants.TIME_ELAPSED_FMT + "." + ssecFmt; }
Source:
<code>public List<Target> getTargets() { if (hasTargets()) { return targets; } else { <START> return new ArrayList<>(); <END> } }</code><technical_language>Empty targets exist. IMO, return null enough</technical_language>

Target:
public List<Target> getTargets() { if (hasTargets()) { return targets; } else { return null; } }
Source:
<code>public void run() throws IOException { try { if (readyForRead()) { final int maxRead = m_handler.getMaxRead(); if (maxRead > 0) { fillReadStream(maxRead); } int read; while (true) { if (m_nextFrameLength == 0) { if (readStream().dataAvailable() >= 5) { read = readStream().getBytes(m_frameHeader); m_frameHeader.flip(); m_frameHeader.position(3); <START> m_frameHeader.get(m_twoBytes); <END> m_nextFrameLength = ((m_twoBytes[0] & 0xff) << 8) | (m_twoBytes[1] & 0xff); } else { break; } } if (readStream().dataAvailable() >= m_nextFrameLength) { DBBPool.BBContainer frameCont = DBBPool.allocateDirectAndPool(m_nextFrameLength + 5); ByteBuffer frame = frameCont.b(); frame.limit(m_nextFrameLength + 5); m_frameHeader.flip(); frame.put(m_frameHeader); m_frameHeader.clear(); readStream().getBytes(frame); m_callables.add(new DecryptionCallable(frameCont)); m_nextFrameLength = 0; } else { break; } } Callable c = m_callables.poll(); if (c != null) { Future<List<ByteBuffer>> f = SSLEncryptionService.instance().submit(c); List<ByteBuffer> messages; while (f != null) { try { messages = f.get(); c = m_callables.poll(); f = null; if (c != null) { f = SSLEncryptionService.instance().submit(c); } for (ByteBuffer message : messages) { m_handler.handleMessage(message, this); m_messagesRead++; } } catch (InterruptedException e) { return; } catch (ExecutionException e) { throw new IOException(e); } } } } drainWriteStream(); } finally { synchronized (m_lock) { assert (m_running == true); m_running = false; } } }</code><technical_language>reason getShort</technical_language>

Target:
public void run() throws IOException { try { if (m_isShuttingDown) { unregistered(); return; } processReads(); handleDecryptedMessages(); processWrites(); handleEncryptedBuffers(); writeStream().checkBackpressureEnded(); cleanup(); } catch (IOException ioe) { networkLog.error("Exception in SSLVoltPort.run", ioe); throw ioe; } finally { synchronized (m_lock) { assert (m_running == true); m_running = false; } } }
Source:
<code>private NetworkAttachment createAttachmentWhenAttachingTo(VdsNetworkInterface targetNic) { NetworkAttachment networkAttachment = new NetworkAttachment(targetNic, networkModel.getNetwork(), NetworkCommonUtils.createDefaultIpConfiguration()); NetworkParameters netParams = networkModel.getSetupModel().getNetworkToLastDetachParams().get(networkModel.getName()); if (netParams != null) { applyOnAttachmentParamsFrom(netParams, networkAttachment); } else { VdsNetworkInterface nicToTakeParamsFrom = null; if (networkModel.hasVlan()) { nicToTakeParamsFrom = getPotentialVlanDevice(targetNic); } else { nicToTakeParamsFrom = targetNic; } if (nicToTakeParamsFrom != null && <START> nicToTakeParamsFrom.getId() != null) { <END> applyOnAttachmentParamsFrom(new InterfacePropertiesAccessor.FromNic(nicToTakeParamsFrom), networkAttachment); } fixBootProtocolOfMgmtNetworkIfNeeded(networkAttachment); } return networkAttachment; }</code><technical_language>why? I understand this change in relation commit description. elaborate more? extract this added condition variable explaining, id null (since ID of applyOnAttachmentParamsFrom)</technical_language>

Target:
private NetworkAttachment createAttachmentWhenAttachingTo(VdsNetworkInterface targetNic) { NetworkAttachment networkAttachment = new NetworkAttachment(targetNic, networkModel.getNetwork(), NetworkCommonUtils.createDefaultIpConfiguration()); NetworkParameters netParams = networkModel.getSetupModel().getNetworkToLastDetachParams().get(networkModel.getName()); if (netParams != null) { applyOnAttachmentParamsFrom(netParams, networkAttachment); } else { VdsNetworkInterface nicToTakeParamsFrom = null; if (networkModel.hasVlan()) { nicToTakeParamsFrom = getPotentialVlanDevice(targetNic); } else { nicToTakeParamsFrom = targetNic; } boolean newlyCreatedBond = nicToTakeParamsFrom != null && nicToTakeParamsFrom.getId() == null; if (nicToTakeParamsFrom != null && !newlyCreatedBond) { applyOnAttachmentParamsFrom(new InterfacePropertiesAccessor.FromNic(nicToTakeParamsFrom), networkAttachment); } fixBootProtocolOfMgmtNetworkIfNeeded(networkAttachment); } return networkAttachment; }
Source:
<code><START> public BaseRuleTest(Plugin...plugins) <END> { this.plugins = plugins; }</code><technical_language>fmt (there ...)</technical_language>

Target:
public BaseRuleTest(Plugin... plugins) { this.plugins = ImmutableList.copyOf(plugins); }
Source:
<code>private static void writeBinaryCheckpoints(TreeMap<Integer, StoredBlock> checkpoints, File file) throws Exception { try (FileOutputStream fileOutputStream = new FileOutputStream(file, false)) { <START> MessageDigest digest = Sha256Hash.newDigest(); <END> try ( DigestOutputStream digestOutputStream = new DigestOutputStream(fileOutputStream, digest); DataOutputStream dataOutputStream = new DataOutputStream(digestOutputStream) ) { digestOutputStream.on(false); dataOutputStream.writeBytes("CHECKPOINTS 1"); dataOutputStream.writeInt(0); digestOutputStream.on(true); dataOutputStream.writeInt(checkpoints.size()); ByteBuffer buffer = ByteBuffer.allocate(StoredBlock.COMPACT_SERIALIZED_SIZE); for (StoredBlock block : checkpoints.values()) { block.serializeCompact(buffer); dataOutputStream.write(buffer.array()); buffer.position(0); } Sha256Hash checkpointsHash = Sha256Hash.wrap(digest.digest()); System.out.println("Hash of checkpoints data is " + checkpointsHash); System.out.println("Checkpoints written to '" + file.getCanonicalPath() + "'."); } } }</code><technical_language>I if move this line try block, try blocks merged one. I overlooking something</technical_language>

Target:
private static void writeBinaryCheckpoints(TreeMap<Integer, StoredBlock> checkpoints, File file) throws Exception { MessageDigest digest = Sha256Hash.newDigest(); try ( FileOutputStream fileOutputStream = new FileOutputStream(file, false); DigestOutputStream digestOutputStream = new DigestOutputStream(fileOutputStream, digest); DataOutputStream dataOutputStream = new DataOutputStream(digestOutputStream) ) { digestOutputStream.on(false); dataOutputStream.writeBytes("CHECKPOINTS 1"); dataOutputStream.writeInt(0); digestOutputStream.on(true); dataOutputStream.writeInt(checkpoints.size()); ByteBuffer buffer = ByteBuffer.allocate(StoredBlock.COMPACT_SERIALIZED_SIZE); for (StoredBlock block : checkpoints.values()) { block.serializeCompact(buffer); dataOutputStream.write(buffer.array()); buffer.position(0); } Sha256Hash checkpointsHash = Sha256Hash.wrap(digest.digest()); System.out.println("Hash of checkpoints data is " + checkpointsHash); System.out.println("Checkpoints written to '" + file.getCanonicalPath() + "'."); } }
Source:
<code>protected TileEntityBeacon createVirtualTile() { return new TileEntityBeacon() { @Override public boolean isUseableByPlayer(EntityPlayer player) { <START> return player == SpongeBeaconWindow.this.player; <END> } }; }</code><technical_language>a comparison equals instead of a reference equals</technical_language>

Target:
protected TileEntityBeacon createVirtualTile() { return new TileEntityBeacon() { @Override public boolean isUseableByPlayer(EntityPlayer player) { return SpongeBeaconWindow.this.players.contains(player); } }; }
Source:
<code>public CtfTmfLightweightContext(ArrayList<CtfIterator> iters, ListIterator<CtfIterator> pos) { fIteratorPool = iters; <START> fCurrentIterator = pos; <END> fTrace = iters.get(0).getCtfTmfTrace(); curLocation = new CtfLocation((Long)null); collisions = 0; }</code><technical_language>remove fields if used. call other constructor with: this(iters.get(0).getCtfTmfTrace());</technical_language>

Target:
public CtfTmfLightweightContext(ArrayList<CtfIterator> iters, ListIterator<CtfIterator> pos) { fTrace = iters.get(0).getCtfTmfTrace(); curLocation = new CtfLocation((Long) null); }
Source:
<code>private boolean hasSuspendedVms() { List<VM> vmList = vmDao.getAllForStoragePool(getOldStoragePool().getId()); String suspendedVms = vmList.stream() .filter(vm -> vm.getStatus().isSuspended()) <START> .filter(vm <END> -> getStoragePool().getCompatibilityVersion().compareTo(vm.getCustomCompatibilityVersion()) > 0) .map(VM::getName) .collect(Collectors.joining(", ")); if (!suspendedVms.isEmpty()) { return failValidation( EngineMessage.ERROR_CANNOT_UPDATE_STORAGE_POOL_SUSPENDED_VM_COMPATIBILITY_VERSION_NOT_SUPPORTED, String.format("$VmsList %1$s", suspendedVms)); } return true; }</code><technical_language>consolidate filters, operate object</technical_language>

Target:
private boolean hasSuspendedVms() { List<VM> vmList = vmDao.getAllForStoragePool(getOldStoragePool().getId()); String suspendedVms = vmList.stream() .filter(vm -> vm.getStatus().isSuspended() && getStoragePool().getCompatibilityVersion().compareTo(vm.getCustomCompatibilityVersion()) > 0) .map(VM::getName) .collect(Collectors.joining(", ")); if (!suspendedVms.isEmpty()) { addValidationMessage(EngineMessage.ERROR_CANNOT_UPDATE_STORAGE_POOL_SUSPENDED_VM_COMPATIBILITY_VERSION_NOT_SUPPORTED); addValidationMessageVariable("VmsList", suspendedVms); return true; } return false; }
Source:
<code>private static void buildMenu(ModelItem curModelItem, String menuName, SoapUITreeNode path) { String[] groupsId = {SoapUI.STEP, SoapUI.CASE, SoapUI.SUITE, SoapUI.PROJECT}; if (curModelItem instanceof Workspace) { for (String groupId : groupsId) { activateMenuItems(groupId, false); } } else if (ModelSupport.isOneOf(curModelItem, WsdlTestSuite.class, WsdlTestCase.class, WsdlTestStep.class, WsdlProject.class)) { ActionList actionList = ActionListBuilder.buildActions(curModelItem); JMenu curMenu = MenuBuilderHelper.getMenu(menuName); curMenu.removeAll(); ActionSupport.addActions(actionList, curMenu); for (String groupId : groupsId) { if (groupId.equals(menuName)) { break; } activateMenuItems(groupId, false); } while (!(curModelItem.getParent() instanceof Workspace)) { curModelItem = curModelItem.getParent(); ActionList parentActionList = ActionListBuilder.buildActions(curModelItem); JMenu parentMenu = MenuBuilderHelper.getMenu(getMenuNameForModelItem(curModelItem)); parentMenu.removeAll(); ActionSupport.addActions(parentActionList, parentMenu); activateMenuItems(getMenuNameForModelItem(curModelItem), true); } } else { SoapUITreeNode node = path.getParentTreeNode(); curModelItem = node.getModelItem(); while (!(curModelItem instanceof Workspace)) { if (curModelItem instanceof WsdlTestCase) { buildMenu(curModelItem, SoapUI.CASE, null); break; } <START> if (curModelItem instanceof WsdlProject) { <END> buildMenu(curModelItem, SoapUI.PROJECT, null); break; } node = node.getParentTreeNode(); curModelItem = node.getModelItem(); } } }</code><technical_language>if...else...if is more understand</technical_language>

Target:
private static void buildMenu(ModelItem curModelItem, String menuName, SoapUITreeNode path) { String[] groupsId = {SoapUI.STEP, SoapUI.CASE, SoapUI.SUITE, SoapUI.PROJECT}; if (curModelItem instanceof Workspace) { for (String groupId : groupsId) { activateMenuItems(groupId, false); } } else if (ModelSupport.isOneOf(curModelItem, WsdlTestSuite.class, WsdlTestCase.class, WsdlTestStep.class, WsdlProject.class)) { ActionList actionList = ActionListBuilder.buildActions(curModelItem); JMenu curMenu = MenuBuilderHelper.getMenu(menuName); curMenu.removeAll(); ActionSupport.addActions(actionList, curMenu); for (String groupId : groupsId) { if (groupId.equals(menuName)) { break; } activateMenuItems(groupId, false); } while (!(curModelItem.getParent() instanceof Workspace)) { curModelItem = curModelItem.getParent(); ActionList parentActionList = ActionListBuilder.buildActions(curModelItem); JMenu parentMenu = MenuBuilderHelper.getMenu(getMenuNameForModelItem(curModelItem)); parentMenu.removeAll(); ActionSupport.addActions(parentActionList, parentMenu); activateMenuItems(getMenuNameForModelItem(curModelItem), true); } } else { SoapUITreeNode node = path.getParentTreeNode(); curModelItem = node.getModelItem(); while (!(curModelItem instanceof Workspace)) { if (curModelItem instanceof WsdlTestCase) { buildMenu(curModelItem, SoapUI.CASE, null); break; } else if (curModelItem instanceof WsdlProject) { buildMenu(curModelItem, SoapUI.PROJECT, null); break; } node = node.getParentTreeNode(); curModelItem = node.getModelItem(); } } }
Source:
<code>public void addBackgroundPage(final ScenarioGridWidget scenarioGridWidget) { final MultiPageEditorViewImpl editorMultiPageView = (MultiPageEditorViewImpl) kieView.getMultiPage().getView(); <START> final int backgroundPageIndex = editorMultiPageView.getPageIndex(CommonConstants.INSTANCE.EditTabTitle()) + 1; <END> kieView.getMultiPage().addPage(backgroundPageIndex, new PageImpl(scenarioGridWidget, ScenarioSimulationEditorConstants.INSTANCE.backgroundTabTitle()) { @Override public void onFocus() { super.onFocus(); onBackgroundTabSelected(); } }); }</code><technical_language>avoid magical numbers ++</technical_language>

Target:
public void addBackgroundPage(final ScenarioGridWidget scenarioGridWidget) { final MultiPageEditorViewImpl editorMultiPageView = (MultiPageEditorViewImpl) kieView.getMultiPage().getView(); final String mainPageTitle = CommonConstants.INSTANCE.EditTabTitle(); final String backgroundPageTitle = ScenarioSimulationEditorConstants.INSTANCE.backgroundTabTitle(); final int mainPageIndex = editorMultiPageView.getPageIndex(mainPageTitle); final int backgroundPageIndex = mainPageIndex + 1; kieView.getMultiPage().addPage(backgroundPageIndex, new PageImpl(scenarioGridWidget, backgroundPageTitle) { @Override public void onFocus() { super.onFocus(); onBackgroundTabSelected(); } }); }
Source:
<code>private List<String> relationPK(RelationModel rm) throws OrmException, SQLException { List<String> pk = new <START> ArrayList<>(); <END> for (ColumnModel cm : rm.getPrimaryKeyColumns()) { pk.add(cm.getColumnName().toUpperCase()); } return pk; }</code><technical_language>rm.getPrimaryKeyColumns.size()</technical_language>

Target:
private List<String> relationPK(RelationModel rm) throws OrmException, SQLException { Collection<ColumnModel> cols = rm.getPrimaryKeyColumns(); List<String> pk = new ArrayList<>(cols.size()); for (ColumnModel cm : cols) { pk.add(cm.getColumnName().toUpperCase(Locale.US)); } return pk; }
Source:
<code>public void onMediaDeleted(AztecAttributes aztecAttributes) { String localMediaId = aztecAttributes.getValue(ATTR_ID_WP); mUploadingMediaProgressMax.remove(localMediaId); if (!TextUtils.isEmpty(localMediaId)) { mEditorFragmentListener.onMediaDeleted(localMediaId); } <START> removeCaptionFromDeletedMedia(localMediaId); <END> }</code><technical_language>I this if clause above, get called localMediaId is empty</technical_language>

Target:
public void onMediaDeleted(AztecAttributes aztecAttributes) { String localMediaId = aztecAttributes.getValue(ATTR_ID_WP); mUploadingMediaProgressMax.remove(localMediaId); if (!TextUtils.isEmpty(localMediaId)) { mEditorFragmentListener.onMediaDeleted(localMediaId); removeCaptionFromDeletedMedia(localMediaId); } }