auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void updateShardsAndIndex(long tableId, Map<UUID, DeltaUuidPair> toUpdateShard, Handle handle) throws SQLException { if (toUpdateShard.isEmpty()) { return; } String args = Joiner.on(",").join(nCopies(toUpdateShard.size(), "?")); ImmutableMap.Builder<Long, UUID> shardMapBuilder = ImmutableMap.builder(); String selectShards = format("" + "SELECT shard_id, shard_uuid\n" + "FROM shards\n" + "WHERE shard_uuid IN (%s)", args); try (PreparedStatement statement = handle.getConnection().prepareStatement(selectShards)) { bindUuids(statement, toUpdateShard.keySet()); try (ResultSet rs = statement.executeQuery()) { while (rs.next()) { shardMapBuilder.put(rs.getLong("shard_id"), uuidFromBytes(rs.getBytes("shard_uuid"))); } } } Map<Long, UUID> shardIdToUuid = shardMapBuilder.build(); if (toUpdateShard.size() != shardIdToUuid.size()) { throw transactionConflict(); } int updatedCount = 0; try (ShardsAndIndexUpdater shardsAndIndexUpdater = new ShardsAndIndexUpdater(handle.getConnection(), tableId)) { for (List<Long> batch : partition(shardIdToUuid.keySet(), batchSize(handle.getConnection()))) { <START> for (int i = 0; i < batch.size(); i++) { <END> Long shardId = batch.get(i); shardsAndIndexUpdater.update( shardId, toUpdateShard.get(shardIdToUuid.get(shardId)).getOldDeltaUuid(), toUpdateShard.get(shardIdToUuid.get(shardId)).getNewDeltaUuid()); } updatedCount += shardsAndIndexUpdater.execute(); } } if (updatedCount != shardIdToUuid.size()) { log.error("updatedCount is not equal to shardIdToUuid size"); throw transactionConflict(); } }</code><technical_language>for (long shardId : batch) {</technical_language>

Target:
private void updateShardsAndIndex(long tableId, Map<UUID, DeltaUuidPair> toUpdateShard, Handle handle) throws SQLException { if (toUpdateShard.isEmpty()) { return; } String args = Joiner.on(",").join(nCopies(toUpdateShard.size(), "?")); ImmutableMap.Builder<Long, UUID> shardMapBuilder = ImmutableMap.builder(); String selectShards = format("" + "SELECT shard_id, shard_uuid\n" + "FROM shards\n" + "WHERE shard_uuid IN (%s)", args); try (PreparedStatement statement = handle.getConnection().prepareStatement(selectShards)) { bindUuids(statement, toUpdateShard.keySet()); try (ResultSet rs = statement.executeQuery()) { while (rs.next()) { shardMapBuilder.put(rs.getLong("shard_id"), uuidFromBytes(rs.getBytes("shard_uuid"))); } } } Map<Long, UUID> shardIdToUuid = shardMapBuilder.build(); if (toUpdateShard.size() != shardIdToUuid.size()) { throw transactionConflict(); } int updatedCount = 0; try (ShardsAndIndexUpdater shardsAndIndexUpdater = new ShardsAndIndexUpdater(handle.getConnection(), tableId)) { for (List<Long> batch : partition(shardIdToUuid.keySet(), batchSize(handle.getConnection()))) { for (long shardId : batch) { shardsAndIndexUpdater.update( shardId, toUpdateShard.get(shardIdToUuid.get(shardId)).getOldDeltaUuid(), toUpdateShard.get(shardIdToUuid.get(shardId)).getNewDeltaUuid()); } updatedCount += shardsAndIndexUpdater.execute(); } } if (updatedCount != shardIdToUuid.size()) { log.error("updatedCount is not equal to shardIdToUuid size"); throw transactionConflict(); } }
Source:
<code>private boolean isVMsContainingBootableDisks(Disk diskInfo, List<VM> vms) { boolean vmsContainBootDisk = false; StringBuilder vmsContainingBootDisk = new StringBuilder(); for (VM vm : vms) { <START> VmHandler.updateDisksForVm(vm, getOtherVmDisks(vm.getId())); <END> for (Disk disk : vm.getDiskMap().values()) { if (disk.isBoot()) { if (vmsContainBootDisk) { vmsContainingBootDisk.append(", "); } vmsContainingBootDisk.append(vm.getName()); vmsContainBootDisk = true; } } } if (vmsContainBootDisk) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VMS_BOOT_IN_USE); getReturnValue().getCanDoActionMessages().add( String.format("$VmsName %1$s", vmsContainingBootDisk.toString())); return false; } return true; }</code><technical_language>1. suggest add a dao method -> loadVmBootDisk - reduce loaded data in other places well..we perform mass of queries. 2. do need this line? iterate returned disks getOther.</technical_language>

Target:
private boolean isVMsContainingBootableDisks(Disk diskInfo, List<VM> vms) { boolean vmsContainBootDisk = false; StringBuilder vmsContainingBootDisk = new StringBuilder(); for (VM vm : vms) { Disk bootDisk = getDiskDao().getVmBootDisk(vm.getId()); if (bootDisk != null) { if (vmsContainBootDisk) { vmsContainingBootDisk.append(", "); } vmsContainingBootDisk.append(vm.getName()); vmsContainBootDisk = true; } } if (vmsContainBootDisk) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VMS_BOOT_IN_USE); getReturnValue().getCanDoActionMessages().add( String.format("$VmsName %1$s", vmsContainingBootDisk.toString())); return false; } return true; }
Source:
<code>public Set<WorkerNetAddress> getWorkerAddresses() throws UnavailableException { if (mSafeModeManager.isInSafeMode()) { throw new UnavailableException(ExceptionMessage.MASTER_IN_SAFEMODE.getMessage()); } <START> Set<WorkerNetAddress> workerAddresses = new HashSet<>(); <END> for (MasterWorkerInfo worker : mWorkers) { workerAddresses.add(worker.getWorkerAddress()); } return workerAddresses; }</code><technical_language>(nit) Initialize initial capacity number of workers</technical_language>

