auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void sendMessagesList() { final int count = 4; final byte[] contents = TEST_CONTENTS.getBytes(UTF_8); final List<ServiceBusMessage> messageList = new ArrayList<>(); IntStream.range(0, count).forEach(index -> { final ServiceBusMessage message = new ServiceBusMessage(contents); Assertions.assertTrue(messageList.add(message)); }); when(connection.createSendLink(eq(ENTITY_NAME), eq(ENTITY_NAME), eq(retryOptions))) .thenReturn(Mono.just(sendLink)); when(sendLink.send(any(Message.class))).thenReturn(Mono.empty()); when(sendLink.send(anyList())).thenReturn(Mono.empty()); StepVerifier.create(sender.send(messageList)) .verifyComplete(); verify(sendLink).send(messagesCaptor.capture()); final List<org.apache.qpid.proton.message.Message> messagesSent = messagesCaptor.getValue(); <START> Assertions.assertEquals(count, messagesSent.size()); <END> messagesSent.forEach(message -> Assertions.assertEquals(Section.SectionType.Data, message.getBody().getType())); }</code><technical_language>message need fully qualified</technical_language>

Target:
void sendMessagesList() { final int count = 4; final byte[] contents = TEST_CONTENTS.getBytes(UTF_8); final List<ServiceBusMessage> messages = TestUtils.getServiceBusMessages(count, UUID.randomUUID().toString()); when(connection.createSendLink(eq(ENTITY_NAME), eq(ENTITY_NAME), eq(retryOptions))) .thenReturn(Mono.just(sendLink)); when(sendLink.send(any(Message.class))).thenReturn(Mono.empty()); when(sendLink.send(anyList())).thenReturn(Mono.empty()); StepVerifier.create(sender.send(messages)) .verifyComplete(); verify(sendLink).send(messagesCaptor.capture()); final List<Message> messagesSent = messagesCaptor.getValue(); Assertions.assertEquals(count, messagesSent.size()); messagesSent.forEach(message -> Assertions.assertEquals(Section.SectionType.Data, message.getBody().getType())); }
Source:
<code>public void shouldCallGetServersV2WithNull() throws Throwable { GetServersProcedureRunner runner = new TestGetServersProcedureRunner( value( (Object)null ) ); Connection mock = mock( Connection.class ); when( mock.server() ).thenReturn( new InternalServerInfo( new BoltServerAddress( "123:45" ), "Neo4j/3.2.1" ) ); runner.run( mock ); <START> assertThat( runner.procedureCalled().toString(), equalTo( <END> "Statement{text='CALL dbms.cluster.routing.getServersV2', parameters=NULL}" ) ); }</code><technical_language>Statement a good #equals() method defined. I for assertions instead of #toString()</technical_language>

Target:
public void shouldCallGetServersV2WithNull() throws Throwable { GetServersProcedureRunner runner = new TestGetServersProcedureRunner( value( (Object)null ) ); Connection mock = mock( Connection.class ); when( mock.server() ).thenReturn( new InternalServerInfo( new BoltServerAddress( "123:45" ), "Neo4j/3.2.1" ) ); runner.run( mock ); assertThat( runner.procedureCalled(), equalTo( new Statement( "CALL " + GET_ROUTING_TABLE, value( (Object) null) ) ) ); }
Source:
<code>public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable { if (ctx.hasFlag(Flag.SKIP_LOCKING)) return invokeNextInterceptor(ctx, command); try { final boolean localNodeOwnsLock = cll.localNodeOwnsLock(command.getKey()); acquireRemoteIfNeeded(ctx, command.getKey(), localNodeOwnsLock); <START> if (ctx.hasFlag(Flag.SKIP_OWNERSHIP_CHECK) || localNodeOwnsLock) { <END> lockKeyAndCheckOwnership(ctx, command.getKey()); } else if (cll.localNodeIsOwner(command.getKey())) { ((TxInvocationContext)ctx).getCacheTransaction().addBackupLockForKey(command.getKey()); } return invokeNextInterceptor(ctx, command); } catch (Throwable te) { releaseLocksOnFailureBeforePrepare(ctx); throw te; } }</code><technical_language>I SKIP_OWNERSHIP_CHECK lock acquired here, means key (also) stored local node of ownership. This behaviour is defined currently SKIP_OWNERSHIP_CHECK is SKIP_LOCKING CACHE_MODE_LOCAL. alternative write incoming state data container remove SKIP_OWNERSHIP_CHECK flag altogether (as discussed)</technical_language>

Target:
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable { if (ctx.hasFlag(Flag.SKIP_LOCKING)) return invokeNextInterceptor(ctx, command); try { final boolean localNodeOwnsLock = cdl.localNodeIsPrimaryOwner(command.getKey()); acquireRemoteIfNeeded(ctx, command.getKey(), localNodeOwnsLock); if (ctx.hasFlag(Flag.SKIP_OWNERSHIP_CHECK) || localNodeOwnsLock) { lockKeyAndCheckOwnership(ctx, command.getKey()); } else if (cdl.localNodeIsOwner(command.getKey())) { ((TxInvocationContext)ctx).getCacheTransaction().addBackupLockForKey(command.getKey()); } return invokeNextInterceptor(ctx, command); } catch (Throwable te) { releaseLocksOnFailureBeforePrepare(ctx); throw te; } }
Source:
<code>Pair<Map<Integer, FeatureType>, Integer> getFeatureTypes() { final Map<Integer, FeatureType> featureTypes = new HashMap<>(numFeatures + 1); int valueTypeNum = 0; final HdfsSplitInfo[] infoArr = HdfsSplitManager.getSplits(metadataPath, TextInputFormat.class.getName(), NUM_SPLIT); for (final HdfsSplitInfo info : infoArr) { try { final Iterator<Pair<LongWritable, Text>> iterator = HdfsSplitFetcher.fetchData(info); while (iterator.hasNext()) { final String text = iterator.next().getValue().toString().trim(); if (text.startsWith("#") || text.length() == 0) { continue; } final String[] splits = text.split(" "); for (final String split : splits) { final String[] idxVal = split.split(":"); assert idxVal.length == 2; final int idx = Integer.parseInt(idxVal[0]); if (idx == numFeatures) { valueTypeNum = Integer.parseInt(idxVal[1]); } final FeatureType featureType = Integer.parseInt(idxVal[1]) == 0 ? FeatureType.CONTINUOUS : FeatureType.CATEGORICAL; <START> featureTypes.put(idx, featureType); <END> } } } catch (final IOException e) { throw new RuntimeException(e); } } return Pair.of(featureTypes, valueTypeNum); }</code><technical_language>84~86 lines in else clause</technical_language>

