auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Bitmap centerInside(@NonNull BitmapPool pool, @NonNull Bitmap inBitmap, int width, int height) { if (inBitmap.getWidth() == width && inBitmap.getHeight() == height) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "requested target size matches input, returning input"); } return inBitmap; } if (inBitmap.getWidth() > width || inBitmap.getHeight() > height) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "requested target size too big for input, fit centering instead"); } return fitCenter(pool, inBitmap, width, height); } final int horizontalPadding = (width - inBitmap.getWidth()) / 2; final int verticalPadding = (height - inBitmap.getHeight()) / 2; Bitmap.Config config = getSafeConfig(inBitmap); <START> Bitmap toReuse = pool.get(width, height, config); <END> TransformationUtils.setAlpha(inBitmap, toReuse); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "request: " + width + "x" + height); Log.v(TAG, "toCenter: " + inBitmap.getWidth() + "x" + inBitmap.getHeight()); Log.v(TAG, "toReuse: " + toReuse.getWidth() + "x" + toReuse.getHeight()); Log.v(TAG, "padding: " + horizontalPadding + "x" + verticalPadding); } Canvas canvas = new Canvas(toReuse); canvas.drawBitmap(inBitmap, horizontalPadding, verticalPadding, DEFAULT_PAINT); clear(canvas); return toReuse; }</code><technical_language>Pool return null (at in 3.0 did)</technical_language>

Target:
public static Bitmap centerInside(@NonNull BitmapPool pool, @NonNull Bitmap inBitmap, int width, int height) { if (inBitmap.getWidth() <= width && inBitmap.getHeight() <= height) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "requested target size larger or equal to input, returning input"); } return inBitmap; } else { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "requested target size too big for input, fit centering instead"); } return fitCenter(pool, inBitmap, width, height); } }
Source:
<code>public void do_not_display_submitter_param_in_log_when_submitterLogin_is_not_set_in_case_of_success() throws Exception { when(queue.peek(anyString())).thenReturn(Optional.of(createCeTask(null))); taskProcessorRepository.setProcessorForTask(CeTaskTypes.REPORT, taskProcessor); underTest.call(); verifyWorkerUuid(); List<String> logs = logTester.logs(LoggerLevel.INFO); assertThat(logs).hasSize(2); for (int i = 0; i < 2; i++) { <START> assertThat(logs.get(i)).doesNotContain("lgsubmitter="); <END> } }</code><technical_language>"lg" weird..</technical_language>

Target:
public void do_not_display_submitter_param_in_log_when_submitterLogin_is_not_set_in_case_of_success() throws Exception { when(queue.peek(anyString())).thenReturn(Optional.of(createCeTask(null))); taskProcessorRepository.setProcessorForTask(CeTaskTypes.REPORT, taskProcessor); underTest.call(); verifyWorkerUuid(); List<String> logs = logTester.logs(LoggerLevel.INFO); assertThat(logs).hasSize(2); for (int i = 0; i < 2; i++) { assertThat(logs.get(i)).doesNotContain(" | submitter="); } }
Source:
<code>public void testInsertNewFieldIfDataTypeIsStructureWhenDataTypeIsNotStructure() { final DataType dataType = mock(DataType.class); <START> <END> when(dataTypeSelectComponent.getValue()).thenReturn("String"); when(dataType.getSubDataTypes()).thenReturn(emptyList()); doReturn(dataType).when(listItem).getDataType(); listItem.insertNewFieldIfDataTypeIsStructure(); verify(listItem, never()).insertNestedField(); }</code><technical_language>please update method name. I name **IfDataTypeIsStructure** **WhenDataTypeIsStructure**</technical_language>

Target:
public void testInsertNewFieldIfDataTypeIsStructureWhenDataTypeIsNotStructure() { final DataType dataType = mock(DataType.class); final String hash = "hash"; when(dataTypeSelectComponent.getValue()).thenReturn("String"); when(dataType.getSubDataTypes()).thenReturn(emptyList()); doReturn(dataType).when(listItem).getDataType(); listItem.insertNewFieldIfDataTypeIsStructure(hash); verify(dataTypeList, never()).insertNestedField(anyString()); }
Source:
<code>public DynamicSchemaResolver(List<String> additionalFields) { ConfigurationStore.getInstance().addConfigurationListener(this); this.schemaFields = new SchemaFields(); metadataMaximumBytes = getMetadataSizeLimit(); <START> caseInsensitiveSort = "true".equals(System.getProperty("solr.sort.case-insensitive")); <END> fieldsCache.add(Metacard.ID + SchemaFields.TEXT_SUFFIX); fieldsCache.add(Metacard.ID + SchemaFields.TEXT_SUFFIX + SchemaFields.TOKENIZED); fieldsCache.add( Metacard.ID + SchemaFields.TEXT_SUFFIX + SchemaFields.TOKENIZED + SchemaFields.HAS_CASE); fieldsCache.add(Metacard.TAGS + SchemaFields.TEXT_SUFFIX); anyTextFieldsCache.add(Metacard.METADATA + SchemaFields.TEXT_SUFFIX); fieldsCache.add(Validation.VALIDATION_ERRORS + SchemaFields.TEXT_SUFFIX); fieldsCache.add(Validation.VALIDATION_WARNINGS + SchemaFields.TEXT_SUFFIX); fieldsCache.add(SchemaFields.METACARD_TYPE_FIELD_NAME); fieldsCache.add(SchemaFields.METACARD_TYPE_OBJECT_FIELD_NAME); addAdditionalFields(this, additionalFields); filterAnyTextFieldCache(); }</code><technical_language>is solr.query. system property I working a PR add another one. consider making this solr.query.sort.caseInsensitive. <LINK_0></technical_language>