Target:
public Set<WorkerNetAddress> getWorkerAddresses() throws UnavailableException { if (mSafeModeManager.isInSafeMode()) { throw new UnavailableException(ExceptionMessage.MASTER_IN_SAFEMODE.getMessage()); } Set<WorkerNetAddress> workerAddresses = new HashSet<>(mWorkers.size()); for (MasterWorkerInfo worker : mWorkers) { workerAddresses.add(worker.getWorkerAddress()); } return workerAddresses; }
Source:
<code>public void body(String body) { this.body = body; if (!contentLengthManuallySet) { String charsetValue = response.getCharacterEncoding() == null ? "ISO-8859-1" : response.getCharacterEncoding(); Charset charset = null; if (charset != null) { response.setContentLength(this.body.getBytes(charset).length); } else if (LOG.isDebugEnabled()) { LOG.debug("unable to retrieve charset for name '{}'", charsetValue); } <START> } <END> }</code><technical_language>i refractor this method if (!contentLengthManuallySet) { response.setContentLength(calculateContentLnegth(this.body)); } create a new method "calculateContentLnegth"</technical_language>

Target:
public void body(String body) { this.body = body; if (!contentLengthManuallySet) { calculateContentLength(); } }
Source:
<code>public ElasticSearchIndexProvider(MetaModelStore metaModelStore, ElasticSearchContext elasticSearchContext, Analyzer analyzer) { this.elasticMetaModel = new ElasticSearchMappingStore(this); this.metaModelStore = metaModelStore; this.elasticSearchContext = elasticSearchContext; this.analyzer = analyzer; <START> this.fieldFactory = new MappingFieldFactory(this.elasticMetaModel); <END> }</code><technical_language>field ElasticSearchMappingStore elasticMetaModel; confusing name. please rename mappingStore similar align name type</technical_language>

Target:
public ElasticSearchIndexProvider(MetaModelStore metaModelStore, ElasticSearchContext elasticSearchContext, Analyzer analyzer) { this.elasticSearchMappingStore = new ElasticSearchMappingStore(this); this.metaModelStore = metaModelStore; this.elasticSearchContext = elasticSearchContext; this.analyzer = analyzer; this.fieldFactory = new MappingFieldFactory(this.elasticSearchMappingStore); }
Source:
<code>public boolean execute(BlockComponentHolder component) { try { for (Component c : component.values()) { if (c.canTick()) { <START> c.tick(dt); <END> } } } catch (Exception e) { Spout.getLogger().log(Level.SEVERE, "Unhandled exception while ticking block component", e); } return true; }</code><technical_language>Formatting is off, try cover if (canTick(dt) { c.tick(dt); } 1 bad component prevent other components receiving ticks</technical_language>

Target:
public boolean execute(BlockComponentHolder component) { for (Component c : component.values()) { try { if (c.canTick()) { c.tick(dt); } } catch (Exception e) { Spout.getLogger().log(Level.SEVERE, "Unhandled exception while ticking block component", e); } } return true; }
Source:
<code>public KafkaSystemConsumer(Consumer<K, V> kafkaConsumer, String systemName, Config config, String clientId, KafkaConsumerProxyFactory<K, V> kafkaConsumerProxyFactory, KafkaSystemConsumerMetrics metrics, Clock clock) { super(metrics.registry(), clock, metrics.getClass().getName()); this.kafkaConsumer = kafkaConsumer; this.clientId = clientId; this.systemName = systemName; this.config = config; this.metrics = metrics; fetchThresholdBytesEnabled = new KafkaConfig(config).isConsumerFetchThresholdBytesEnabled(systemName); messageSink = new KafkaConsumerMessageSink(); <START> String metricName = String.format("%s-%s", systemName, clientId); <END> proxy = kafkaConsumerProxyFactory.create(this.messageSink); LOG.info("{}: Created proxy ", this, proxy); }</code><technical_language>Unused</technical_language>

Target:
public KafkaSystemConsumer(Consumer<K, V> kafkaConsumer, String systemName, Config config, String clientId, KafkaConsumerProxyFactory<K, V> kafkaConsumerProxyFactory, KafkaSystemConsumerMetrics metrics, Clock clock) { super(metrics.registry(), clock, metrics.getClass().getName()); this.kafkaConsumer = kafkaConsumer; this.clientId = clientId; this.systemName = systemName; this.config = config; this.metrics = metrics; fetchThresholdBytesEnabled = new KafkaConfig(config).isConsumerFetchThresholdBytesEnabled(systemName); messageSink = new KafkaConsumerMessageSink(); proxy = kafkaConsumerProxyFactory.create(this.messageSink); LOG.info("{}: Created proxy ", this, proxy); }
Source:
<code>protected String[] fillTypeCombo() { <START> ArrayList<String> <END> list = new ArrayList<>(); for(DataType dataType : EventTypeLibrary.getInstance().getEventTypes()){ list.add(dataType.getName()); } return list.toArray(new String[0]); }</code><technical_language>change List</technical_language>

Target:
protected String[] fillTypeCombo() { List<String> list = new ArrayList<>(); for(DataType dataType : EventTypeLibrary.getInstance().getEventTypes()){ list.add(dataType.getName()); } return list.toArray(new String[0]); }
Source:
<code>public Boolean isCgroupEnabled() { <START> return Optional.fromNullable(cgroupEnabled).or(false); <END> }</code><technical_language>Recommend adding default clause in analogy DEFAULT_CGROUP_PATH</technical_language>

Target:
public Boolean isCgroupEnabled() { return Optional.fromNullable(cgroupEnabled).or(DEFAULT_CGROUPS_ENABLED); }
Source:
<code>static RestApi config(Project.NameKey name) { <START> return ProjectApi.project(name).view("config"); <END> }</code><technical_language>ProjectApi. prefix is unnecessary, in class</technical_language>

Target:
static RestApi config(Project.NameKey name) { return project(name).view("config"); }
Source:
<code>public Response getWorkerConfigHistory( @QueryParam("interval") final String interval, @QueryParam("count") final Integer count ) { Interval theInterval = interval == null ? null : new Interval(interval); <START> if (theInterval == null && count != null && count > 0) { <END> return Response.ok( auditManager.fetchAuditHistory( WorkerBehaviorConfig.CONFIG_KEY, WorkerBehaviorConfig.CONFIG_KEY, count ) ) .build(); } return Response.ok( auditManager.fetchAuditHistory( WorkerBehaviorConfig.CONFIG_KEY, WorkerBehaviorConfig.CONFIG_KEY, theInterval ) ) .build(); }</code><technical_language>suggest returning bad request if count is equal zero</technical_language>

Target:
public Response getWorkerConfigHistory( @QueryParam("interval") final String interval, @QueryParam("count") final Integer count ) { Interval theInterval = interval == null ? null : new Interval(interval); if (theInterval == null && count != null) { try { return Response.ok( auditManager.fetchAuditHistory( WorkerBehaviorConfig.CONFIG_KEY, WorkerBehaviorConfig.CONFIG_KEY, count ) ) .build(); } catch (IllegalArgumentException e) { return Response.status(Response.Status.BAD_REQUEST) .entity(ImmutableMap.<String, Object>of("error", e.getMessage())) .build(); } } return Response.ok( auditManager.fetchAuditHistory( WorkerBehaviorConfig.CONFIG_KEY, WorkerBehaviorConfig.CONFIG_KEY, theInterval ) ) .build(); }
Source:
<code>public Response updateFields( @PathParam("typeIdOrVarName") final String typeIdOrVarName, final UpdateFieldForm updateFieldForm, @Context final HttpServletRequest req) throws DotDataException, DotSecurityException { <START> final InitDataObject initData = <END> this.webResource.init(null, true, req, true, null); final User user = initData.getUser(); final List<Field> fieldsToUpdate = updateFieldForm.getFields(); final ContentType contentType = APILocator.getContentTypeAPI(user).find(typeIdOrVarName); final FieldLayout fieldLayout = new FieldLayout(contentType.fields()); final FieldLayout fieldLayoutUpdated = fieldLayout.update(fieldsToUpdate); fieldLayoutUpdated.validate(); this.saveFields(fieldsToUpdate, user); return Response.ok(new ResponseEntityView(fieldLayoutUpdated.getRows())).build(); }</code><technical_language>I wondering if error handling is ok, return ResponseUtil.mapExceptionResponse(e);</technical_language>

Target:
public Response updateFields( @PathParam("typeIdOrVarName") final String typeIdOrVarName, final UpdateFieldForm updateFieldForm, @Context final HttpServletRequest req) throws DotDataException, DotSecurityException { final InitDataObject initData = this.webResource.init(null, true, req, true, null); final User user = initData.getUser(); final List<Field> fieldsToUpdate = updateFieldForm.getFields(); final ContentType contentType = APILocator.getContentTypeAPI(user).find(typeIdOrVarName); final FieldLayout fieldLayout = new FieldLayout(contentType.fields()); final FieldLayout fieldLayoutUpdated = fieldLayout.update(fieldsToUpdate); fieldLayoutUpdated.validate(); fieldAPI.saveFields(fieldsToUpdate, user); return Response.ok(new ResponseEntityView(fieldLayoutUpdated.getRows())).build(); }
Source:
<code><START> public int getKeyCode() { <END> return KeyCodes.KEY_M; }</code><technical_language>@jomarko I do if in test mapping "M" action (contextual menu) gave issues, I is safer another key, frequently for text insertion/editing, if a key combination</technical_language>

Target:
public int getKeyCode() { return KeyCodes.KEY_SPACE; }
Source:
<code>public void endElement(String uri, String localName, String qName) { if (currentV2Repository != null && localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORYV2)) { <START> taskRepositoriesV2.add(currentV2Repository); <END> currentV2Repository = null; } }</code><technical_language>this easily done creating repository well</technical_language>