Target:
Pair<Map<Integer, FeatureType>, Integer> getFeatureTypes() { final HdfsSplitInfo[] infoArr = HdfsSplitManager.getSplits(metadataPath, TextInputFormat.class.getName(), NUM_SPLIT); assert infoArr.length == 1; final HdfsSplitInfo info = infoArr[0]; try { final Iterator<Pair<LongWritable, Text>> iterator = HdfsSplitFetcher.fetchData(info); while (iterator.hasNext()) { final String text = iterator.next().getValue().toString().trim(); if (text.startsWith("#") || text.length() == 0) { continue; } final Map<Integer, FeatureType> featureTypes = new HashMap<>(numFeatures); final String[] splits = text.split(" "); for (final String split : splits) { final String[] idxVal = split.split(":"); assert idxVal.length == 2; final int idx = Integer.parseInt(idxVal[0]); if (idx != numFeatures) { final FeatureType featureType = Integer.parseInt(idxVal[1]) == 0 ? FeatureType.CONTINUOUS : FeatureType.CATEGORICAL; featureTypes.put(idx, featureType); } } final int valueTypeNum = Integer.parseInt(splits[numFeatures].split(":")[1]); return Pair.of(featureTypes, valueTypeNum); } } catch (final IOException e) { throw new RuntimeException(e); } return NO_INFORMATION; }
Source:
<code>public ShowcaseView build() { ViewGroup parent; int index; if (mParent == null) { <START> parent = ((ViewGroup) activity.getWindow().getDecorView()); <END> index = mParentIndex; } else { parent = mParent; index = -1; } insertShowcaseView(showcaseView, parent, index); return showcaseView; }</code><technical_language>assign this mParent in constructor of Builder, check null</technical_language>

Target:
public ShowcaseView build() { insertShowcaseView(showcaseView, parent, parentIndex); return showcaseView; }
Source:
<code>static void init() throws Exception { jarDir = TMP.newFolder().toPath(); final String parameterProgramJarName = System.getProperty("parameterJarName") + ".jar"; final String parameterProgramWithoutManifestJarName = System.getProperty("parameterJarWithoutManifestName") + ".jar"; final Path jarLocation = Paths.get(System.getProperty("targetDir")); jarWithManifest = Files.copy( jarLocation.resolve(parameterProgramJarName), jarDir.resolve("program-with-manifest.jar")); jarWithoutManifest = Files.copy( jarLocation.resolve(parameterProgramWithoutManifestJarName), jarDir.resolve("program-without-manifest.jar")); restfulGateway = new TestingDispatcherGateway.Builder() .setBlobServerPort(BLOB_SERVER_RESOURCE.getBlobServerPort()) .setSubmitFunction(jobGraph -> { LAST_SUBMITTED_JOB_GRAPH_REFERENCE.set(jobGraph); return CompletableFuture.completedFuture(Acknowledge.get()); }) <START> .setRequestJobResultFunction(jobID -> <END> CompletableFuture.completedFuture( new JobResult.Builder() .jobId(jobID) .applicationStatus(ApplicationStatus.SUCCEEDED) .accumulatorResults(Collections.emptyMap()) .netRuntime(Long.MAX_VALUE) .build())) .build(); gatewayRetriever = () -> CompletableFuture.completedFuture(restfulGateway); localAddressFuture = CompletableFuture.completedFuture("shazam://localhost:12345"); timeout = Time.seconds(10); responseHeaders = Collections.emptyMap(); executor = TestingUtils.defaultExecutor(); }</code><technical_language>this change</technical_language>

Target:
static void init() throws Exception { jarDir = TMP.newFolder().toPath(); final String parameterProgramJarName = System.getProperty("parameterJarName") + ".jar"; final String parameterProgramWithoutManifestJarName = System.getProperty("parameterJarWithoutManifestName") + ".jar"; final Path jarLocation = Paths.get(System.getProperty("targetDir")); jarWithManifest = Files.copy( jarLocation.resolve(parameterProgramJarName), jarDir.resolve("program-with-manifest.jar")); jarWithoutManifest = Files.copy( jarLocation.resolve(parameterProgramWithoutManifestJarName), jarDir.resolve("program-without-manifest.jar")); restfulGateway = new TestingDispatcherGateway.Builder() .setBlobServerPort(BLOB_SERVER_RESOURCE.getBlobServerPort()) .setSubmitFunction(jobGraph -> { LAST_SUBMITTED_JOB_GRAPH_REFERENCE.set(jobGraph); return CompletableFuture.completedFuture(Acknowledge.get()); }) .build(); gatewayRetriever = () -> CompletableFuture.completedFuture(restfulGateway); localAddressFuture = CompletableFuture.completedFuture("shazam://localhost:12345"); timeout = Time.seconds(10); responseHeaders = Collections.emptyMap(); executor = TestingUtils.defaultExecutor(); }
Source:
<code>protected double getScore(double availableCpu, double availableMemory, Map<String, Double> availableGenericResources) { <START> TopologyDetails td = getNextHighest(); <END> return getScore(availableCpu, availableMemory, availableGenericResources, td); }</code><technical_language>Nit: inline this avoid unnecessary object creation</technical_language>