Target:
public DynamicSchemaResolver(List<String> additionalFields) { schemaFields = new SchemaFields(); metadataMaximumBytes = getMetadataSizeLimit(); anyTextFields = getAnyTextFields(); caseInsensitiveSort = "true".equals(System.getProperty("solr.query.sort.caseInsensitive")); try { textSortCharacterLimit = Integer.parseInt(System.getProperty("solr.index.sort.characterLimit", "127").trim()); } catch (NumberFormatException nfe) { LOGGER.warn("Invalid sorting character limit, defaulting to 127", nfe); textSortCharacterLimit = 127; } fieldsCache.add(Metacard.ID + SchemaFields.TEXT_SUFFIX); fieldsCache.add(Metacard.ID + SchemaFields.TEXT_SUFFIX + SchemaFields.TOKENIZED); fieldsCache.add( Metacard.ID + SchemaFields.TEXT_SUFFIX + SchemaFields.TOKENIZED + SchemaFields.HAS_CASE); fieldsCache.add(SchemaFields.METACARD_TYPE_FIELD_NAME); fieldsCache.add(SchemaFields.METACARD_TYPE_OBJECT_FIELD_NAME); addAdditionalFields(this, additionalFields); }
Source:
<code>void methodOne() { <START> Anon foo = new Anon() { <END> public void foo() { this.doSideEffect(); } public void doSideEffect() }; new Anon() { public void foo() { new Anon() { private int anonMember; private String name; public void foo() { int anonMember = 0; this.anonMember++; this.name = "something"; } }; } }; }</code><technical_language>add int field;</technical_language>

Target:
void methodOne() { Anon foo = new Anon() { public void foo() { this.doSideEffect(); } public void doSideEffect() }; this.bar = 0; new Anon() { public void foo() { new Anon() { private int anonMember; private String name; public void foo() { int anonMember = 0; this.anonMember++; this.name = "something"; } }; } }; }
Source:
<code>static void modifyRegistration(OperationContext context, ModelNode op) { final MutableDiscoveryProvider mutableDiscoveryProvider = context.getCapabilityRuntimeAPI(DiscoveryExtension.DISCOVERY_PROVIDER_CAPABILITY, context.getCurrentAddressValue(), MutableDiscoveryProvider.class); if (op.hasDefined(DiscoveryExtension.PROVIDERS)) { <START> final List<ModelNode> list = op.require(DiscoveryExtension.PROVIDERS).asList(); <END> if (list.isEmpty()) { mutableDiscoveryProvider.setDiscoveryProvider(DiscoveryProvider.EMPTY); } else { final DiscoveryProvider[] providers = new DiscoveryProvider[list.size()]; int i = 0; for (ModelNode modelNode : list) { final String name = modelNode.asString(); providers[i ++] = context.getCapabilityRuntimeAPI(DiscoveryExtension.DISCOVERY_PROVIDER_CAPABILITY, name, DiscoveryProvider.class); } final DiscoveryProvider discoveryProvider = new AggregateDiscoveryProvider(providers); mutableDiscoveryProvider.setDiscoveryProvider(discoveryProvider); } } else { mutableDiscoveryProvider.setDiscoveryProvider(DiscoveryProvider.EMPTY); } }</code><technical_language>List<String> list = AggregateProviderDefinition.PROVIDER_NAMES.unwrap(context, op); AggregateProviderDefinition.PROVIDER_NAMES.resolveModelAttribute(context, op);</technical_language>

Target:
static void modifyRegistration(OperationContext context, ModelNode op) throws OperationFailedException { final MutableDiscoveryProvider mutableDiscoveryProvider = context.getCapabilityRuntimeAPI(DiscoveryExtension.DISCOVERY_PROVIDER_CAPABILITY, context.getCurrentAddressValue(), MutableDiscoveryProvider.class); final ModelNode model = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); if (model.hasDefined(DiscoveryExtension.PROVIDERS)) { final List<String> list = AggregateProviderDefinition.PROVIDER_NAMES.unwrap(context, model); if (list.isEmpty()) { mutableDiscoveryProvider.setDiscoveryProvider(DiscoveryProvider.EMPTY); } else { final DiscoveryProvider[] providers = new DiscoveryProvider[list.size()]; int i = 0; for (String name : list) { providers[i ++] = context.getCapabilityRuntimeAPI(DiscoveryExtension.DISCOVERY_PROVIDER_CAPABILITY, name, DiscoveryProvider.class); } final DiscoveryProvider discoveryProvider = new AggregateDiscoveryProvider(providers); mutableDiscoveryProvider.setDiscoveryProvider(discoveryProvider); } } else { mutableDiscoveryProvider.setDiscoveryProvider(DiscoveryProvider.EMPTY); } }
Source:
<code>private static <AutoClosableWrapper extends AutoCloseable & Wrapper> void close(AutoClosableWrapper dbObject) { if (dbObject != null) { try { dbObject.close(); dbObject = null; } catch (SQLRecoverableException ex) { <START> handleSQLRecoverableException(dbObject, ex, true); <END> } catch (SQLException e) { log.error("Database error. Could not close statement. Continuing with others. - " + e.getMessage(), e); } catch (Exception e) { log.error("Generic error occurred during close operation" + e.getMessage(), e); } } }</code><technical_language>IMO, handling connection close if fails connection pool implementation. Retying for a time feel right. clarify rationale this</technical_language>

Target:
private static <AutoClosableWrapper extends AutoCloseable & Wrapper> void close(AutoClosableWrapper dbObject) { if (dbObject != null) { try { dbObject.close(); } catch (SQLRecoverableException ex) { handleSQLRecoverableException(dbObject, ex); } catch (SQLException e) { log.error("Database error. Could not close statement. Continuing with others. - " + e.getMessage(), e); } catch (Exception e) { log.error("An unknown error occurred during close operation" + e.getMessage(), e); } finally { dbObject = null; } } }
Source:
<code>public @Nullable Integer getThreadOnCpuAtTime(int cpu, long time) { ITmfStateSystem stateSystem = getStateSystem(); if (stateSystem == null) { return null; } Integer tid = null; if (time < stateSystem.getStartTime() || time > stateSystem.getCurrentEndTime()) { <START> return tid; <END> } try { int cpuQuark = stateSystem.optQuarkAbsolute(Integer.toString(cpu)); if (cpuQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return null; } ITmfStateValue value = stateSystem.querySingleState(time, cpuQuark).getStateValue(); if (value.getType().equals(Type.INTEGER)) { tid = value.unboxInt(); } } catch (StateSystemDisposedException e) { Activator.getDefault().logError(NonNullUtils.nullToEmptyString(e.getMessage()), e); } return tid; }</code><technical_language>bikeshedding, return null put tid under</technical_language>