Target:
public void endElement(String uri, String localName, String qName) { if (currentRepository != null && localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY)) { taskRepositories.add(currentRepository); currentRepository = null; } }
Source:
<code>protected String formatUndefined(String formatPattern) { String undefinedFormatPattern = formatPattern.replaceAll(IDENTIFY_FORMAT_PATTERN_PATTERN, "%1\\$s"); try { return String.format(undefinedFormatPattern, "-"); } catch (Exception e) { <START> logger.warn("Exception while formatting undefined value [sourcePattern={}, targetPattern={}, exception= ", <END> formatPattern, undefinedFormatPattern, e); return "Err"; } }</code><technical_language>format is broken: closing bracket is missing string placeholder for exception message is missing. Add provide a e.getMessage() instead of full exception</technical_language>

Target:
protected String formatUndefined(String formatPattern) { String undefinedFormatPattern = formatPattern.replaceAll(IDENTIFY_FORMAT_PATTERN_PATTERN, "%1\\$s"); try { return String.format(undefinedFormatPattern, "-"); } catch (Exception e) { logger.warn( "Exception while formatting undefined value [sourcePattern={}, targetPattern={}, exceptionMessage={}]", formatPattern, undefinedFormatPattern, e.getMessage()); return "Err"; } }
Source:
<code>public static void tearDown() { <START> System.clearProperty("spring.config.location"); <END> }</code><technical_language>restore previous blindly clearing</technical_language>

Target:
public static void tearDown() { if (originalConfigLocation != null) { System.setProperty("spring.config.location", originalConfigLocation); } }
Source:
<code>public TypeClass(final String name, final Type ... types) { this.name = name; Arrays.sort(types.clone()); <START> this.types = ImmutableList.copyOf(Arrays.asList(types)); <END> }</code><technical_language>asList needed</technical_language>

Target:
public TypeClass(final String name, final Type ... types) { this.name = name; Arrays.sort(types); this.types = ImmutableList.copyOf(types); }
Source:
<code>public static UserSqlSandbox getStaticStorage(String username) { <START> return new UserSqlSandbox(username, null); <END> }</code><technical_language>a UserSqlSandbox constructor doens't require argument for field, instead of assuming default for clarity</technical_language>

Target:
public static UserSqlSandbox getStaticStorage(String username) { return new UserSqlSandbox(username); }
Source:
<code>public HiveAnalyzeProperties(TypeManager typeManager) { analyzeProperties = ImmutableList.of( new PropertyMetadata<>( PARTITION_LIST_PROPERTY, "Partitions to be analyzed", typeManager.getType(parseTypeSignature("array(array(varchar))")), List.class, ImmutableList.of(), false, value -> ImmutableList.copyOf(((Collection<?>) value).stream() .map(partition -> ImmutableList.copyOf(((Collection<?>) partition).stream() <START> .map(name -> ((String) name).toLowerCase(ENGLISH)).collect(Collectors.toList()))) <END> .collect(Collectors.toList())), value -> value)); }</code><technical_language>toImmutableList() in places</technical_language>