Target:
protected double getScore(double availableCpu, double availableMemory, Map<String, Double> availableGenericResources) { return getScore(availableCpu, availableMemory, availableGenericResources, getNextHighest()); }
Source:
<code>KafkaRecordSet(KafkaSplit split, <START> KafkaConsumerManager consumerManager, <END> List<KafkaColumnHandle> columnHandles, RowDecoder keyDecoder, RowDecoder messageDecoder) { this.split = requireNonNull(split, "split is null"); this.consumerManager = requireNonNull(consumerManager, "consumerManager is null"); this.keyDecoder = requireNonNull(keyDecoder, "rowDecoder is null"); this.messageDecoder = requireNonNull(messageDecoder, "rowDecoder is null"); this.columnHandles = requireNonNull(columnHandles, "columnHandles is null"); ImmutableList.Builder<Type> typeBuilder = ImmutableList.builder(); for (DecoderColumnHandle handle : this.columnHandles) { typeBuilder.add(handle.getType()); } this.columnTypes = typeBuilder.build(); KafkaConsumer consumer = consumerManager.createConsumer(Thread.currentThread().getId(), split.getLeader()); TopicPartition tp = new TopicPartition(split.getTopicName(), split.getPartitionId()); consumer.assign(ImmutableList.of(tp)); setOffsetRange(consumer, split); consumer.close(); }</code><technical_language>incorrect format</technical_language>

Target:
KafkaRecordSet(KafkaSplit split, KafkaConsumerManager consumerManager, List<KafkaColumnHandle> columnHandles, RowDecoder keyDecoder, RowDecoder messageDecoder) { this.split = requireNonNull(split, "split is null"); this.consumerManager = requireNonNull(consumerManager, "consumerManager is null"); this.keyDecoder = requireNonNull(keyDecoder, "rowDecoder is null"); this.messageDecoder = requireNonNull(messageDecoder, "rowDecoder is null"); this.columnHandles = requireNonNull(columnHandles, "columnHandles is null"); ImmutableList.Builder<Type> typeBuilder = ImmutableList.builder(); for (DecoderColumnHandle handle : columnHandles) { typeBuilder.add(handle.getType()); } this.columnTypes = typeBuilder.build(); }
Source:
<code>public Response<Set<String>> apply(ChangeResource req, Input input) throws AuthException, OrmException, IOException, BadRequestException { if (input == null || Strings.isNullOrEmpty(input.hashtags)) { throw new BadRequestException("Hashtags are required"); } ChangeControl control = req.getControl(); if(!control.canEditHashtags()){ throw new AuthException("Editing hashtags not permitted"); } ChangeUpdate update = updateFactory.create(control); ChangeNotes notes = control.getNotes().load(); Set<String> existingHashtags = notes.getHashtags(); Set<String> updatedHashtags = new <START> HashSet<String>(); <END> Set<String> removed = new HashSet<String>(); List<String> toRemove = Arrays.asList(input.hashtags.split(",")); if (existingHashtags != null) { updatedHashtags.addAll(existingHashtags); for (String hashtag : toRemove) { if (existingHashtags.contains(hashtag)) { removed.add(hashtag); } } } if (removed.size() > 0) { updatedHashtags.removeAll(removed); update.setHashtags(updatedHashtags); update.commit(); IdentifiedUser currentUser = ((IdentifiedUser) control.getCurrentUser()); hooks.doHashtagsEditedHook( req.getChange(), currentUser.getAccount(), null, removed, updatedHashtags, dbProvider.get()); } return Response.ok(updatedHashtags); }</code><technical_language>Java 7 type is needed anymore removed</technical_language>

Target:
public Response<Set<String>> apply(ChangeResource req, Input input) throws AuthException, OrmException, IOException, BadRequestException { if (input == null || Strings.isNullOrEmpty(input.hashtags)) { throw new BadRequestException("Hashtags are required"); } ChangeControl control = req.getControl(); if(!control.canEditHashtags()){ throw new AuthException("Editing hashtags not permitted"); } ChangeUpdate update = updateFactory.create(control); ChangeNotes notes = control.getNotes().load(); Set<String> existingHashtags = notes.getHashtags(); Set<String> updatedHashtags = new HashSet<String>(); Set<String> removed = new HashSet<String>(); List<String> toRemove = Arrays.asList(input.hashtags.split(",")); if (existingHashtags != null) { updatedHashtags.addAll(existingHashtags); for (String hashtag : toRemove) { if (existingHashtags.contains(hashtag)) { removed.add(hashtag); } } } if (removed.size() > 0) { updatedHashtags.removeAll(removed); update.setHashtags(updatedHashtags); update.commit(); indexer.index(dbProvider.get(), update.getChange()); IdentifiedUser currentUser = ((IdentifiedUser) control.getCurrentUser()); hooks.doHashtagsEditedHook( req.getChange(), currentUser.getAccount(), null, removed, updatedHashtags, dbProvider.get()); } return Response.ok(updatedHashtags); }
Source:
<code>public static String escapeForHtml(String inStr, boolean changeSpace, int tabLength) { StringBuilder retStr = new StringBuilder(); int i = 0; int l = 0; while (i < inStr.length()) { if (inStr.charAt(i) == '&') { retStr.append("&amp;"); } else if (inStr.charAt(i) == '<') { retStr.append("&lt;"); } else if (inStr.charAt(i) == '>') { retStr.append("&gt;"); } else if (inStr.charAt(i) == '\"') { retStr.append("&quot;"); } else if (changeSpace && inStr.charAt(i) == ' ') { retStr.append("&nbsp;"); } else if (changeSpace && inStr.charAt(i) == '\t') { for (int j = 0; j < tabLength - l; j++) { retStr.append("&nbsp;"); } l = -1; } else { retStr.append(inStr.charAt(i)); } l = (l + 1) % tabLength; <START> if (inStr.charAt(i) == '\n') <END> l = 0; i++; } return retStr.toString(); }</code><technical_language>wrap this if curly braces</technical_language>

Target:
public static String escapeForHtml(String inStr, boolean changeSpace, int tabLength) { StringBuilder retStr = new StringBuilder(); int i = 0; int l = 0; while (i < inStr.length()) { if (inStr.charAt(i) == '&') { retStr.append("&amp;"); } else if (inStr.charAt(i) == '<') { retStr.append("&lt;"); } else if (inStr.charAt(i) == '>') { retStr.append("&gt;"); } else if (inStr.charAt(i) == '\"') { retStr.append("&quot;"); } else if (changeSpace && inStr.charAt(i) == ' ') { retStr.append("&nbsp;"); } else if (changeSpace && inStr.charAt(i) == '\t') { for (int j = 0; j < tabLength - l; j++) { retStr.append("&nbsp;"); } l = -1; } else { retStr.append(inStr.charAt(i)); } l = (l + 1) % tabLength; if (inStr.charAt(i) == '\n') { l = 0; } i++; } return retStr.toString(); }
Source:
<code>AbstractDataManipulator (String title, IPath pathWorkDir, IProject project) { <START> this.title = title; <END> this.pathWorkDir=pathWorkDir; this.project=project; threads = new ArrayList<Thread>(); }</code><technical_language>This simplified : super(title, pathWorkingDir); this.project = project;</technical_language>