Target:
public @Nullable Integer getThreadOnCpuAtTime(int cpu, long time) { ITmfStateSystem stateSystem = getStateSystem(); if (stateSystem == null) { return null; } if (time < stateSystem.getStartTime()) { return null; } Integer tid = null; try { int cpuQuark = stateSystem.optQuarkAbsolute(Integer.toString(cpu)); if (cpuQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return null; } ITmfStateValue value = stateSystem.querySingleState(time, cpuQuark).getStateValue(); if (value.getType().equals(Type.INTEGER)) { tid = value.unboxInt(); } } catch (StateSystemDisposedException | TimeRangeException e) { Activator.getDefault().logError(NonNullUtils.nullToEmptyString(e.getMessage()), e); } return tid; }
Source:
<code><START> protected ArrayList<Object> doProjection(Tuple tuple1, Tuple tuple2) { <END> if(streamLineProjection) return doStreamlineProjection(tuple1, tuple2); ArrayList<Object> result = new ArrayList<>(outputFields.length); for ( int i = 0; i < outputFields.length; i++ ) { FieldSelector outField = outputFields[i]; Object field = findField(outField, tuple1) ; if (field==null) field = findField(outField, tuple2); result.add(field); } return result; }</code><technical_language>constrain List<Object> instead of ArrayList<Object></technical_language>

Target:
protected List<Object> doProjection(Tuple tuple1, Tuple tuple2) { ArrayList<Object> result = new ArrayList<>(outputFields.length); for ( int i = 0; i < outputFields.length; i++ ) { FieldSelector outField = outputFields[i]; Object field = outField.findField(tuple1) ; if (field==null) field = outField.findField(tuple2); result.add(field); } return result; }
Source:
<code>public void remove() { if (!config.hasRequiredAdminProps()) { throw new IllegalArgumentException("Admin configuration is missing required properties"); } Preconditions.checkArgument( !ZookeeperUtil.parseRoot(config.getInstanceZookeepers()).equals("/"), "The Zookeeper connection string (set by 'fluo.connection.zookeepers') " + " must have a chroot suffix."); <START> if (OracleServerUtils.oracleExists(getAppCurator())) { <END> throw new FluoException("You must stop the oracle server to remove an application"); } Connector conn = AccumuloUtil.getConnector(config); boolean tableExists = conn.tableOperations().exists(config.getAccumuloTable()); if (tableExists) { logger.info("The Accumulo table '{}' will be dropped", config.getAccumuloTable()); try { conn.tableOperations().delete(config.getAccumuloTable()); } catch (Exception e) { throw new RuntimeException(e); } } try { if (rootCurator.checkExists().forPath(appRootDir) != null) { logger.info("Clearing Fluo '{}' application in Zookeeper at {}", config.getApplicationName(), config.getAppZookeepers()); rootCurator.delete().deletingChildrenIfNeeded().forPath(appRootDir); } } catch (KeeperException.NoNodeException nne) { } catch (Exception e) { logger.error("An error occurred deleting Zookeeper root of [" + config.getAppZookeepers() + "], error=[" + e.getMessage() + "]"); throw new RuntimeException(e); } }</code><technical_language>This is a nice check. drop error message stop oracle server remove application</technical_language>

Target:
public void remove() { if (!config.hasRequiredAdminProps()) { throw new IllegalArgumentException("Admin configuration is missing required properties"); } Preconditions.checkArgument( !ZookeeperUtil.parseRoot(config.getInstanceZookeepers()).equals("/"), "The Zookeeper connection string (set by 'fluo.connection.zookeepers') " + " must have a chroot suffix."); if (OracleServerUtils.oracleExists(getAppCurator())) { throw new FluoException("Must stop the oracle server to remove an application"); } Connector conn = AccumuloUtil.getConnector(config); boolean tableExists = conn.tableOperations().exists(config.getAccumuloTable()); if (tableExists) { logger.info("The Accumulo table '{}' will be dropped", config.getAccumuloTable()); try { conn.tableOperations().delete(config.getAccumuloTable()); } catch (Exception e) { throw new RuntimeException(e); } } try { if (rootCurator.checkExists().forPath(appRootDir) != null) { logger.info("Clearing Fluo '{}' application in Zookeeper at {}", config.getApplicationName(), config.getAppZookeepers()); rootCurator.delete().deletingChildrenIfNeeded().forPath(appRootDir); } } catch (KeeperException.NoNodeException nne) { } catch (Exception e) { logger.error("An error occurred deleting Zookeeper root of [" + config.getAppZookeepers() + "], error=[" + e.getMessage() + "]"); throw new RuntimeException(e); } }
Source:
<code>public void testExecute_curlLoggerWithContentEncoding() throws Exception { LogRecordingHandler recorder = new LogRecordingHandler(); HttpTransport.LOGGER.setLevel(Level.CONFIG); HttpTransport.LOGGER.addHandler(recorder); String contentValue = "hello"; byte[] bytes = StringUtils.getBytesUtf8(contentValue); InputStreamContent content = new InputStreamContent( new HttpMediaType("text/plain").setCharsetParameter(Charsets.UTF_8).build(), new ByteArrayInputStream(bytes)); new MockHttpTransport() .createRequestFactory() .buildPostRequest(new GenericUrl("<LINK_0>'b'c"), content) .setEncoding(new GZipEncoding()) .execute(); boolean found = false; for (String message : recorder.messages()) { if (message.startsWith("curl")) { found = true; <START> assert(message.contains("curl -v --compressed -X POST -H 'Accept-Encoding: gzip'")); <END> assert(message.contains("-H 'User-Agent: " + HttpRequest.USER_AGENT_SUFFIX + "'")); assert(message.contains("-H 'Content-Type: text/plain; charset=UTF-8' -H 'Content-Encoding: gzip'")); assert(message.contains("-d '@-' -- '<LINK_0>'\"'\"'b'\"'\"'c' << $$$")); } } assertTrue(found); }</code><technical_language>assertTrue</technical_language>