Target:
public HiveAnalyzeProperties(TypeManager typeManager) { analyzeProperties = ImmutableList.of( new PropertyMetadata<>( PARTITIONS_PROPERTY, "Partitions to be analyzed", typeManager.getType(parseTypeSignature("array(array(varchar))")), List.class, null, false, HiveAnalyzeProperties::decodePartitionLists, value -> value)); }
Source:
<code>private String getMinishiftLoc(RuntimeDefinition runtimeDefinition) { String fromDef = (String) runtimeDefinition.getProperty(OVERRIDE_MINISHIFT_LOCATION); if (fromDef != null && !fromDef.isEmpty() && new File(fromDef).exists()) { return fromDef; } <START> return MinishiftBinaryUtility.getMinishiftLocation(); <END> }</code><technical_language>!doesNotExist(fromDef)</technical_language>

Target:
private String getMinishiftLoc(RuntimeDefinition runtimeDefinition) { String fromDef = (String) runtimeDefinition.getProperty(OVERRIDE_MINISHIFT_LOCATION); if (doesNotExist(fromDef)) { return fromDef; } return MinishiftBinaryUtility.getMinishiftLocation(); }
Source:
<code>public void testInit() { final DataTypeConstraintRangeView mocked = mock(DataTypeConstraintRangeView.class); doCallRealMethod().when(mocked).init(any()); mocked.init(presenter); <START> verify(mocked).setupInputFields(); <END> }</code><technical_language>change setup method this: java @Before public void setup() { view = spy(new DataTypeConstraintRangeView(startValue, endValue, includeStartValue, includeEndValue)); } ..to simplify this method this: java @Test public void testInit() { view.init(presenter); verify(view).setupInputFields(); }</technical_language>

Target:
public void testInit() { verify(view).setupInputFields(); }
Source:
<code>public static void detectLogoGcs() throws Exception { <START> String gcsUri = "gs://path/to/your/bucket/video.mp4"; <END> detectLogoGcs(gcsUri); }</code><technical_language>suggestion String gcsUri = "gs://YOUR_BUCKET_ID/path/to/your/video.mp4";</technical_language>

Target:
public static void detectLogoGcs() throws Exception { String gcsUri = "gs://YOUR_BUCKET_ID/path/to/your/video.mp4"; detectLogoGcs(gcsUri); }
Source:
<code>public String process(String query) { LOG.info("Processing query: {}", query); try { String path = getPath(query, LOG); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.POSITION.toString())) { final Map<PositionKey, PositionValue> positionData = PositionDataStore.getInstance() .getOrDefault(_connectorName, new ConcurrentHashMap<>()); final String response = JsonUtils.toJson(positionData); LOG.trace("Query: returns response: {}", query, response); return response; } else { LOG.warn("Could not process query with path {}", query, path); } } catch (Exception e) { <START> LOG.warn("Failed to process query {}", query, e); <END> } return null; }</code><technical_language>want propagate exception user</technical_language>

Target:
public String process(String query) { LOG.info("Processing query: {}", query); try { String path = getPath(query, LOG); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.POSITION.toString())) { final String response = processPositionRequest(); LOG.trace("Query: returns response: {}", query, response); return response; } else { LOG.warn("Could not process query with path {}", query, path); } } catch (Exception e) { LOG.warn("Failed to process query {}", query, e); throw new DatastreamRuntimeException(e); } return null; }
Source:
<code>public RsWithHeaders(final Response res, final Iterable<? extends CharSequence> headers) { super( new Response() { @Override @SuppressWarnings("unchecked") public Iterable<String> head() throws IOException { return new Concat<String>( res.head(), new Transformer<String, String>( new Transformer<CharSequence, String>( (Iterable<CharSequence>) headers, new TransformAction.ToString() ) <START> , new TransformAction.Trim() <END> ) ); } @Override public InputStream body() throws IOException { return res.body(); } } ); }</code><technical_language>@super132 coma, previous line</technical_language>

Target:
public RsWithHeaders(final Response res, final Iterable<? extends CharSequence> headers) { super( new Response() { @Override @SuppressWarnings("unchecked") public Iterable<String> head() throws IOException { return new Concat<String>( res.head(), new Transform<String, String>( new Transform<CharSequence, String>( (Iterable<CharSequence>) headers, new TransformAction.ToString() ), new TransformAction.Trim() ) ); } @Override public InputStream body() throws IOException { return res.body(); } } ); }
Source:
<code>private static int[] readArrayFromChannel(ReadableByteChannel channel) { int length = readIntFromByteChannel(channel); ByteBuffer tmpBuffer = ByteBuffer.allocate(length * INT_BYTES); try { while (tmpBuffer.hasRemaining() && (channel.read(tmpBuffer) >= 0)) { } } catch (Exception e) { e.printStackTrace(); <START> } <END> tmpBuffer.rewind(); IntBuffer intBuffer = tmpBuffer.asIntBuffer(); int[] array = new int[length]; intBuffer.get(array); return array; }</code><technical_language>above. throw exception further</technical_language>

Target:
private static int[] readArrayFromChannel(ReadableByteChannel channel) throws IOException { int length = readIntFromByteChannel(channel); ByteBuffer tmpBuffer = ByteBuffer.allocate(length * INT_BYTES); while (tmpBuffer.hasRemaining() && (channel.read(tmpBuffer) >= 0)) { } tmpBuffer.rewind(); IntBuffer intBuffer = tmpBuffer.asIntBuffer(); int[] array = new int[length]; intBuffer.get(array); return array; }
Source:
<code>public boolean containsNull() { Boolean r = containsNull; if (r == null) { r = false; reset(); <START> while (next()) { <END> Value[] row = currentRow; for (int i = 0; i < visibleColumnCount; i++) { if (row[i].containsNull()) { r = true; break; } } } reset(); containsNull = r; } return r; }</code><technical_language>while (next() && !r)</technical_language>

Target:
public boolean containsNull() { Boolean r = containsNull; if (r == null) { r = false; reset(); loop: while (next()) { Value[] row = currentRow; for (int i = 0; i < visibleColumnCount; i++) { if (row[i].containsNull()) { r = true; break loop; } } } reset(); containsNull = r; } return r; }
Source:
<code>public boolean isConnectedToMobileNetwork() { <START> if (androidVersion.isMarshmallowOrHigher()) { <END> return connectedToNetworkTypeForMarshmallow(ConnectivityManager.TYPE_MOBILE); } else { NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); return networkInfo != null && networkInfo.isConnected(); } }</code><technical_language>This is basically logic isConnectedToWifi() exception of network type, extract deduplicate</technical_language>