Target:
AbstractDataManipulator (String title, IPath pathWorkDir, IProject project) { this(title, pathWorkDir); this.project=project; }
Source:
<code>public Void apply(EntryView.ReadWriteEntryView<K, Collection<V>> entryView) { Collection<V> newValues = new HashSet<>(); newValues.add(value); try { <START> Collection<V> values = entryView.get(); <END> newValues.addAll(values); } catch (NoSuchElementException ex) { } entryView.set(newValues); return null; }</code><technical_language>~~Hrmm if entry exists add new set in view? update get progressively slower.~~ Collection<V> newValues = entryView.find().map(HashSet::new).orElseGet(HashSet::new); newValues.add(value) entryView.set(newValues)</technical_language>

Target:
public Void apply(EntryView.ReadWriteEntryView<K, Collection<V>> entryView) { Collection<V> newValues = new HashSet<>(); newValues.add(value); entryView.find().map(newValues::addAll); entryView.set(newValues); return null; }
Source:
<code><START> public void addSource(Object source) { <END> if (source instanceof Resource) { XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.context); reader.loadBeanDefinitions((Resource)source); } }</code><technical_language>this throw Exception if other Resource is passed? (can method Resource specific type a subtype of Object interface... possibly parameterize?)</technical_language>

Target:
public void addSource(Object source) { Assert.notNull(source,"source cannot be null"); Assert.isInstanceOf(Resource.class,source,"unsupported source: " + source.getClass().getName()); Resource resource = (Resource)source; XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.context); reader.loadBeanDefinitions(resource); }
Source:
<code><START> public void createControl(Composite parent) { <END> initializeDialogUnits(parent); Composite composite= new Composite(parent, SWT.NONE); composite.setFont(parent.getFont()); int nColumns= 3; GridLayout layout= new GridLayout(); layout.numColumns= 3; composite.setLayout(layout); Label label= new Label(composite, SWT.WRAP); String info= Messages.format(NewWizardMessages.NewModuleInfoWizardPage_info, filename); label.setText(info); GridData gd= new GridData(); gd.widthHint= convertWidthInCharsToPixels(60); gd.horizontalSpan= 3; label.setLayoutData(gd); createModuleInfoControls(composite, nColumns); setControl(composite); Dialog.applyDialogFont(composite); }</code><technical_language>do need 3 columns here</technical_language>

Target:
public void createControl(Composite parent) { initializeDialogUnits(parent); Composite composite= new Composite(parent, SWT.NONE); composite.setFont(parent.getFont()); int nColumns= 2; GridLayout layout= new GridLayout(); layout.numColumns= 2; composite.setLayout(layout); createModuleInfoControls(composite, nColumns); setControl(composite); Dialog.applyDialogFont(composite); }
Source:
<code>public ApiResponse handleApiAction(String name, JSONObject params) throws ApiException { RuleConfig rc; switch (name) { case ACTION_SET_RULE_CONFIG_VALUE: rc = extension.getRuleConfig(params.getString(PARAM_KEY)); if (rc != null) { if (params.containsKey(PARAM_VALUE)) { extension.setRuleConfigValue(rc.getKey(), params.getString(PARAM_VALUE)); } else { extension.setRuleConfigValue(rc.getKey(), ""); } } else { <START> throw new ApiException(ApiException.Type.DOES_NOT_EXIST); <END> } break; case ACTION_RESET_RULE_CONFIG_VALUE: rc = extension.getRuleConfig(params.getString(PARAM_KEY)); if (rc != null) { extension.resetRuleConfigValue(rc.getKey()); } else { throw new ApiException(ApiException.Type.DOES_NOT_EXIST); } break; case ACTION_RESET_ALL_RULE_CONFIG_VALUES: extension.resetAllRuleConfigValues();; break; default: throw new ApiException(ApiException.Type.BAD_ACTION); } return ApiResponseElement.OK; }</code><technical_language>PARAM_KEY detail of exception</technical_language>

Target:
public ApiResponse handleApiAction(String name, JSONObject params) throws ApiException { RuleConfig rc; switch (name) { case ACTION_SET_RULE_CONFIG_VALUE: rc = extension.getRuleConfig(params.getString(PARAM_KEY)); if (rc != null) { if (params.containsKey(PARAM_VALUE)) { extension.setRuleConfigValue(rc.getKey(), params.getString(PARAM_VALUE)); } else { extension.setRuleConfigValue(rc.getKey(), ""); } } else { throw new ApiException(ApiException.Type.DOES_NOT_EXIST, PARAM_KEY); } break; case ACTION_RESET_RULE_CONFIG_VALUE: rc = extension.getRuleConfig(params.getString(PARAM_KEY)); if (rc != null) { extension.resetRuleConfigValue(rc.getKey()); } else { throw new ApiException(ApiException.Type.DOES_NOT_EXIST, PARAM_KEY); } break; case ACTION_RESET_ALL_RULE_CONFIG_VALUES: extension.resetAllRuleConfigValues(); break; default: throw new ApiException(ApiException.Type.BAD_ACTION); } return ApiResponseElement.OK; }
Source:
<code>public static ExclusionItem parse(String text) { int i = text.indexOf(':'); if (i < 0) { return null; } String item = text.substring(i+1); if (StringUtils.trimToNull(item) == null) { return null; } <START> switch (text.substring(0, i).toUpperCase()) { <END> case "FILE": return new ExclusionItem(FILE, item); case "DIRECTORY": return new ExclusionItem(DIRECTORY, item); case "GLOB": return new ExclusionItem(GLOB, item); default: return null; } }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') Define locale in this String operation. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public static ExclusionItem parse(String text) { int i = text.indexOf(':'); if (i < 0) { return null; } String item = text.substring(i+1); if (StringUtils.trimToNull(item) == null) { return null; } switch (text.substring(0, i).toUpperCase(Locale.US)) { case "FILE": return new ExclusionItem(FILE, item); case "DIRECTORY": return new ExclusionItem(DIRECTORY, item); case "GLOB": return new ExclusionItem(GLOB, item); default: return null; } }
Source:
<code>public void executeCommand(Command command, ExecutionHandlerContext context) { List<byte[]> commandElems = command.getProcessedCommand(); if (commandElems.size() < 3) { command.setResponse( Coder.getErrorResponse(context.getByteBufAllocator(), RedisConstants.ArityDef.KEYS)); return; } ByteArrayWrapper key = command.getKey(); ByteArrayWrapper newKey = new ByteArrayWrapper(commandElems.get(2)); RedisKeyCommands redisKeyCommands = <START> new RedisKeyCommandsFunctionExecutor(context.getRegionProvider().getDataRegion()); <END> if (!redisKeyCommands.rename(key, newKey)) { command.setResponse( Coder.getErrorResponse(context.getByteBufAllocator(), RedisConstants.ERROR_NO_SUCH_KEY)); return; } command.setResponse(Coder.getSimpleStringResponse(context.getByteBufAllocator(), "OK")); }</code><technical_language>AbstractExecutor.getRedisKeyCommands(context) instead</technical_language>