Target:
public void testExecute_curlLoggerWithContentEncoding() throws Exception { LogRecordingHandler recorder = new LogRecordingHandler(); HttpTransport.LOGGER.setLevel(Level.CONFIG); HttpTransport.LOGGER.addHandler(recorder); String contentValue = "hello"; byte[] bytes = StringUtils.getBytesUtf8(contentValue); InputStreamContent content = new InputStreamContent( new HttpMediaType("text/plain").setCharsetParameter(Charsets.UTF_8).build(), new ByteArrayInputStream(bytes)); new MockHttpTransport() .createRequestFactory() .buildPostRequest(new GenericUrl("<LINK_0>'b'c"), content) .setEncoding(new GZipEncoding()) .execute(); boolean found = false; for (String message : recorder.messages()) { if (message.startsWith("curl")) { found = true; assertTrue(message.contains("curl -v --compressed -X POST -H 'Accept-Encoding: gzip'")); assertTrue(message.contains("-H 'User-Agent: " + HttpRequest.USER_AGENT_SUFFIX + "'")); assertTrue(message.contains("-H 'Content-Type: text/plain; charset=UTF-8' -H 'Content-Encoding: gzip'")); assertTrue(message.contains("-d '@-' -- '<LINK_0>'\"'\"'b'\"'\"'c' << $$$")); } } assertTrue(found); }
Source:
<code>private void handleUnmanagedCommands() { List<AsyncTask> asyncTasks = asyncTaskDao.getAll(); Set<Guid> asyncTaskManagerManagedCommands = asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getRootCommandId()).collect(Collectors.toSet()); asyncTaskManagerManagedCommands.addAll(asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getCommandId()).collect(Collectors.toSet())); ENDED_WITH_FAILURE. getCommands(false).stream() .filter(x -> !x.isCallbackEnabled()) .filter(x -> x.getCommandStatus() == CommandStatus.ACTIVE) .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) .forEach(x -> commandsCache.updateCommandStatus(x.getId(), CommandStatus.ENDED_WITH_FAILURE)); getCommands(false).stream() .filter(x -> x.isCallbackEnabled()) <START> .filter(x -> x.getCommandStatus().isDuringExecution()) <END> .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) .forEach(x -> retrieveCommand(x.getId()).reacquireLocks()); }</code><technical_language>I assume add filter(x -> !x.getCommandStatus().isCallbackNotified) commands fail endAction() reach END_SUCCESFULLY/ENDED_WITH_FAILURE statuses (but locks released part of endAction())</technical_language>

Target:
private void handleUnmanagedCommands() { List<AsyncTask> asyncTasks = asyncTaskDao.getAll(); Set<Guid> asyncTaskManagerManagedCommands = asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getRootCommandId()).collect(Collectors.toSet()); asyncTaskManagerManagedCommands.addAll(asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getCommandId()).collect(Collectors.toSet())); ENDED_WITH_FAILURE. getCommands(false).stream() .filter(x -> !x.isCallbackEnabled()) .filter(x -> x.getCommandStatus() == CommandStatus.ACTIVE) .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) .forEach(x -> commandsCache.updateCommandStatus(x.getId(), CommandStatus.ENDED_WITH_FAILURE)); getCommands(false).stream() .filter(x -> x.isCallbackEnabled()) .filter(x -> !x.isCallbackNotified()) .filter(x -> x.getCommandStatus().isDuringExecution()) .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) .forEach(x -> retrieveCommand(x.getId()).reacquireLocks()); }
Source:
<code>private ConfigNodeInclude parseInclude(ArrayList<AbstractConfigNode> children) { Token t = nextTokenIgnoringWhitespace(children); if (Tokens.isUnquotedText(t)) { String kind = Tokens.getUnquotedText(t); if (kind.equals("url(")) { } else if (kind.equals("file(")) { } else if (kind.equals("classpath(")) { } else { throw parseError("expecting include parameter to be quoted filename, file(), classpath(), or url(). No spaces are allowed before the open paren. Not expecting: " + t); } children.add(new ConfigNodeSingleToken(t)); t = nextTokenIgnoringWhitespace(children); String name; if (!Tokens.isValueWithType(t, ConfigValueType.STRING)) { throw parseError("expecting a quoted string inside file(), classpath(), or url(), rather than: " + t); } children.add(new ConfigNodeSimpleValue(t)); t = nextTokenIgnoringWhitespace(children); if (Tokens.isUnquotedText(t) && Tokens.getUnquotedText(t).equals(")")) { } else { throw parseError("expecting a close parentheses ')' here, not: " + t); } } else if (Tokens.isValueWithType(t, ConfigValueType.STRING)) { children.add(new ConfigNodeSimpleValue(t)); } else { throw parseError("include keyword is not followed by a quoted string, but by: " + t); } <START> return new ConfigNodeInclude(children); <END> }</code><technical_language>list of include types (url, file, classpath) parsed in this parseInclude method, toss result, expect switch url/file/classpath is in code - I place in code strings (url, file, classpath, error) other places pre-parsed work with. some ideas consolidate</technical_language>