Target:
public boolean isConnectedToMobileNetwork() { return isConnectedTo(ConnectivityManager.TYPE_MOBILE); }
Source:
<code>public void testAsyncStreamTask() { Config config = new MapConfig(new HashMap<String, String>() { { this.put("task.class", TestAsyncStreamTask.class.getName()); } }); Object retFactory = TaskFactoryUtil.createTaskFactory(config); assertTrue(retFactory instanceof AsyncStreamTaskFactory); <START> assertTrue(((AsyncStreamTaskFactory) retFactory).createInstance() instanceof TestAsyncStreamTask); <END> config = new MapConfig(new HashMap<String, String>() { { this.put("task.class", "no.such.class"); } }); try { TaskFactoryUtil.createTaskFactory(config); fail("Should have failed w/ no.such.class"); } catch (ConfigException cfe) { } }</code><technical_language>Do test(s) for getTaskFactory</technical_language>

Target:
public void testAsyncStreamTask() { TaskFactory retFactory = TaskFactoryUtil.getTaskFactory(MockAsyncStreamTask.class.getName()); assertTrue(retFactory instanceof AsyncStreamTaskFactory); assertTrue(((AsyncStreamTaskFactory) retFactory).createInstance() instanceof MockAsyncStreamTask); try { TaskFactoryUtil.getTaskFactory("no.such.class"); fail("Should have failed w/ no.such.class"); } catch (ConfigException cfe) { } }
Source:
<code><START> public void findCashPoints_shouldReturnAnEmptyListIfNoCashpointsAreFound() throws Exception { <END> Location location = Context.getLocationService().getLocation(0); List<CashPoint> results = service.findCashPoints(location,"Test 1 Cash Point",false); Assert.assertNotNull(results); Assert.assertEquals(1,results.size()); }</code><technical_language>This test should. test a non-null list zero items is returned results</technical_language>

Target:
public void findCashPoints_shouldReturnAnEmptyListIfNoCashpointsAreFound() throws Exception { Location location = Context.getLocationService().getLocation(4); List<CashPoint> results = service.findCashPoints(location,"Test",false); Assert.assertNotNull(results); Assert.assertEquals(0,results.size()); }
Source:
<code>protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { String sentence = (String) msg; int slen = sentence.length(); if (slen <= 5) { return null; } if (sentence.charAt(0) != '$') { return null; } if (sentence.charAt(slen - 3) != '*') { return null; } int checksum = Integer.parseInt(sentence.substring(slen - 2), 16); <START> if (checksum != Checksum.xor(sentence.substring(1, slen - 3))) { <END> return null; } Parser parser = new Parser(PATTERN_ECHK, sentence); if (parser.matches()) { return handleEchk(sentence, checksum, parser, channel, remoteAddress); } parser = new Parser(PATTERN_AVRMC, sentence); if (parser.matches()) { return handleAvrmc(sentence, checksum, parser, channel, remoteAddress); } return null; }</code><technical_language>verify checksums. I recommend removing consistent other decoders</technical_language>

Target:
protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { String sentence = (String) msg; if (sentence.startsWith("$ECHK")) { if (channel != null) { channel.writeAndFlush(new NetworkMessage(sentence + "\r\n", remoteAddress)); } } else if (sentence.startsWith("$AVRMC")) { return decodeAvrmc(sentence, channel, remoteAddress); } return null; }
Source:
<code>public TaskData createTask(PrivilegeLevel level, Map<String, String> additionalAttributeValues) throws Exception { <START> if (!additionalAttributeValues.containsKey(TaskAttribute.SUMMARY) <END> || !additionalAttributeValues.containsKey(TaskAttribute.DESCRIPTION)) { throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.mylyn.bugzilla.tests", "need value for Summary and Description ")); } ITaskMapping initializationData = new TaskMapping() { @Override public String getProduct() { return "ManualTest"; } @Override public String getComponent() { return "ManualC1"; } }; BugzillaClient client = client(level); AbstractTaskDataHandler taskDataHandler = connector().getTaskDataHandler(); TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository()); TaskData taskData = new TaskData(mapper, repository().getConnectorKind(), repository().getRepositoryUrl(), ""); taskDataHandler.initializeTaskData(repository(), taskData, initializationData, null); for (String attributeKey : additionalAttributeValues.keySet()) { taskData.getRoot() .createMappedAttribute(attributeKey) .setValue(additionalAttributeValues.get(attributeKey)); } RepositoryResponse response = submitTask(taskData, client); String bugId = response.getTaskId(); return getTask(bugId, client); }</code><technical_language>Assert.isTrue() isLegal() fit imho</technical_language>

Target:
public TaskData createTask(PrivilegeLevel level, Map<String, String> additionalAttributeValues) throws Exception { Assert.isLegal(additionalAttributeValues.containsKey(TaskAttribute.SUMMARY) && additionalAttributeValues.containsKey(TaskAttribute.DESCRIPTION), "need value for Summary and Description "); ITaskMapping initializationData = new TaskMapping() { @Override public String getProduct() { return "ManualTest"; } @Override public String getComponent() { return "ManualC1"; } }; BugzillaClient client = client(level); AbstractTaskDataHandler taskDataHandler = connector().getTaskDataHandler(); TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository()); TaskData taskData = new TaskData(mapper, repository().getConnectorKind(), repository().getRepositoryUrl(), ""); taskDataHandler.initializeTaskData(repository(), taskData, initializationData, null); for (String attributeKey : additionalAttributeValues.keySet()) { taskData.getRoot() .createMappedAttribute(attributeKey) .setValue(additionalAttributeValues.get(attributeKey)); } RepositoryResponse response = submitTask(taskData, client); String bugId = response.getTaskId(); return getTask(bugId, client); }
Source:
<code>public void setUp() { directory = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "DeviceValues"); directory.mkdir(); <START> sprite = new Sprite("_sprite_"); <END> userVariable = new UserVariable("globalVarX", initialValue); localUserVariable = new UserVariable("localVarY", initialValue); sprite.addUserVariable(localUserVariable); accessor = new DeviceVariableAccessor(directory); }</code><technical_language>remove sprite remove global/local, test accessor</technical_language>