Target:
public void executeCommand(Command command, ExecutionHandlerContext context) { List<ByteArrayWrapper> commandElems = command.getProcessedCommandWrappers(); ByteArrayWrapper key = command.getKey(); ByteArrayWrapper newKey = commandElems.get(2); RedisKeyCommands redisKeyCommands = getRedisKeyCommands(context); if (key.equals(newKey)) { command.setResponse(Coder.getSimpleStringResponse(context.getByteBufAllocator(), "OK")); return; } if (!redisKeyCommands.rename(key, newKey)) { command.setResponse( Coder.getErrorResponse(context.getByteBufAllocator(), RedisConstants.ERROR_NO_SUCH_KEY)); return; } command.setResponse(Coder.getSimpleStringResponse(context.getByteBufAllocator(), "OK")); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem menuItem) { if (menuItem.getItemId() == android.R.id.home) { finish(); } else if (menuItem.getItemId() == R.id.action_menu_save){ <START> presenter.saveReminders(); <END> } return super.onOptionsItemSelected(menuItem); }</code><technical_language>is clear, do "Save" is adding alarm item is enough? Actually, is saved in Realm scheduled in Alarm manager</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem menuItem) { if (menuItem.getItemId() == android.R.id.home) { presenter.saveReminders(); finish(); } return super.onOptionsItemSelected(menuItem); }
Source:
<code>public static String getAPIUrl(String serviceName, String plan) { if (serviceName == null || serviceName.isEmpty()) return null; final JsonObject services = getVCAPServices(); if (services == null) return null; final JsonObject credentials = getCredentialsObject(services, serviceName, plan); <START> if (credentials.has(URL)) <END> return credentials.get(URL).getAsString(); return null; }</code><technical_language>This line throw a NullPointerException</technical_language>

Target:
public static String getAPIUrl(String serviceName, String plan) { if (serviceName == null || serviceName.isEmpty()) return null; final JsonObject services = getVCAPServices(); if (services == null) return null; final JsonObject credentials = getCredentialsObject(services, serviceName, plan); if (credentials != null && credentials.has(URL)) return credentials.get(URL).getAsString(); return null; }
Source:
<code>public void testListAllVirtualMachines() { Iterable<VirtualMachine> vms = env.context.getCloudService().listVirtualMachines(); <START> assertTrue(size(vms) > 1); <END> }</code><technical_language>Bit of a loose condition? expect returned</technical_language>

Target:
public void testListAllVirtualMachines() { Iterable<VirtualMachine> vms = env.context.getCloudService().listVirtualMachines(); assertTrue(size(vms) > 1); find(vms, new Predicate<VirtualMachine>() { @Override public boolean apply(VirtualMachine input) { return input.getId().equals(env.virtualMachine.getId()); } }); }
Source:
<code>public EObject createObject(EFactory eFactory, EClassifier type) { EFactory factory = eFactory; if (migrationNeeded) { if (type != null && type.getEPackage() != null && type.getEPackage().getEFactoryInstance() != null) { factory = type.getEPackage().getEFactoryInstance(); } } <START> EObject newObject = super.createObject(factory, type); if (migrationNeeded) { newObject = RepresentationsFileMigrationService.getInstance().updateCreatedObject(newObject, version); } return newObject; <END> }</code><technical_language>this modification done in commit reference Bug 449167</technical_language>

Target:
public EObject createObject(EFactory eFactory, EClassifier type) { EFactory factory = eFactory; if (migrationNeeded) { if (type != null && type.getEPackage() != null && type.getEPackage().getEFactoryInstance() != null) { factory = type.getEPackage().getEFactoryInstance(); } } return super.createObject(factory, type); }
Source:
<code>public static List<Class<? extends Annotation>> validEnhancedViewSupportAnnotations() { <START> return validEnhancedViewSupportAnnotations; <END> }</code><technical_language>return a new immutable copy of internal list? returning list allows plugins fully modify list. @WonderCsabo wdyt</technical_language>

Target:
public static List<Class<? extends Annotation>> validEnhancedViewSupportAnnotations() { return Collections.unmodifiableList(validEnhancedViewSupportAnnotations); }
Source:
<code>public AnalyzerConfiguration( final String webWorkerUUID, final DateTimeFormatProvider dateTimeFormatter, final UUIDKeyProvider uuidKeyProvider, final CheckConfiguration checkConfiguration, final RunnerType runnerType ) { this.webWorkerUUID = PortablePreconditions.checkNotNull( "webWorkerUUID", webWorkerUUID ); this.dateTimeFormatter = PortablePreconditions.checkNotNull( "dateTimeFormatter", dateTimeFormatter ); this.uuidKeyProvider = PortablePreconditions.checkNotNull( "uuidKeyProvider", uuidKeyProvider ); <START> this.checkConfiguration = PortablePreconditions.checkNotNull( "checkWhiteList", <END> checkConfiguration ); this.runnerType = PortablePreconditions.checkNotNull( "runnerType", runnerType ); }</code><technical_language>similar occurrences of checkWhiteList replaced checkConfiguration</technical_language>