Target:
private ConfigNodeInclude parseInclude(ArrayList<AbstractConfigNode> children) { Token t = nextTokenCollectingWhitespace(children); if (Tokens.isUnquotedText(t)) { String kindText = Tokens.getUnquotedText(t); ConfigIncludeKind kind; if (kindText.equals("url(")) { kind = ConfigIncludeKind.URL; } else if (kindText.equals("file(")) { kind = ConfigIncludeKind.FILE; } else if (kindText.equals("classpath(")) { kind = ConfigIncludeKind.CLASSPATH; } else { throw parseError("expecting include parameter to be quoted filename, file(), classpath(), or url(). No spaces are allowed before the open paren. Not expecting: " + t); } children.add(new ConfigNodeSingleToken(t)); t = nextTokenCollectingWhitespace(children); String name; if (!Tokens.isValueWithType(t, ConfigValueType.STRING)) { throw parseError("expecting a quoted string inside file(), classpath(), or url(), rather than: " + t); } children.add(new ConfigNodeSimpleValue(t)); t = nextTokenCollectingWhitespace(children); if (Tokens.isUnquotedText(t) && Tokens.getUnquotedText(t).equals(")")) { } else { throw parseError("expecting a close parentheses ')' here, not: " + t); } return new ConfigNodeInclude(children, kind); } else if (Tokens.isValueWithType(t, ConfigValueType.STRING)) { children.add(new ConfigNodeSimpleValue(t)); return new ConfigNodeInclude(children, ConfigIncludeKind.HEURISTIC); } else { throw parseError("include keyword is not followed by a quoted string, but by: " + t); } }
Source:
<code>private void deployJob(CuratorFramework client, final Job job) throws InterruptedException { if (job != null) { ModuleDeploymentPropertiesProvider provider = new JobModuleDeploymentPropertiesProvider(job); List<ModuleDescriptor> descriptors = new ArrayList<ModuleDescriptor>(); descriptors.add(job.getJobModuleDescriptor()); try { Collection<ModuleDeploymentStatus> deploymentStatus = moduleDeploymentWriter.writeDeployment(descriptors.iterator(), provider); DeploymentUnitStatus status = stateCalculator.calculate(job, provider, deploymentStatus); <START> logger.warn("Deployment state for job: {}", status); <END> client.setData().forPath( Paths.build(Paths.JOB_DEPLOYMENTS, job.getName(), Paths.STATUS), ZooKeeperUtils.mapToBytes(status.toMap())); } catch (NoContainerException e) { logger.warn("No containers available for deployment of job {}", job.getName()); } catch (InterruptedException e) { throw e; } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } } }</code><technical_language>This a more fine-grained logging level (maybe info... if debug). (FWIW: logging for stream state other cases of logging job state INFO level)</technical_language>

Target:
private void deployJob(CuratorFramework client, final Job job) throws InterruptedException { if (job != null) { String statusPath = Paths.build(Paths.JOB_DEPLOYMENTS, job.getName(), Paths.STATUS); DeploymentUnitStatus deployingStatus = null; try { deployingStatus = new DeploymentUnitStatus(ZooKeeperUtils.bytesToMap( client.getData().forPath(statusPath))); } catch (Exception e) { } Assert.state(deployingStatus != null && deployingStatus.getState() == DeploymentUnitStatus.State.deploying, String.format("Expected 'deploying' status for job '%s'; current status: %s", job.getName(), deployingStatus)); ModuleDeploymentPropertiesProvider provider = new JobModuleDeploymentPropertiesProvider(job); List<ModuleDescriptor> descriptors = new ArrayList<ModuleDescriptor>(); descriptors.add(job.getJobModuleDescriptor()); try { Collection<ModuleDeploymentStatus> deploymentStatus = moduleDeploymentWriter.writeDeployment(descriptors.iterator(), provider); DeploymentUnitStatus status = stateCalculator.calculate(job, provider, deploymentStatus); logger.info("Deployment status for job '{}': {}", job.getName(), status); client.setData().forPath(statusPath, ZooKeeperUtils.mapToBytes(status.toMap())); } catch (NoContainerException e) { logger.warn("No containers available for deployment of job {}", job.getName()); } catch (InterruptedException e) { throw e; } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } } }
Source:
<code>private void createServerMessenger(final ServerConnectionProps props) { try { this.serverMessenger = new ServerMessenger(props.getName(), props.getPort(), objectStreamFactory); serverMessenger.addConnectionChangeListener(this); messengers = new Messengers(serverMessenger); messengers.registerRemote(serverStartupRemote, SERVER_REMOTE_NAME); <START> GameHostingResponse gameHostingResponse = null; <END> if (System.getProperty(LOBBY_URI) != null) { final URI lobbyUri = URI.create(System.getProperty(LOBBY_URI)); gameHostingResponse = GameHostingClient.newClient(lobbyUri).sendGameHostingRequest(); lobbyWatcherThread = new LobbyWatcherThread( gameSelectorModel, serverMessenger, ui == null ? new WatcherThreadMessaging.HeadlessWatcherThreadMessaging() : new WatcherThreadMessaging.HeadedWatcherThreadMessaging(ui)); lobbyWatcherThread.createLobbyWatcher(lobbyUri, gameHostingResponse); } chatController = new ChatController(CHAT_NAME, messengers, node -> false); if (ui == null) { chatModel = new HeadlessChat(new Chat(new MessengersChatTransmitter(CHAT_NAME, messengers))); } else { final var chatPanel = ChatPanel.newChatPanel(messengers, CHAT_NAME, ChatSoundProfile.GAME); chatModelCancel = () -> chatPanel.setChat(null); chatModel = chatPanel; } serverMessenger.setAcceptNewConnections(true); gameDataChanged(); serverSetupModel.onServerMessengerCreated(this, gameHostingResponse); } catch (final IOException ioe) { log.log(Level.SEVERE, "Unable to create server socket", ioe); cancel(); } }</code><technical_language>If add else branch if statement below, able this variable final</technical_language>