Target:
public void setUp() { directory = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "DeviceValues"); directory.mkdir(); userVariable = new UserVariable("globalVarX", initialValue); accessor = new DeviceVariableAccessor(directory); }
Source:
<code><START> private void flush(boolean waitForNewLine) { <END> if (this.count != 0) { if (this.count == lineSepBytes.length) { boolean isLineSep = true; for (int c = 0; c < lineSepBytes.length; ++c) { if (this.buf[c] != lineSepBytes[c]) { isLineSep = false; break; } } if (isLineSep) { this.reset(); return; } } byte[] theBytes = new byte[this.count]; System.arraycopy(this.buf, 0, theBytes, 0, this.count); if (waitForNewLine) { for (int c = 0; c < lineSepBytes.length; ++c) { if (this.count < lineSepBytes.length || theBytes[theBytes.length - lineSepBytes.length + c] != lineSepBytes[c]) { return; } } } this.logger.log(this.level, new String(theBytes)); this.reset(); } }</code><technical_language>i ask refactor this method please</technical_language>

Target:
private void flush(boolean waitForNewLine) { if (this.count != 0) { if (this.count == lineSepBytes.length) { boolean isLineSep = checkBufferIsLineSeparator(); if (isLineSep) { this.reset(); return; } } byte[] theBytes = new byte[this.count]; System.arraycopy(this.buf, 0, theBytes, 0, this.count); if (waitForNewLine) { for (int c = 0; c < lineSepBytes.length; ++c) { if (this.count < lineSepBytes.length || theBytes[theBytes.length - lineSepBytes.length + c] != lineSepBytes[c]) { return; } } } this.logger.log(this.level, new String(theBytes)); this.reset(); } }
Source:
<code>public void networkWithTheSameMTUAddedToNic() { Network net = createNetwork("nonVmMtu9000"); net.setVmNetwork(false); net.setMtu(9000); <START> Network newNet = createNetwork("vLanVmMtu9000"); <END> newNet.setMtu(9000); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNic("nic0", net.getName()); nic.setBridged(false); mockExistingIfaces(nic); SetupNetworksHelper helper = createHelper( createParametersForNics(nic, createVlan(nic.getName(), 100, newNet.getName()))); validateAndExpectNoViolations(helper); }</code><technical_language>set vlanId</technical_language>

Target:
public void networkWithTheSameMTUAddedToNic() { Network net = createNetwork("nonVmMtu9000"); net.setVmNetwork(false); net.setMtu(9000); Network newNet = createNetwork("VLanVmMtu9000"); newNet.setMtu(9000); newNet.setvlan_id(100); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNicSyncedWithNetwork("nic0", net); mockExistingIfaces(nic); SetupNetworksHelper helper = createHelper( createParametersForNics(nic, createVlan(nic.getName(), newNet.getvlan_id(), newNet.getName()))); validateAndExpectNoViolations(helper); }
Source:
<code>public Message read() { assert hasNext(); mNMessages = (mNMessages + 1) % mCheckMessagesPerSecond; if (mNMessages % mCheckMessagesPerSecond == 0) { RateLimitUtil.acquire(mCheckMessagesPerSecond); } MessageAndMetadata<byte[], byte[]> kafkaMessage = mIterator.next(); Long timestamp = null; if (mConfig.useKafkaTimestamp()) { <START> timestamp = mKafkaMessageTimestampFactory.create(mKafkaMessageTimestampClassName).getTimestamp(kafkaMessage); <END> } Message message = new Message(kafkaMessage.topic(), kafkaMessage.partition(), kafkaMessage.offset(), kafkaMessage.key(), kafkaMessage.message(), timestamp); TopicPartition topicPartition = new TopicPartition(message.getTopic(), message.getKafkaPartition()); updateAccessTime(topicPartition); long committedOffsetCount = mOffsetTracker.getTrueCommittedOffsetCount(topicPartition); LOG.debug("read message {}", message); if (mNMessages % mCheckMessagesPerSecond == 0) { exportStats(); } if (message.getOffset() < committedOffsetCount) { LOG.debug("skipping message because its offset precedes committed offset count {}", message, committedOffsetCount); return null; } return message; }</code><technical_language>Avoid calling reflection class creation time</technical_language>

Target:
public Message read() { assert hasNext(); mNMessages = (mNMessages + 1) % mCheckMessagesPerSecond; if (mNMessages % mCheckMessagesPerSecond == 0) { RateLimitUtil.acquire(mCheckMessagesPerSecond); } MessageAndMetadata<byte[], byte[]> kafkaMessage = mIterator.next(); long timestamp = (mConfig.useKafkaTimestamp()) ? mKafkaMessageTimestampFactory.getKafkaMessageTimestamp().getTimestamp(kafkaMessage) : 0l; Message message = new Message(kafkaMessage.topic(), kafkaMessage.partition(), kafkaMessage.offset(), kafkaMessage.key(), kafkaMessage.message(), timestamp); TopicPartition topicPartition = new TopicPartition(message.getTopic(), message.getKafkaPartition()); updateAccessTime(topicPartition); long committedOffsetCount = mOffsetTracker.getTrueCommittedOffsetCount(topicPartition); LOG.debug("read message {}", message); if (mNMessages % mCheckMessagesPerSecond == 0) { exportStats(); } if (message.getOffset() < committedOffsetCount) { LOG.debug("skipping message because its offset precedes committed offset count {}", message, committedOffsetCount); return null; } return message; }
Source:
<code>public FeedbackResponseCommentRow getComment() { FeedbackResponseCommentRow frc = new FeedbackResponseCommentRow(comment, comment.giverEmail, giverName, recipientName, showCommentToString, showGiverNameToString, getResponseVisibilities(), instructorEmailNameTable, sessionTimeZone); frc.enableEditDelete(); <START> String whoCanSeeComment; <END> boolean isVisibilityIconShown = !frc.getShowCommentToString().isEmpty(); if (isVisibilityIconShown) { whoCanSeeComment = getTypeOfPeopleCanViewComment(comment, question); frc.setVisibilityIcon(true, whoCanSeeComment); } return frc; }</code><technical_language>Declare this in line 46? scope small possible. need in if part, declare initialize</technical_language>