Target:
public AnalyzerConfiguration( final String webWorkerUUID, final DateTimeFormatProvider dateTimeFormatter, final UUIDKeyProvider uuidKeyProvider, final CheckConfiguration checkConfiguration, final RunnerType runnerType ) { this.webWorkerUUID = PortablePreconditions.checkNotNull( "webWorkerUUID", webWorkerUUID ); this.dateTimeFormatter = PortablePreconditions.checkNotNull( "dateTimeFormatter", dateTimeFormatter ); this.uuidKeyProvider = PortablePreconditions.checkNotNull( "uuidKeyProvider", uuidKeyProvider ); this.checkConfiguration = PortablePreconditions.checkNotNull( "checkConfiguration", checkConfiguration ); this.runnerType = PortablePreconditions.checkNotNull( "runnerType", runnerType ); }
Source:
<code>protected final Object visitDataReadCommand(InvocationContext ctx, DataCommand command) throws Throwable { if (!readNeedsLock(ctx, command)) { return invokeNext(ctx, command); } try { if (!readNeedsLock(ctx, command)) { return invokeNext(ctx, command); } Object key = command.getKey(); if (!needRemoteLocks(ctx, key, command)) { acquireLocalLock(ctx, command); return invokeNext(ctx, command); } TxInvocationContext txContext = (TxInvocationContext) ctx; LockControlCommand lcc = cf.buildLockControlCommand(key, command.getFlagsBitSet(), txContext.getGlobalTransaction()); Object result = invokeNextThenApply(ctx, lcc, (rCtx, rCommand, rv) -> invokeNext(rCtx, command)); <START> return makeStage(result).andFinally(ctx, command, <END> (rCtx, rCommand, rv, t) -> { if (t != null) { rethrowAndReleaseLocksIfNeeded(rCtx, t); return; } acquireLocalLock(rCtx, (DataCommand) rCommand); }); } catch (Throwable t) { rethrowAndReleaseLocksIfNeeded(ctx, t); throw t; } }</code><technical_language>andExceptionally more appropriate</technical_language>

Target:
protected final Object visitDataReadCommand(InvocationContext ctx, DataCommand command) throws Throwable { if (!readNeedsLock(ctx, command)) { return invokeNext(ctx, command); } try { if (!readNeedsLock(ctx, command)) { return invokeNext(ctx, command); } Object key = command.getKey(); if (!needRemoteLocks(ctx, key, command)) { acquireLocalLock(ctx, command); return invokeNext(ctx, command); } TxInvocationContext txContext = (TxInvocationContext) ctx; LockControlCommand lcc = cf.buildLockControlCommand(key, command.getFlagsBitSet(), txContext.getGlobalTransaction()); Object result = invokeNextThenApply(ctx, lcc, (rCtx, rCommand, rv) -> invokeNext(rCtx, command)); return makeStage(result).andFinally(ctx, command, (rCtx, rCommand, rv, t) -> { if (t != null) { rethrowAndReleaseLocksIfNeeded(rCtx, t); } else { acquireLocalLock(rCtx, (DataCommand) rCommand); } }); } catch (Throwable t) { rethrowAndReleaseLocksIfNeeded(ctx, t); throw t; } }
Source:
<code>private int calculateDropdownTop() { int ddTop; DropdownPosition dropdownPosition = options.getDropdownPosition(); <START> if (dropdownPosition == null) { <END> dropdownPosition = DropdownPosition.BELOW; } switch (dropdownPosition) { case BELOW: ddTop = positionBelow(); break; case ABOVE: ddTop = positionAbove(); break; case AUTO: if (options.getDropdownBoundaries() == null && options.getDropdownBoundariesProvider() == null) { ddTop = positionRelativeToWindow(); } else { ddTop = positionRelativeToBoundaries(); } break; default: ddTop = positionBelow(); break; } return ddTop; }</code><technical_language>set default dropdown position in options</technical_language>

Target:
private int calculateDropdownTop() { int ddTop; DropdownPosition dropdownPosition = options.getDropdownPosition(); switch (dropdownPosition) { case ABOVE: ddTop = positionAbove(); break; case AUTO: if (options.getDropdownBoundaries() == null && options.getDropdownBoundariesProvider() == null) { ddTop = positionRelativeToWindow(); } else { ddTop = positionRelativeToBoundaries(); } break; case BELOW: default: ddTop = positionBelow(); break; } return ddTop; }
Source:
<code>public List<String> getAliases() { <START> List<Object> defaultAliases = (List<Object>) defaults <END> .get(SystemPreference.ALIASES.getKey()); if(prefs != null) { List<Object> list = prefs.getList(SystemPreference.ALIASES.getKey(), defaultAliases); return list.stream() .map(object -> Objects.toString(object, null)) .collect(Collectors.toList()); } else { return defaultAliases.stream() .map(object -> Objects.toString(object, null)) .collect(Collectors.toList()); } }</code><technical_language>This List Strings</technical_language>

Target:
public List<String> getAliases() { if(prefs != null) { List<Object> aliases = prefs.getList(SystemPreference.ALIAS .getKey()); aliases.addAll(prefs.getList(SystemPreference.ALIASES.getKey())); return aliases.stream().map(alias -> Objects.toString(alias)) .collect(Collectors.toList()); } else { return Collections.emptyList(); } }
Source:
<code>private void performTopologicalSort() { Set<BatchIdentifier> visitedNodes = new HashSet<>(); <START> Stack<BatchIdentifier> stack = new Stack<>(); <END> for( BatchIdentifier node: latestBatches ) { if( !visitedNodes.contains( node ) ) { topologicalSort( node, visitedNodes, stack ); } } if( !stack.isEmpty() ) { latestBatches.clear(); while( !stack.isEmpty() ) { latestBatches.add( stack.pop() ); } } }</code><technical_language>suggest ArrayList instead of a Stack is synchronized</technical_language>