Target:
private void createServerMessenger(final ServerConnectionProps props) { try { this.serverMessenger = new ServerMessenger(props.getName(), props.getPort(), objectStreamFactory); serverMessenger.addConnectionChangeListener(this); messengers = new Messengers(serverMessenger); messengers.registerRemote(serverStartupRemote, SERVER_REMOTE_NAME); @Nullable final GameHostingResponse gameHostingResponse; if (System.getProperty(LOBBY_URI) != null) { final URI lobbyUri = URI.create(System.getProperty(LOBBY_URI)); gameHostingResponse = GameHostingClient.newClient(lobbyUri).sendGameHostingRequest(); lobbyWatcherThread = new LobbyWatcherThread( gameSelectorModel, serverMessenger, ui == null ? new WatcherThreadMessaging.HeadlessWatcherThreadMessaging() : new WatcherThreadMessaging.HeadedWatcherThreadMessaging(ui)); lobbyWatcherThread.createLobbyWatcher(lobbyUri, gameHostingResponse); } else { gameHostingResponse = null; } chatController = new ChatController(CHAT_NAME, messengers, node -> false); if (ui == null) { chatModel = new HeadlessChat(new Chat(new MessengersChatTransmitter(CHAT_NAME, messengers))); } else { final var chatPanel = ChatPanel.newChatPanel(messengers, CHAT_NAME, ChatSoundProfile.GAME); chatModelCancel = () -> chatPanel.setChat(null); chatModel = chatPanel; } serverMessenger.setAcceptNewConnections(true); gameDataChanged(); serverSetupModel.onServerMessengerCreated(this, gameHostingResponse); } catch (final IOException ioe) { log.log(Level.SEVERE, "Unable to create server socket", ioe); cancel(); } }
Source:
<code><START> protected boolean approveMoveRequest(IEditCommandRequest request) { <END> MoveRequest moveRequest = (MoveRequest) request; EObject targetContainer = moveRequest.getTargetContainer(); if (targetContainer instanceof Element) { if (!UMLRTProfileUtils.isUMLRTProfileApplied((Element) targetContainer)) { return super.approveRequest(request); } } Map<?, ?> elementsToMove = moveRequest.getElementsToMove(); for (Object elementToMove : elementsToMove.keySet()) { if (elementToMove instanceof Port) { return false; } } return super.approveRequest(request); }</code><technical_language>wrong implement paste, if is is, override it? But, yes, expedient refine this approval condition suggest. Sounds good me. (I thought need AddRequest for adding objects obtained some other means CreateRequest. consider a general facility in Papyrus's implementation of Element Types)</technical_language>

Target:
protected boolean approveMoveRequest(IEditCommandRequest request) { MoveRequest moveRequest = (MoveRequest) request; EObject targetContainer = moveRequest.getTargetContainer(); if (targetContainer instanceof Element) { if (!UMLRTProfileUtils.isUMLRTProfileApplied((Element) targetContainer)) { return super.approveRequest(request); } } Map<?, ?> elementsToMove = moveRequest.getElementsToMove(); for (Object elementToMove : elementsToMove.keySet()) { if (elementToMove instanceof Port && ((Port) elementToMove).eContainer() != null) { return false; } } return super.approveRequest(request); }
Source:
<code>public void execute(final Object message) throws Exception { initialSessionRequest = (SmsSessionRequest) message; initialSessionSid = Sid.generate(Sid.Type.SMS_MESSAGE); final SmsMessage.Builder builder = SmsMessage.builder(); builder.setSid(initialSessionSid); builder.setAccountSid(accountId); builder.setApiVersion(version); builder.setRecipient(initialSessionRequest.to()); builder.setSender(initialSessionRequest.from()); builder.setBody(initialSessionRequest.body()); builder.setDirection(Direction.INBOUND); builder.setStatus(Status.RECEIVED); builder.setPrice(new BigDecimal("0.00")); builder.setPriceUnit(Currency.getInstance("USD")); final StringBuilder buffer = new StringBuilder(); buffer.append("/").append(version).append("/Accounts/"); buffer.append(accountId.toString()).append("/SMS/Messages/"); buffer.append(initialSessionSid.toString()); final URI uri = URI.create(buffer.toString()); builder.setUri(uri); <START> SmsVerb.populateAttributes(verb, builder); <END> final SmsMessage record = builder.build(); final SmsMessagesDao messages = storage.getSmsMessagesDao(); messages.addSmsMessage(record); getContext().system().eventStream().publish(record); service.tell(new DestroySmsSession(initialSession), source); initialSession = null; final List<NameValuePair> parameters = parameters(); request = new HttpRequestDescriptor(url, method, parameters); downloader.tell(request, source); }</code><technical_language>@jaimecasero redundant hide preparation of action attributes in a method. 5 lines of code reduces visibility of full task here</technical_language>

Target:
public void execute(final Object message) throws Exception { initialSessionRequest = (SmsSessionRequest) message; initialSessionSid = Sid.generate(Sid.Type.SMS_MESSAGE); final SmsMessage.Builder builder = SmsMessage.builder(); builder.setSid(initialSessionSid); builder.setAccountSid(accountId); builder.setApiVersion(version); builder.setRecipient(initialSessionRequest.to()); builder.setSender(initialSessionRequest.from()); builder.setBody(initialSessionRequest.body()); builder.setDirection(Direction.INBOUND); builder.setStatus(Status.RECEIVED); builder.setPrice(new BigDecimal("0.00")); builder.setPriceUnit(Currency.getInstance("USD")); final StringBuilder buffer = new StringBuilder(); buffer.append("/").append(version).append("/Accounts/"); buffer.append(accountId.toString()).append("/SMS/Messages/"); buffer.append(initialSessionSid.toString()); final URI uri = URI.create(buffer.toString()); builder.setUri(uri); final SmsMessage record = builder.build(); final SmsMessagesDao messages = storage.getSmsMessagesDao(); messages.addSmsMessage(record); getContext().system().eventStream().publish(record); service.tell(new DestroySmsSession(initialSession), source); initialSession = null; final List<NameValuePair> parameters = parameters(); request = new HttpRequestDescriptor(url, method, parameters); downloader.tell(request, source); }
Source:
<code>public void handleSpecialDaysResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleSpecialDaysresponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception); result = ResponseMessageResultType.NOT_OK; } <START> this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() <END> .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }</code><technical_language>Extract building of ResponseMessage variable (in eclipse, select text, right-click > refactor > extract local variable / select code + shift+alt+L). This code a bit more readable, especially passing in other besides ResponseMessage</technical_language>