Target:
public FeedbackResponseCommentRow getComment() { FeedbackResponseCommentRow frc = new FeedbackResponseCommentRow(comment, comment.giverEmail, giverName, recipientName, showCommentToString, showGiverNameToString, getResponseVisibilities(), instructorEmailNameTable, sessionTimeZone, question); frc.enableEditDelete(); return frc; }
Source:
<code>public double getDouble() { <START> return beNull.getAsBoolean() ? 0L : baseSelector.getDouble(); <END> }</code><technical_language>returning defaultValueForNull instead of 0</technical_language>

Target:
public double getDouble() { return beNull.getAsBoolean() ? NullHandling.ZERO_DOUBLE : baseSelector.getDouble(); }
Source:
<code>public void shouldReportEnvironmentVariables() throws Exception { buildWork = (BuildWork) getWork(WITH_ENV_VAR, PIPELINE_NAME); buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, AgentRuntimeInfo.fromAgent(agentIdentifier, "cookie", null), packageAsRepositoryExtension, scmExtension, taskExtension); String consoleOut = artifactManipulator.consoleOut(); assertThat(trimTimeStamp(consoleOut), containsString("[go] setting environment variable 'GO_SERVER_URL' to value 'somewhere-does-not-matter'\n" + "[go] setting environment variable 'GO_TRIGGER_USER' to value ''\n" <START> + "[go] setting environment variable 'GO_PIPELINE_NAME' to value 'pipeline1'\n" <END> + "[go] setting environment variable 'GO_PIPELINE_COUNTER' to value '-2'\n" + "[go] setting environment variable 'GO_PIPELINE_LABEL' to value '100'\n" + "[go] setting environment variable 'GO_STAGE_NAME' to value 'mingle'\n" + "[go] setting environment variable 'GO_STAGE_COUNTER' to value '100'\n" + "[go] setting environment variable 'GO_JOB_NAME' to value 'run-ant'\n" + "[go] setting environment variable 'JOB_ENV' to value 'foobar'")); }</code><technical_language>I use: export GO_PIPELINE_NAME='pipeline1' I read better. maybe: export GO_PIPELINE_NAME='pipeline1' # Overridden Easier copy (of people need get rid of "[go] " part</technical_language>

Target:
public void shouldReportEnvironmentVariables() throws Exception { buildWork = (BuildWork) getWork(WITH_ENV_VAR, PIPELINE_NAME); buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, AgentRuntimeInfo.fromAgent(agentIdentifier, "cookie", null), packageAsRepositoryExtension, scmExtension, taskExtension); String consoleOut = artifactManipulator.consoleOut(); assertThat(consoleOut, matches("'GO_SERVER_URL' (to|with) value '" + SERVER_URL)); assertThat(consoleOut, matches("'GO_PIPELINE_LABEL' (to|with) value '" + PIPELINE_LABEL)); assertThat(consoleOut, matches("'GO_PIPELINE_NAME' (to|with) value '" + PIPELINE_NAME)); assertThat(consoleOut, matches("'GO_STAGE_NAME' (to|with) value '" + STAGE_NAME)); assertThat(consoleOut, matches("'GO_STAGE_COUNTER' (to|with) value '" + STAGE_COUNTER)); assertThat(consoleOut, matches("'GO_JOB_NAME' (to|with) value '" + JOB_PLAN_NAME)); assertThat(trimTimeStamp(consoleOut), containsString( "[go] setting environment variable 'JOB_ENV' to value 'foobar'\n" + "[go] overriding environment variable 'PATH' with value '/tmp'\n\n")); }
Source:
<code>public WriteContext init(Configuration configuration) { if (rootAvroSchema == null) { this.rootAvroSchema = new Schema.Parser().parse(configuration.get(AVRO_SCHEMA)); this.rootSchema = new AvroSchemaConverter().convert(rootAvroSchema); } if (model == null) { this.model = getDataModel(configuration); } boolean writeOldListStructure = configuration.getBoolean( <START> WRITE_OLD_LIST_STRUCTURE, WRITE_OLD_LIST_STRUCTURE_DEFAULT); <END> if (writeOldListStructure) { this.listWriter = new TwoLevelWriter(); } else { this.listWriter = new ThreeLevelWriter(); } Map<String, String> extraMetaData = new HashMap<String, String>(); extraMetaData.put(AvroReadSupport.AVRO_SCHEMA_METADATA_KEY, rootAvroSchema.toString()); return new WriteContext(rootSchema, extraMetaData); }</code><technical_language>this line is duplicated</technical_language>

Target:
public WriteContext init(Configuration configuration) { if (rootAvroSchema == null) { this.rootAvroSchema = new Schema.Parser().parse(configuration.get(AVRO_SCHEMA)); this.rootSchema = new AvroSchemaConverter().convert(rootAvroSchema); } if (model == null) { this.model = getDataModel(configuration); } boolean writeOldListStructure = configuration.getBoolean( WRITE_OLD_LIST_STRUCTURE, WRITE_OLD_LIST_STRUCTURE_DEFAULT); if (writeOldListStructure) { this.listWriter = new TwoLevelListWriter(); } else { this.listWriter = new ThreeLevelListWriter(); } Map<String, String> extraMetaData = new HashMap<String, String>(); extraMetaData.put(AvroReadSupport.AVRO_SCHEMA_METADATA_KEY, rootAvroSchema.toString()); return new WriteContext(rootSchema, extraMetaData); }
Source:
<code>public void deleteCodeSystemVersion(TermCodeSystemVersion theCodeSystemVersion) { <START> ourLog.info(" * Deleting code system version {}", theCodeSystemVersion.getCodeSystemVersionId()); <END> deleteCodeSystemVersion(theCodeSystemVersion.getPid()); }</code><technical_language>Is this referring CodeSystem.version a TermCodeSystemVersion? log output misleading TermCodeSystemVersion is internal specific HAPI FHIR end-users more familiar CodeSystem.version</technical_language>

Target:
public void deleteCodeSystemVersion(TermCodeSystemVersion theCodeSystemVersion) { ourLog.info(" * Deleting TermCodeSystemVersion {}", theCodeSystemVersion.getCodeSystemVersionId()); deleteCodeSystemVersion(theCodeSystemVersion.getPid()); }
Source:
<code>public void onPlayerSpawn(OnPlayerSpawnedEvent event, EntityRef player, InventoryComponent inventory) { BlockItemFactory blockItemFactory = new BlockItemFactory(entityManager); <START> inventoryManager.giveItem(player, player, entityManager.create("MasterOfOreon:selectionTool")); <END> inventoryManager.giveItem(player, player, blockItemFactory.newInstance(blockManager.getBlockFamily("MasterOfOreon:portal"), 10)); }</code><technical_language>another constant prefab name</technical_language>