Target:
private void performTopologicalSort() { Set<BatchIdentifier> visitedNodes = new HashSet<>(); Deque<BatchIdentifier> stack = new LinkedList<>(); for( BatchIdentifier node: latestBatches ) { if( !visitedNodes.contains( node ) ) { topologicalSort( node, visitedNodes, stack ); } } if( !stack.isEmpty() ) { latestBatches.clear(); while( !stack.isEmpty() ) { latestBatches.add( stack.pop() ); } } }
Source:
<code>public Comparable getSortKey() { String sourceProviderName = mySourceProvider == null ? "" : mySourceProvider.getName(); <START> final String s = getQualifiedNameSortKey() + "-" + (SdkConstants.FD_MAIN.equals(sourceProviderName) ? "" : sourceProviderName); <END> return s; }</code><technical_language>inline s</technical_language>

Target:
public Comparable getSortKey() { String sourceProviderName = mySourceProvider == null ? "" : mySourceProvider.getName(); return getQualifiedNameSortKey() + "-" + (SdkConstants.FD_MAIN.equals(sourceProviderName) ? "" : sourceProviderName); }
Source:
<code>private void gracefulShutdown() { vaults.filtered(Vault.NOT_LOCKED).forEach(Vault::prepareForShutdown); if (!vaults.filtered(Vault.NOT_LOCKED).isEmpty()) { ButtonType tryAgainButtonType = new ButtonType( localization.getString("main.gracefulShutdown.button.tryAgain")); ButtonType forceShutdownButtonType = new ButtonType( localization.getString("main.gracefulShutdown.button.forceShutdown")); Alert gracefulShutdownDialog = DialogBuilderUtil.buildGracefulShutdownDialog( localization.getString("main.gracefulShutdown.dialog.title"), localization.getString("main.gracefulShutdown.dialog.header"), localization.getString("main.gracefulShutdown.dialog.content"), tryAgainButtonType, forceShutdownButtonType); Optional<ButtonType> choice = gracefulShutdownDialog.showAndWait(); <START> if (choice.isPresent()) { <END> if (tryAgainButtonType.equals(choice.get())) { gracefulShutdown(); } else if (forceShutdownButtonType.equals(choice.get())) { Platform.runLater(Platform::exit); } } } }</code><technical_language>else what? window close shutdown is canceled? if else-branch is needed, _might_ easier read Java choice.ifPresent(btnType -> { if (tryAgainButtonType.equals(btnType) { // ... } else if ( ... ) { // ... } });</technical_language>

Target:
private void gracefulShutdown() { vaults.filtered(Vault.NOT_LOCKED).forEach(Vault::prepareForShutdown); if (!vaults.filtered(Vault.NOT_LOCKED).isEmpty()) { ButtonType tryAgainButtonType = new ButtonType(localization.getString("main.gracefulShutdown.button.tryAgain")); ButtonType forceShutdownButtonType = new ButtonType(localization.getString("main.gracefulShutdown.button.forceShutdown")); Alert gracefulShutdownDialog = DialogBuilderUtil.buildGracefulShutdownDialog( localization.getString("main.gracefulShutdown.dialog.title"), localization.getString("main.gracefulShutdown.dialog.header"), localization.getString("main.gracefulShutdown.dialog.content"), forceShutdownButtonType, forceShutdownButtonType, tryAgainButtonType); Optional<ButtonType> choice = gracefulShutdownDialog.showAndWait(); choice.ifPresent(btnType -> { if (tryAgainButtonType.equals(btnType)) { gracefulShutdown(); } else if (forceShutdownButtonType.equals(btnType)) { Platform.runLater(Platform::exit); } }); } }
Source:
<code>public static <T> T invokeStatic(String fqcn, String methodName, Class[] argTypes, Object... args) { try { Class clazz = Classes.forName(fqcn); final Method method = clazz.getDeclaredMethod(methodName, argTypes); AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { method.setAccessible(true); return null; } }); return(T)method.invoke(null, args); <START> } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { <END> String msg = "Unable to invoke class method " + fqcn + "#" + methodName + ". Ensure the necessary " + "implementation is in the runtime classpath."; throw new IllegalStateException(msg, e); } }</code><technical_language>This is backwards-compatible functionality, do this 1.0, right? If other RuntimeException is thrown, caught (like is today)</technical_language>

Target:
public static <T> T invokeStatic(String fqcn, String methodName, Class[] argTypes, Object... args) { try { Class clazz = Classes.forName(fqcn); final Method method = clazz.getDeclaredMethod(methodName, argTypes); AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { method.setAccessible(true); return null; } }); return(T)method.invoke(null, args); } catch (Exception e) { String msg = "Unable to invoke class method " + fqcn + "#" + methodName + ". Ensure the necessary " + "implementation is in the runtime classpath."; throw new IllegalStateException(msg, e); } }
Source:
<code>private <T> Module bind(List<Class<? extends T>> classes) { Function<Class<? extends T>, Module> bindToModule = clazz -> (Binder binder) -> binder.bind(clazz).in(Singleton.class); <START> List<Module> modules = classes.stream().map(bindToModule).collect(toList()); <END> return combine(modules); }</code><technical_language>inline bindToModule</technical_language>

Target:
private <T> Module bind(List<Class<? extends T>> classes) { Function<Class<? extends T>, Module> bindToModule = clazz -> (Binder binder) -> binder.bind(clazz).in(Singleton.class); List<Module> modules = classes.stream() .map(bindToModule) .collect(toImmutableList()); return combine(modules); }
Source:
<code>public int getActiveSessionsFull() { int sessionCount = 0; try { sessionCount = store.getSize(); } catch (IOException e) { <START> log.error("An error occurred while counting sessions: " + e); <END> } return sessionCount; }</code><technical_language>log.error("An error occurred while counting sessions.", e);</technical_language>

Target:
public int getActiveSessionsFull() { int sessionCount = 0; try { sessionCount = store.getSize(); } catch (IOException e) { log.error("An error occurred while counting sessions: ", e); } return sessionCount; }
Source:
<code>static <K, V> HashMap<K, V> empty() { <START> return new HashMap<>(HashTree.empty()); <END> }</code><technical_language>sense empty HashMap a singleton, too. frequently used</technical_language>

Target:
static <K, V> HashMap<K, V> empty() { return (HashMap<K, V>) INSTANCE; }
Source:
<code><START> public List<GroovyParser> getParsers() { <END> return parsers; }</code><technical_language>breaks binary compatibility</technical_language>