Target:
public void handleSpecialDaysResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleSpecialDaysresponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
<code>public CacheableLocator createLocator(AnnotatedElement annotatedElement) { TimeOutDuration customDuration; if (annotatedElement.isAnnotationPresent(WithTimeout.class)){ WithTimeout withTimeout = annotatedElement.getAnnotation(WithTimeout.class); customDuration = new TimeOutDuration(withTimeout.time(), withTimeout.unit()); } else <START> customDuration = timeOutDuration; <END> builder.setAnnotated(annotatedElement); By by = builder.buildBy(); if (by != null) return new AppiumElementLocator(searchContext, by, builder.isLookupCached(), customDuration, originalWebDriver); return null; }</code><technical_language>spacing is weird, IDE able auto format Java files</technical_language>

Target:
public CacheableLocator createLocator(AnnotatedElement annotatedElement) { TimeOutDuration customDuration; if (annotatedElement.isAnnotationPresent(WithTimeout.class)) { WithTimeout withTimeout = annotatedElement.getAnnotation(WithTimeout.class); customDuration = new TimeOutDuration(withTimeout.time(), withTimeout.unit()); } else { customDuration = timeOutDuration; } builder.setAnnotated(annotatedElement); By by = builder.buildBy(); if (by != null) return new AppiumElementLocator(searchContext, by, builder.isLookupCached(), customDuration, originalWebDriver); return null; }
Source:
<code>public static void openURL(String url) { try { if (!GraphicsEnvironment.isHeadless()) { <START> log.warn("graphical browser requested but currently no display"); <END> } Class<?> d = Class.forName("java.awt.Desktop"); d.getDeclaredMethod("browse", new Class[] { java.net.URI.class }).invoke(d.getDeclaredMethod("getDesktop").invoke(null), new Object[] { java.net.URI.create(url) }); } catch (Exception ignore) { String osName = System.getProperty("os.name"); try { if (osName.startsWith("Mac OS")) { Class.forName("com.apple.eio.FileManager").getDeclaredMethod("openURL", new Class[] { String.class }).invoke(null, new Object[] { url }); } else if (osName.startsWith("Windows")) Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); else { String browser = null; for (String b : browsers) if (browser == null && Runtime.getRuntime().exec(new String[] { "which", b }).getInputStream().read() != -1) Runtime.getRuntime().exec(new String[] { browser = b, url }); if (browser == null) throw new Exception(Arrays.toString(browsers)); } } catch (Exception e) { log.warn("attempted to start browser - but desktop or browser not supported"); } } }</code><technical_language>Is this logic backwards? if env is headless, want return spawn browser</technical_language>

Target:
public static void openURL(String url) { try { if (GraphicsEnvironment.isHeadless()) { log.warn("graphical browser requested but currently no display"); } Class<?> d = Class.forName("java.awt.Desktop"); d.getDeclaredMethod("browse", new Class[] { java.net.URI.class }).invoke(d.getDeclaredMethod("getDesktop").invoke(null), new Object[] { java.net.URI.create(url) }); } catch (Exception ignore) { String osName = System.getProperty("os.name"); try { if (osName.startsWith("Mac OS")) { Class.forName("com.apple.eio.FileManager").getDeclaredMethod("openURL", new Class[] { String.class }).invoke(null, new Object[] { url }); } else if (osName.startsWith("Windows")) Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); else { String browser = null; for (String b : browsers) if (browser == null && Runtime.getRuntime().exec(new String[] { "which", b }).getInputStream().read() != -1) Runtime.getRuntime().exec(new String[] { browser = b, url }); if (browser == null) throw new Exception(Arrays.toString(browsers)); } } catch (Exception e) { log.warn("attempted to start browser - but desktop or browser not supported"); } } }
Source:
<code>public void put(Slice key, long timeBucket, Slice value) { BucketedValue bucketedValue = flash.get(key); if (bucketedValue == null) { bucketedValue = new BucketedValue(); flash.put(key, bucketedValue); sizeInBytes.getAndAdd(key.length); sizeInBytes.getAndAdd(Long.SIZE); } <START> if (timeBucket >= bucketedValue.getTimeBucket()) { <END> int inc = null == bucketedValue.getValue() ? value.length : value.length - bucketedValue.getValue().length; sizeInBytes.getAndAdd(inc); bucketedValue.setTimeBucket(timeBucket); bucketedValue.setValue(value); } }</code><technical_language>log a warning throw exception in else of this if? I want quietly ignore a put call..</technical_language>

Target:
public void put(Slice key, long timeBucket, Slice value) { BucketedValue bucketedValue = flash.get(key); if (bucketedValue == null) { bucketedValue = new BucketedValue(); flash.put(key, bucketedValue); sizeInBytes.getAndAdd(key.length); sizeInBytes.getAndAdd(Long.SIZE); } if (timeBucket >= bucketedValue.getTimeBucket()) { int inc = null == bucketedValue.getValue() ? value.length : value.length - bucketedValue.getValue().length; sizeInBytes.getAndAdd(inc); bucketedValue.setTimeBucket(timeBucket); bucketedValue.setValue(value); } else { LOG.warn("ignoring {}; existing {}", key, value, timeBucket, bucketedValue.getValue(), bucketedValue.getTimeBucket()); } }
Source:
<code>public void testExecutionAttemptIdInTwoIdenticalJobsIsNotSame() throws Exception { JobVertex v1 = new JobVertex("vertex1"); JobVertex v2 = new JobVertex("vertex2"); JobVertex v3 = new JobVertex("vertex3"); v1.setParallelism(5); v2.setParallelism(7); v3.setParallelism(2); v1.setInvokableClass(AbstractInvokable.class); v2.setInvokableClass(AbstractInvokable.class); v3.setInvokableClass(AbstractInvokable.class); List<JobVertex> ordered = new ArrayList<>(Arrays.asList(v1, v2, v3)); ExecutionGraph eg1 = createExecutionGraph(); ExecutionGraph eg2 = createExecutionGraph(); try { eg1.attachJobGraph(ordered); eg2.attachJobGraph(ordered); } catch (JobException e) { e.printStackTrace(); <START> fail("Job failed with exception: " + e.getMessage()); <END> } assertThat(Sets.intersection(eg1.getRegisteredExecutions().keySet(), eg2.getRegisteredExecutions().keySet()), is(empty())); }</code><technical_language>I a need for explicit catch block</technical_language>