Target:
public void onPlayerSpawn(OnPlayerSpawnedEvent event, EntityRef player, InventoryComponent inventory) { BlockItemFactory blockItemFactory = new BlockItemFactory(entityManager); inventoryManager.giveItem(player, player, entityManager.create(Constants.SELECTION_TOOL_PREFAB)); inventoryManager.giveItem(player, player, blockItemFactory.newInstance(blockManager.getBlockFamily(Constants.PORTAL_PREFAB), 10)); }
Source:
<code>public ObjectSpecification download(String objectId, long offset, long length, boolean forExternalUse) { try { <START> checkAnalysisState(metadataService.getEntity(objectId)); <END> checkArgument(offset > -1L); val objectSpec = getSpecification(objectId); if (!forExternalUse && (offset == 0L && length < 0L)) { return objectSpec; } if (!forExternalUse && (length < 0L)) { length = objectSpec.getObjectSize() - offset; } if ((offset + length) > objectSpec.getObjectSize()) { throw new InternalUnrecoverableError("Specified parameters exceed object size (object id: " + objectId + ", offset: " + offset + ", length: " + length + ")"); } val objectKey = ObjectKeys.getObjectKey(dataDir, objectId); List<Part> parts; if (forExternalUse) { parts = partCalculator.specify(0L, -1L); } else { parts = partCalculator.divide(offset, length); } fillPartUrls(objectKey, parts, objectSpec.isRelocated(), forExternalUse); return new ObjectSpecification(objectKey.getKey(), objectId, objectId, parts, length, objectSpec.getObjectMd5(), objectSpec.isRelocated()); } catch (Exception e) { log.error("Failed to download objectId: {}, offset: {}, length: {}, forExternalUse: {}: ", objectId, offset, length, forExternalUse, e); throw e; } }</code><technical_language>please rename this checkPublishedAnalysisState. uploadService, change name checkUnpublishedAnalysisState</technical_language>

Target:
public ObjectSpecification download(String objectId, long offset, long length, boolean forExternalUse) { try { checkPublishedAnalysisState(metadataService.getEntity(objectId)); checkArgument(offset > -1L); val objectSpec = getSpecification(objectId); if (!forExternalUse && (offset == 0L && length < 0L)) { return objectSpec; } if (!forExternalUse && (length < 0L)) { length = objectSpec.getObjectSize() - offset; } if ((offset + length) > objectSpec.getObjectSize()) { throw new InternalUnrecoverableError("Specified parameters exceed object size (object id: " + objectId + ", offset: " + offset + ", length: " + length + ")"); } val objectKey = ObjectKeys.getObjectKey(dataDir, objectId); List<Part> parts; if (forExternalUse) { parts = partCalculator.specify(0L, -1L); } else { parts = partCalculator.divide(offset, length); } fillPartUrls(objectKey, parts, objectSpec.isRelocated(), forExternalUse); return new ObjectSpecification(objectKey.getKey(), objectId, objectId, parts, length, objectSpec.getObjectMd5(), objectSpec.isRelocated()); } catch (Exception e) { log.error("Failed to download objectId: {}, offset: {}, length: {}, forExternalUse: {}: ", objectId, offset, length, forExternalUse, e); throw e; } }
Source:
<code>private void preprocessUpdatedIssues(List<Model> newModels) { for (Model model : newModels) { assert models.containsKey(model.getRepoId()); Model existingModel = models.get(model.getRepoId()); if (!existingModel.getIssues().equals(model.getIssues())) { for (int i = 1; i <= model.getIssues().size(); i++) { if (!existingModel.getIssueById(i).equals(model.getIssueById(i))) { assert model.getIssueById(i).isPresent(); if (model.getIssueById(i).get().getUpdatedAt().isAfter(model.getIssueById(i).get().getMarkedReadAt().get())) { model.getIssueById(i).get().setIsCurrentlyRead(false); <START> } <END> } } } } }</code><technical_language>some time check? situation in concern update arrives a seconds marking read. If arrived later, recognized a legitimate update</technical_language>

Target:
private void preprocessUpdatedIssues(List<Model> newModels) { for (Model model : newModels) { assert models.containsKey(model.getRepoId()); Model existingModel = models.get(model.getRepoId()); if (existingModel.getIssues().equals(model.getIssues())) continue; for (int i = 1; i <= model.getIssues().size(); i++) { if (existingModel.getIssueById(i).equals(model.getIssueById(i)) || !wasNotJustMarkedAsRead(model.getIssueById(i).get())) continue; assert model.getIssueById(i).isPresent(); model.getIssueById(i).get().setIsCurrentlyRead(false); } } }
Source:
<code>public String toString() { final List<String> dimStrs = dims == null ? ImmutableList.<String>of() : Lists.transform( Arrays.asList(dims), new Function<int[], String>() { @Nullable @Override public String apply(int[] input) { <START> return input == null ? "null" : Arrays.toString(input); <END> } } ); return "Rowboat{" + "timestamp=" + new DateTime(timestamp).toString() + ", dims=" + dimStrs + ", metrics=" + (metrics == null ? null : Arrays.asList(metrics)) + ", comprisedRows=" + comprisedRows + '}'; }</code><technical_language>Arrays.toString returns "null" if pass null</technical_language>

Target:
public String toString() { return "Rowboat{" + "timestamp=" + new DateTime(timestamp).toString() + ", dims=" + Arrays.deepToString(dims) + ", metrics=" + Arrays.toString(metrics) + ", comprisedRows=" + comprisedRows + '}'; }
Source:
<code>private void verbose(Definition def) { <START> sw.printTotal("Total"); <END> if (context.globalOptions.verbose) { def.printStatistics(); } }</code><technical_language>move invocation of CountNodes here</technical_language>

Target:
private void verbose(Definition def) { sw.printTotal("Total"); if (context.globalOptions.verbose) { CountNodesVisitor visitor = new CountNodesVisitor(); visitor.visitNode(def); printStatistics(visitor); } }
Source:
<code>public Builder addOption(String key, long value) { <START> return addOption(key, value + ""); <END> }</code><technical_language>Integer.toString(value)</technical_language>

Target:
public Builder addOption(String key, long value) { return addOption(key, Long.toString(value)); }