Target:
public GroovyParser[] getParsers() { return groovyParsers.toArray(new GroovyParser[groovyParsers.size()]); }
Source:
<code>public void update(Observable arg0, Object arg1) { if (arg1 == OoyalaPlayer.TIME_CHANGED_NOTIFICATION) { return; } count++ ; <START> String text="Notification Received: " + arg1 + " - state: " + player.getState() + "count: " +count; <END> SDCardLogcatOoyalaEventsLogger Playbacklog= new SDCardLogcatOoyalaEventsLogger(); Playbacklog.writeToSdcardLog(count,text); Log.d(TAG, "Notification Received: " + arg1 + " - state: " + player.getState()); }</code><technical_language>This string is basically line 116 seems? making a variable, appending "count:"+count part writing sdcard log? a nice opportunity tighten/tidy strings together</technical_language>

Target:
public void update(Observable arg0, Object arg1) { if (arg1 == OoyalaPlayer.TIME_CHANGED_NOTIFICATION) { return; } String text="Notification Received: " + arg1 + " - state: " + player.getState(); Playbacklog.writeToSdcardLog(text); Log.d(TAG, "Notification Received: " + arg1 + " - state: " + player.getState()); }
Source:
<code>MavenExecutionResult readProjectsWithDependencies(IProjectRegistry state, Collection<IFile> pomFiles, ResolverConfiguration resolverConfiguration, IProgressMonitor monitor) { try { <START> return execute(state, null, resolverConfiguration, new ICallable<MavenExecutionResult>() { <END> public MavenExecutionResult call(IMavenExecutionContext context, IProgressMonitor monitor) throws CoreException { ProjectBuildingRequest configuration = context.newProjectBuildingRequest(); configuration.setResolveDependencies(true); MavenExecutionResult res = getMaven().readMavenProjects( pomFiles.stream().map(file -> file.getLocation().toFile()).collect(Collectors.toList()), configuration); return res; } }, monitor); } catch(CoreException ex) { DefaultMavenExecutionResult result = new DefaultMavenExecutionResult(); result.addException(ex); return result; } }</code><technical_language>lambda syntax</technical_language>

Target:
MavenExecutionResult readProjectsWithDependencies(IProjectRegistry state, Collection<IFile> pomFiles, ResolverConfiguration resolverConfiguration, IProgressMonitor monitor) { try { return execute(state, null, resolverConfiguration, (context, aMonitor) -> { ProjectBuildingRequest configuration = context.newProjectBuildingRequest(); configuration.setResolveDependencies(true); return getMaven().readMavenProjects( pomFiles.stream().map(file -> file.getLocation().toFile()).collect(Collectors.toList()), configuration); }, monitor); } catch(CoreException ex) { DefaultMavenExecutionResult result = new DefaultMavenExecutionResult(); result.addException(ex); return result; } }
Source:
<code>public WSProfileConfigurationManager(String serverUrl, String cookie, ConfigurationContext configCtxt) throws UserStoreException { try { stub = new RemoteProfileConfigurationManagerServiceStub(configCtxt, serverUrl + SERVICE_NAME); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); } catch (AxisFault e) { if (log.isDebugEnabled()) { log.debug(CONNECTION_ERROR_MESSAGE, e); } <START> throw new UserStoreException(); <END> } }</code><technical_language>add message exception</technical_language>

Target:
public WSProfileConfigurationManager(String serverUrl, String cookie, ConfigurationContext configCtxt) throws UserStoreException { try { stub = new RemoteProfileConfigurationManagerServiceStub(configCtxt, serverUrl + SERVICE_NAME); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); } catch (AxisFault e) { throw new UserStoreException("Axis error occurred while creating service client stub",e); } }
Source:
<code>public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) { final ConsoleReader reader = shellState.getReader(); AccumuloVFSClassLoader.printClassPath(s -> { try { reader.println(s); } catch (IOException ex) { <START> throw new RuntimeException(ex); <END> } }, true); return 0; }</code><technical_language>is new UncheckedIOException</technical_language>

Target:
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) { final ConsoleReader reader = shellState.getReader(); AccumuloVFSClassLoader.printClassPath(s -> { try { reader.print(s); } catch (IOException ex) { throw new RuntimeException(ex); } }, true); return 0; }
Source:
<code>public ValueMatcher makeValueMatcher(String dimension, final DruidPredicateFactory predicateFactory) { ValueType type = getTypeForDimension(dimension); switch (type) { case LONG: return makeLongValueMatcher(dimension, predicateFactory.makeLongPredicate()); case STRING: return makeStringValueMatcher(dimension, predicateFactory.makeStringPredicate()); default: <START> throw new UOE("Cannot make ValueMatcher for type[%s]", type); <END> } }</code><technical_language>Hmm, this act column is a string column full of nulls. rationale is classic Druid behavior is filter a column support filtering, acts if column is full of nulls. that'd consistent behavior in 0.9.1.1 prior. This done calling predicateFactory.makeStringPredicate() checking if applies null not, a BooleanValueMatcher</technical_language>

Target:
public ValueMatcher makeValueMatcher(String dimension, final DruidPredicateFactory predicateFactory) { ValueType type = getTypeForDimension(dimension); switch (type) { case LONG: return makeLongValueMatcher(dimension, predicateFactory.makeLongPredicate()); case STRING: return makeStringValueMatcher(dimension, predicateFactory.makeStringPredicate()); default: return new BooleanValueMatcher(predicateFactory.makeStringPredicate().apply(null)); } }
Source:
<code>public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { try { if (localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES) && attributes != null && version.equals("")) { version = attributes.getValue(TaskRepositoriesExternalizer.ATTRIBUTE_VERSION); <START> } else if (version.equals("1")) { END> handleVersion1(localName, attributes); } else if (version.equals("2")) { handleVersion2(localName, attributes); } } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not read repositories" , e)); } }</code><technical_language>skip "root", assuming task-repositories is of a repository</technical_language>

Target:
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { try { if (localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY)) { handleVersion1(localName, attributes); } else if (localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORYV2) || currentV2Repository != null) { handleVersion2(localName, attributes); } } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not read repositories" , e)); } }
Source:
<code><START> public org.radargun.traits.Query.Builder subquery() { <END> return this; }</code><technical_language>is this needed? import class name Query avoid this line 3 above</technical_language>

Target:
public Query.Builder subquery() { return this; }