Target:
public void testExecutionAttemptIdInTwoIdenticalJobsIsNotSame() throws Exception { JobVertex v1 = new JobVertex("vertex1"); JobVertex v2 = new JobVertex("vertex2"); JobVertex v3 = new JobVertex("vertex3"); v1.setParallelism(5); v2.setParallelism(7); v3.setParallelism(2); v1.setInvokableClass(AbstractInvokable.class); v2.setInvokableClass(AbstractInvokable.class); v3.setInvokableClass(AbstractInvokable.class); List<JobVertex> ordered = new ArrayList<>(Arrays.asList(v1, v2, v3)); ExecutionGraph eg1 = createExecutionGraph(); ExecutionGraph eg2 = createExecutionGraph(); eg1.attachJobGraph(ordered); eg2.attachJobGraph(ordered); assertThat(Sets.intersection(eg1.getRegisteredExecutions().keySet(), eg2.getRegisteredExecutions().keySet()), is(empty())); }
Source:
<code>protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); <START> if (requestCode == RequestCodes.JETPACK_LOGIN && resultCode == RESULT_OK) { <END> trackResult(); } finishAndGoBackToSource(); }</code><technical_language>Nitpick: preferred handle other request code. is handle right now, I making code do I expect it: if (requestCode == RequestCodes.JETPACK_LOGIN) { if (resultCode == RESULT_OK) { trackResult(); } else { finishAndGoBackToSource(); } }</technical_language>

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RequestCodes.JETPACK_LOGIN) { if (resultCode == RESULT_OK) { trackResult(); } else { finishAndGoBackToSource(); } } }
Source:
<code>public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mContext = getActivity().getApplicationContext(); mDataBaseAdapter = new DataBaseAdapter(getActivity()); mDataBaseAdapter.createDatabase(); mDataBaseAdapter.open(); mItemAdapter = new ATMItemListAdapter(mContext, ((MainActivity) getActivity()).getLocationTracker()); setListAdapter(mItemAdapter); getLoaderManager().initLoader(0, null, this); getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL); getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { ((ListView) parent).setItemChecked(position, ((ListView) parent).isItemChecked(position)); return false; } }); getListView().setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener() { private int <START> nr = <END> 0; @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { return true; } @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return false; } @Override public void onDestroyActionMode(ActionMode mode) { nr = 0; } @Override public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) { if (checked) { nr++; } else { nr--; } mode.setTitle(nr + " rows selected!"); } }); }</code><technical_language>correct variable name</technical_language>

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mContext = getActivity().getApplicationContext(); mDataBaseAdapter = new DataBaseAdapter(getActivity()); mDataBaseAdapter.createDatabase(); mDataBaseAdapter.open(); mItemAdapter = new ATMItemListAdapter(mContext, ((MainActivity) getActivity()).getLocationTracker()); setListAdapter(mItemAdapter); getLoaderManager().initLoader(0, null, this); getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { ((ListView) parent).setItemChecked(position, ((ListView) parent).isItemChecked(position)); return false; } }); getListView().setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener() { private int nr = 0; @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { return true; } @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return false; } @Override public void onDestroyActionMode(ActionMode mode) { nr = 0; } @Override public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) { if (checked) { nr++; } else { nr--; } mode.setTitle(nr + " rows selected!"); } }); }
Source:
<code><START> public void writeTo(OutputStream out) throws IOException { <END> for (MimePart part : mimeParts) { part.writeTo(out); } out.write(footer); }</code><technical_language>@Override this line</technical_language>

Target:
@Override public void writeTo(OutputStream out) throws IOException { for (MimePart part : mimeParts) { part.writeTo(out); } out.write(footer); }
Source:
<code>public FongoDBCollection(FongoDB db, String name) { super(db, name); this.fongoDb = db; this.nonIdCollection = name.startsWith("system"); this.expressionParser = new ExpressionParser(); this.updateEngine = new UpdateEngine(); this.objectComparator = expressionParser.buildObjectComparator(true); <START> this._idIndex = new Index("_id", new BasicDBObject("_id", 1), true); <END> this.indexes.put(Collections.singleton("_id"), _idIndex); }</code><technical_language>want this if this is a nonIdCollection</technical_language>

Target:
public FongoDBCollection(FongoDB db, String name) { super(db, name); this.fongoDb = db; this.nonIdCollection = name.startsWith("system"); this.expressionParser = new ExpressionParser(); this.updateEngine = new UpdateEngine(); this.objectComparator = expressionParser.buildObjectComparator(true); this._idIndex = new Index("_id", new BasicDBObject("_id", 1), true, true); this.indexes.add(_idIndex); }
Source:
<code><START> public void testExpandedImageUsingValidUrl() throws ImageStore.CantGetImageException{ <END> final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); intent.putExtra("mp_imgurl", VALID_URL); Bitmap fakeBitmap = getFakeBitmap(); when(mpPushSpy.getBitmapFromUrl(VALID_URL)).thenReturn(fakeBitmap); mpPushSpy.createNotification(intent); verify(mpPushSpy).getBitmapFromUrl(VALID_URL); verify(builderSpy).setStyle(new Notification.BigPictureStyle().bigPicture(fakeBitmap)); }</code><technical_language>space trailing {</technical_language>

Target:
public void testExpandedImageUsingValidUrl() { final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); intent.putExtra("mp_img", VALID_IMAGE_URL); Bitmap fakeBitmap = getFakeBitmap(); when(mpPushSpy.getBitmapFromUrl(VALID_IMAGE_URL)).thenReturn(fakeBitmap); mpPushSpy.createNotification(intent); verify(mpPushSpy).getBitmapFromUrl(VALID_IMAGE_URL); verify(mpPushSpy).setBigPictureStyle(fakeBitmap); }