auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>@Test void testNotInOperation() { checkPlanEquals("select\n" + "4 not in ('1', '2', '3') as f0,\n" + "(3, 4) not in (('1', '2')) as f1,\n" + "(2, 3) not in (('1', '2'), ('3', '4')) as f2\n" <START> + "from (values (true, true, true))"); <END> }</code><technical_language>understand this test case: tests if is coerced check is in. For example. 4 in ('1', '2', '3'). 4 coerced varchar is in ('1', '2', '3'). Then, I guess is missing negative cases. 4 is coerced, in ('1', '2', '3'). for positive case here, a negative case. For example, 3 in ('1', '2', '3') returns false</technical_language>

Target:
@Test void testNotInOperation() { checkPlanEquals("select\n" + "1 not in ('1', '2', '3') as f0,\n" + "(1, 2) not in (('1', '2')) as f1,\n" + "(1, 2) not in (('1', '2'), ('3', '4')) as f2\n" + "from (values (false, false, false))"); }
Source:
<code>public void process(FContext ctx, FProtocol iprot, FProtocol oprot) throws TException { Ping_args args = new Ping_args(); try { args.read(iprot); } catch (TException e) { iprot.readMessageEnd(); synchronized (WRITE_LOCK) { e = writeApplicationException(ctx, oprot, TApplicationException.PROTOCOL_ERROR, "Ping", e.getMessage()); } throw e; } iprot.readMessageEnd(); Ping_result result = new Ping_result(); try { handler.Ping(ctx); } catch (TApplicationException e) { oprot.writeResponseHeader(ctx); oprot.writeMessageBegin(new TMessage("ping", TMessageType.EXCEPTION, 0)); e.write(oprot); return; } catch (TException e) { synchronized (WRITE_LOCK) { e = writeApplicationException(ctx, oprot, TApplicationException.INTERNAL_ERROR, "ping", "Internal error processing Ping: " + e.getMessage()); } throw e; } synchronized (WRITE_LOCK) { try { oprot.writeResponseHeader(ctx); oprot.writeMessageBegin(new TMessage("ping", TMessageType.REPLY, 0)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } catch (TException e) { if (e instanceof TTransportException) { TTransportException trException = (TTransportException) e; if (trException.getType() == FTransportException.RESPONSE_TOO_LARGE) { writeApplicationException(ctx, oprot, FApplicationException.RESPONSE_TOO_LARGE, "ping", "response too large: " + e.getMessage()); } } else { throw e; <START> } <END> } } }</code><technical_language>change catch clause catch TTransportException? need rethrow other exceptions ourselves</technical_language>

Target:
public void process(FContext ctx, FProtocol iprot, FProtocol oprot) throws TException { Ping_args args = new Ping_args(); try { args.read(iprot); } catch (TException e) { iprot.readMessageEnd(); synchronized (WRITE_LOCK) { e = writeApplicationException(ctx, oprot, FrugalTApplicationExceptionType.PROTOCOL_ERROR, "Ping", e.getMessage()); } throw e; } iprot.readMessageEnd(); Ping_result result = new Ping_result(); try { handler.Ping(ctx); } catch (TApplicationException e) { oprot.writeResponseHeader(ctx); oprot.writeMessageBegin(new TMessage("ping", TMessageType.EXCEPTION, 0)); e.write(oprot); return; } catch (TException e) { synchronized (WRITE_LOCK) { e = writeApplicationException(ctx, oprot, FrugalTApplicationExceptionType.INTERNAL_ERROR, "ping", "Internal error processing Ping: " + e.getMessage()); } throw e; } synchronized (WRITE_LOCK) { try { oprot.writeResponseHeader(ctx); oprot.writeMessageBegin(new TMessage("ping", TMessageType.REPLY, 0)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } catch (TTransportException e) { if (e.getType() == FrugalTTransportExceptionType.RESPONSE_TOO_LARGE) { writeApplicationException(ctx, oprot, FrugalTApplicationExceptionType.RESPONSE_TOO_LARGE, "ping", "response too large: " + e.getMessage()); } else { throw e; } } } }
Source:
<code><START> public static void onDeepLinkReceived(@NonNull Activity activity, @NonNull final DeepLink deepLink) { <END> logger.debug("DeepLinkManager received DeepLink with data:\n" + deepLink.toString()); final Router router = new Router(new Config(activity)); final String username = new LoginPrefs(activity).getUsername(); @ScreenDef final String screenName = deepLink.getScreenName(); if (username == null) { switch (screenName) { case Screen.COURSE_DISCOVERY: case Screen.PROGRAM_DISCOVERY: case Screen.DEGREE_DISCOVERY: router.showFindCourses(activity, screenName, deepLink.getPathId()); break; default: activity.startActivity(router.getLogInIntent()); break; } return; } switch (screenName) { case Screen.COURSE_DASHBOARD: case Screen.COURSE_VIDEOS: case Screen.COURSE_DISCUSSION: case Screen.COURSE_DATES: case Screen.COURSE_HANDOUT: case Screen.COURSE_ANNOUNCEMENT: case Screen.DISCUSSION_POST: case Screen.DISCUSSION_TOPIC: { router.showCourseDashboardTabs(activity, null, deepLink.getCourseId(), deepLink.getTopicID(), deepLink.getThreadID(), false, screenName); break; } case Screen.PROGRAM: case Screen.COURSE_DISCOVERY: case Screen.PROGRAM_DISCOVERY: case Screen.DEGREE_DISCOVERY: { router.showMainDashboard(activity, screenName, deepLink.getPathId()); break; } case Screen.PROFILE: { router.showUserProfile(activity, username); break; } case Screen.ACCOUNT: { router.showAccountActivity(activity); break; } } }</code><technical_language>trigger some logs, in a case app receiving invalid/not implemented screen_name (e.g app receive pro screen name instated of profile)</technical_language>

Target:
public static void onDeepLinkReceived(@NonNull Activity activity, @NonNull final DeepLink deepLink) { logger.debug("DeepLinkManager received DeepLink with data:\n" + deepLink.toString()); final Router router = new Router(new Config(activity)); final String username = new LoginPrefs(activity).getUsername(); @ScreenDef final String screenName = deepLink.getScreenName(); if (username == null) { switch (screenName) { case Screen.COURSE_DISCOVERY: case Screen.PROGRAM_DISCOVERY: case Screen.DEGREE_DISCOVERY: router.showFindCourses(activity, screenName, deepLink.getPathId()); break; default: activity.startActivity(router.getLogInIntent()); break; } return; } switch (screenName) { case Screen.COURSE_DASHBOARD: case Screen.COURSE_VIDEOS: case Screen.COURSE_DISCUSSION: case Screen.COURSE_DATES: case Screen.COURSE_HANDOUT: case Screen.COURSE_ANNOUNCEMENT: case Screen.DISCUSSION_POST: case Screen.DISCUSSION_TOPIC: { router.showCourseDashboardTabs(activity, null, deepLink.getCourseId(), deepLink.getTopicID(), deepLink.getThreadID(), false, screenName); break; } case Screen.PROGRAM: case Screen.COURSE_DISCOVERY: case Screen.PROGRAM_DISCOVERY: case Screen.DEGREE_DISCOVERY: { router.showMainDashboard(activity, screenName, deepLink.getPathId()); break; } case Screen.PROFILE: { router.showUserProfile(activity, username); break; } case Screen.ACCOUNT: { router.showAccountActivity(activity); break; } default: { logger.error(new Exception(String.format("Invalid screen name passed for the deeplink %s", screenName)), true); break; } } }
Source:
<code>public ConnectionPoolConfig(VerifiableProperties verifiableProperties) { <START> connectionPoolReadBufferSizeBytes = <END> verifiableProperties.getIntInRange("connectionpool.read.buffer.size.bytes", 1048576, 1, 1024 * 1024 * 1024); connectionPoolWriteBufferSizeBytes = verifiableProperties.getIntInRange("connectionpool.write.buffer.size.bytes", 1048576, 1, 1024 * 1024 * 1024); connectionPoolReadTimeoutMs = verifiableProperties.getIntInRange("connectionpool.read.timeout.ms", 1500, 1, 100000); connectionPoolConnectTimeoutMs = verifiableProperties.getIntInRange("connectionpool.connect.timeout.ms", 800, 1, 100000); connectionPoolMaxConnectionsPerPortPlainText = verifiableProperties.getIntInRange("connectionpool.max.connections.per.port.plain.text", 5, 1, 20); connectionPoolMaxConnectionsPerPortSSL = verifiableProperties.getIntInRange("connectionpool.max.connections.per.port.ssl", 2, 1, 20); }</code><technical_language>Add this ConnectionPoolConfig constructor (line 82). connectionPoolSocketResetOnError = verifiableProperties.getBoolean("connectionpool.socket.reset.on.error", true);</technical_language>

Target:
public ConnectionPoolConfig(VerifiableProperties verifiableProperties) { connectionPoolReadBufferSizeBytes = verifiableProperties.getIntInRange("connectionpool.read.buffer.size.bytes", 1048576, 1, 1024 * 1024 * 1024); connectionPoolWriteBufferSizeBytes = verifiableProperties.getIntInRange("connectionpool.write.buffer.size.bytes", 1048576, 1, 1024 * 1024 * 1024); connectionPoolReadTimeoutMs = verifiableProperties.getIntInRange("connectionpool.read.timeout.ms", 1500, 1, 100000); connectionPoolConnectTimeoutMs = verifiableProperties.getIntInRange("connectionpool.connect.timeout.ms", 800, 1, 100000); connectionPoolMaxConnectionsPerPortPlainText = verifiableProperties.getIntInRange("connectionpool.max.connections.per.port.plain.text", 5, 1, 20); connectionPoolMaxConnectionsPerPortSSL = verifiableProperties.getIntInRange("connectionpool.max.connections.per.port.ssl", 2, 1, 20); connectionPoolSocketResetOnError = verifiableProperties.getBoolean("connectionpool.socket.reset.on.error", true); }
Source:
<code>public static boolean hasBlockCompressedExtension(final Path path) { <START> return hasBlockCompressedExtension(path.getName().toString()); <END> }</code><technical_language>I meant getFileName(), this compile</technical_language>

Target:
public static boolean hasBlockCompressedExtension(final Path path) { return hasBlockCompressedExtension(path.getFileName().toString()); }
Source:
<code>public void close() { try { flush(); } finally { try { super.close(); } finally { <START> cache.close(cacheName); <END> } } }</code><technical_language>change order of super.close() cache.close()</technical_language>

Target:
public void close() { final LinkedList<RuntimeException> suppressed = executeAll( () -> cache.flush(cacheName), () -> cache.close(cacheName), wrapped()::close ); if (!suppressed.isEmpty()) { throwSuppressed("Caught an exception while closing caching session store for store " + name(), suppressed); } }
Source:
<code><START> public void removeFirstContainer() throws Exception { <END> int defaultNumInstancesperContainer = 4; topologyConfig.setComponentRam(BOLT_NAME, instanceDefaultResources.getRam()); topologyConfig.setComponentRam(SPOUT_NAME, instanceDefaultResources.getRam()); PackingPlan packingPlan = getFirstFitDecreasingPackingPlan(topology); Assert.assertEquals(packingPlan.getContainers().size(), 2); Assert.assertEquals(totalInstances, packingPlan.getInstanceCount()); int spoutScalingDown = -4; Map<String, Integer> componentChanges = new HashMap<>(); componentChanges.put(SPOUT_NAME, spoutScalingDown); PackingPlan newPackingPlan = getFirstFitDecreasingPackingPlanRepack(topology, packingPlan, componentChanges); Assert.assertEquals(1, newPackingPlan.getContainers().size()); Assert.assertEquals((Integer) (totalInstances + spoutScalingDown), newPackingPlan.getInstanceCount()); AssertPacking.assertNumInstances(newPackingPlan.getContainers(), BOLT_NAME, 3); AssertPacking.assertNumInstances(newPackingPlan.getContainers(), SPOUT_NAME, 0); AssertPacking.assertContainerRam(newPackingPlan.getContainers(), defaultNumInstancesperContainer * instanceDefaultResources.getRam()); }</code><technical_language>this test remove container? is container 1 4 spouts removed if so, case? clarify clear case reading code</technical_language>

Target:
public void removeFirstContainer() throws Exception { int defaultNumInstancesperContainer = 4; int spoutScalingDown = -4; Map<String, Integer> componentChanges = new HashMap<>(); componentChanges.put(SPOUT_NAME, spoutScalingDown); int numContainersBeforeRepack = 2; PackingPlan newPackingPlan = doDefaultScalingTest(componentChanges, numContainersBeforeRepack); Assert.assertEquals(1, newPackingPlan.getContainers().size()); Assert.assertEquals((Integer) (totalInstances + spoutScalingDown), newPackingPlan.getInstanceCount()); AssertPacking.assertNumInstances(newPackingPlan.getContainers(), BOLT_NAME, 3); AssertPacking.assertNumInstances(newPackingPlan.getContainers(), SPOUT_NAME, 0); AssertPacking.assertContainerRam(newPackingPlan.getContainers(), defaultNumInstancesperContainer * instanceDefaultResources.getRam()); }
Source:
<code>public void recognizeReceiptInvalidSourceUrl(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); <START> invalidSourceUrlRunner((sourceUrl) -> { <END> ErrorResponseException errorResponseException = assertThrows(ErrorResponseException.class, () -> client.beginRecognizeReceiptsFromUrl(sourceUrl).getSyncPoller().getFinalResult()); assertEquals(INVALID_IMAGE_URL_ERROR_CODE, errorResponseException.getValue().getCode()); assertEquals(IMAGE_URL_IS_BADLY_FORMATTED_ERROR_MESSAGE, errorResponseException.getValue().getMessage()); }); }</code><technical_language>sourceUrl -> invalidSourceUrl</technical_language>

Target:
public void recognizeReceiptInvalidSourceUrl(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); invalidSourceUrlRunner((invalidSourceUrl) -> { HttpResponseException errorResponseException = assertThrows(HttpResponseException.class, () -> client.beginRecognizeReceiptsFromUrl(invalidSourceUrl).getSyncPoller().getFinalResult()); ErrorInformation errorInformation = (ErrorInformation) errorResponseException.getValue(); assertEquals(INVALID_IMAGE_URL_ERROR_CODE, errorInformation.getCode()); assertEquals(IMAGE_URL_IS_BADLY_FORMATTED_ERROR_MESSAGE, errorInformation.getMessage()); }); }
Source:
<code>private static List<String> getErlangModulePaths(@NotNull ErlangTarget target, @NotNull CompileContext context, boolean isTest) { <START> List<String> erlangBuilderDirtyFilesInfo = getErlangModulePathsFromTarget(target, context, isTest); <END> return erlangBuilderDirtyFilesInfo != null ? erlangBuilderDirtyFilesInfo : getErlangModulePathsDefault(target, isTest); }</code><technical_language>this variable name: 1) "erlangBuilder" is name of class - 2) "DirtyFiles" - yes, dirty files, files - modules 3) "Info" -</technical_language>

Target:
private static List<String> getErlangModulePaths(@NotNull ErlangTarget target, @NotNull CompileContext context, boolean isTest) { List<String> erlangDirtyModules = getErlangModulePathsFromTarget(target, isTest); if (erlangDirtyModules != null) { return erlangDirtyModules; } String message = "Erlang module " + target.getModule().getName() + " will be fully rebuilt."; LOG.warn(message); context.processMessage(new CompilerMessage(NAME, BuildMessage.Kind.WARNING, message)); return getErlangModulePathsDefault(target, isTest); }
Source:
<code>private void updateActionEnablement(ISelection selection) { if (!(selection instanceof IStructuredSelection)) return; IStructuredSelection sel = (IStructuredSelection) selection; boolean allSelected = !sel.isEmpty() && sel.size() == getTable().getItemCount(); boolean submoduleSelected = false; for (Object item : sel.toArray()) if (((FileDiff) item).isSubmodule()) { submoduleSelected = true; break; } selectAll.setEnabled(!allSelected); copy.setEnabled(!sel.isEmpty()); if (!submoduleSelected) { boolean oneOrMoreSelected = !sel.isEmpty(); open.setEnabled(oneOrMoreSelected); openWorkingTreeVersion.setEnabled(oneOrMoreSelected); compare.setEnabled(sel.size() == 1); blame.setEnabled(oneOrMoreSelected); if (sel.size() == 1) { FileDiff diff = (FileDiff) sel.getFirstElement(); String path = new Path(getRepository().getWorkTree() <START> .getAbsolutePath()).append(diff.getNewPath()) <END> .toOSString(); boolean workTreeFileExists = new File(path).exists(); compareWorkingTreeVersion.setEnabled(workTreeFileExists); openWorkingTreeVersion.setEnabled(openWorkingTreeVersion .isEnabled() && workTreeFileExists); } else compareWorkingTreeVersion.setEnabled(false); } else { open.setEnabled(false); openWorkingTreeVersion.setEnabled(false); compare.setEnabled(false); blame.setEnabled(false); compareWorkingTreeVersion.setEnabled(false); } }</code><technical_language>In case of a deleted file, getNewPath returns /dev/null, a garbage path. add a check getChange(), disable in case of DELETE</technical_language>

Target:
private void updateActionEnablement(ISelection selection) { if (!(selection instanceof IStructuredSelection)) return; IStructuredSelection sel = (IStructuredSelection) selection; boolean allSelected = !sel.isEmpty() && sel.size() == getTable().getItemCount(); boolean submoduleSelected = false; for (Object item : sel.toArray()) if (((FileDiff) item).isSubmodule()) { submoduleSelected = true; break; } selectAll.setEnabled(!allSelected); copy.setEnabled(!sel.isEmpty()); if (!submoduleSelected) { boolean oneOrMoreSelected = !sel.isEmpty(); open.setEnabled(oneOrMoreSelected); compare.setEnabled(sel.size() == 1); blame.setEnabled(oneOrMoreSelected); if (sel.size() == 1) { FileDiff diff = (FileDiff) sel.getFirstElement(); boolean workTreeFileExists = false; if (diff.getChange() != ChangeType.DELETE) { String path = new Path(getRepository().getWorkTree() .getAbsolutePath()).append(diff.getNewPath()) .toOSString(); workTreeFileExists = new File(path).exists(); } compareWorkingTreeVersion.setEnabled(workTreeFileExists); openWorkingTreeVersion.setEnabled(workTreeFileExists); } else { compareWorkingTreeVersion.setEnabled(false); openWorkingTreeVersion.setEnabled(oneOrMoreSelected); } } else { open.setEnabled(false); openWorkingTreeVersion.setEnabled(false); compare.setEnabled(false); blame.setEnabled(false); compareWorkingTreeVersion.setEnabled(false); } }
Source:
<code>public void run() { try { Model model = load(repoId); response.complete(model); } catch (RepoStoreException e) { <START> logger.error(HTLog.format(repoId, "Failed to load from store")); <END> response.completeExceptionally(e); } }</code><technical_language>Try failed in error messages failed tests harder find in ci build logs</technical_language>

Target:
public void run() { try { Model model = load(repoId); response.complete(model); } catch (RepoStoreException e) { logger.error(HTLog.format(repoId, "Unable to load from store")); response.completeExceptionally(e); } }
Source:
<code>public OutputStream decorate(final OutputStream logger) throws IOException, InterruptedException { final DateFormat f = UTC_MILLIS.get(); return new LineTransformationOutputStream() { @Override protected void eol(byte[] b, int len) throws IOException { logger.write('['); <START> logger.write(f.format(new Date()).getBytes(StandardCharsets.US_ASCII)); <END> logger.write(']'); logger.write(' '); logger.write(b, 0, len); } }; }</code><technical_language>suggestion logger.write(Instant.now().toString().getBytes(StandardCharsets.US_ASCII));</technical_language>

Target:
public OutputStream decorate(final OutputStream logger) throws IOException, InterruptedException { return new LineTransformationOutputStream() { @Override protected void eol(byte[] b, int len) throws IOException { synchronized (logger) { ByteBuffer buffer = ByteBuffer.allocate(1 + 24 + 1 + 1 + len); buffer.put((byte)'['); buffer.put(ZonedDateTime.now(ZoneOffset.UTC).format(UTC_MILLIS).getBytes(StandardCharsets.US_ASCII)); buffer.put((byte)']'); buffer.put((byte)' '); buffer.put(b, 0, len); logger.write(buffer.array(), 0, buffer.position()); } } @Override public void flush() throws IOException { logger.flush(); } @Override public void close() throws IOException { super.close(); logger.close(); } }; }
Source:
<code>public void onProductChange(@NonNull final ICalloutField calloutField) { final QuickInput quickInput = QuickInput.getQuickInputOrNull(calloutField); if (quickInput == null) { return; } boolean isPackingInstructionFieldMissing = !quickInput.hasField(IDDOrderLineQuickInput.COLUMNNAME_M_HU_PI_Item_Product_ID); if (isPackingInstructionFieldMissing) { return; } final IDDOrderLineQuickInput ddOrderLineQuickInput = quickInput.getQuickInputDocumentAs(IDDOrderLineQuickInput.class); final ProductId productId = ProductId.ofRepoIdOrNull( ddOrderLineQuickInput.getM_Product_ID() ); if ( productId == null) { return; } final I_DD_Order ddOrder = quickInput.getRootDocumentAs(I_DD_Order.class); <START> ddOrderLineQuickInput.setM_HU_PI_Item_Product_ID(getDefaultPI(ddOrder, productId).getM_HU_PI_Item_Product_ID()); <END> }</code><technical_language>please run NPE</technical_language>

Target:
public void onProductChange(@NonNull final ICalloutField calloutField) { final QuickInput quickInput = QuickInput.getQuickInputOrNull(calloutField); if (quickInput == null) { return; } boolean isPackingInstructionFieldMissing = !quickInput.hasField(IDDOrderLineQuickInput.COLUMNNAME_M_HU_PI_Item_Product_ID); if (isPackingInstructionFieldMissing) { return; } final IDDOrderLineQuickInput ddOrderLineQuickInput = quickInput.getQuickInputDocumentAs(IDDOrderLineQuickInput.class); final ProductId productId = ProductId.ofRepoIdOrNull( ddOrderLineQuickInput.getM_Product_ID() ); if ( productId == null) { return; } final I_DD_Order ddOrder = quickInput.getRootDocumentAs(I_DD_Order.class); final I_M_HU_PI_Item_Product defaultPackingItem = getDefaultPI(ddOrder, productId); if (defaultPackingItem != null) { ddOrderLineQuickInput.setM_HU_PI_Item_Product_ID(defaultPackingItem.getM_HU_PI_Item_Product_ID()); } }
Source:
<code>public ForwardingGridDialect(GridDialect gridDialect) { Contracts.assertParameterNotNull( gridDialect, "gridDialect" ); this.gridDialect = gridDialect; this.batchableGridDialect = asBatchableGridDialectOrNull( gridDialect ); <START> this.queryableGridDialect = (QueryableGridDialect<T>) asQueryableGridDialectOrNull( gridDialect ); <END> }</code><technical_language>change this like: this.queryableGridDialect = as(QueryableGridDialect.class, gridDialect); This need create a new method time add a new interface. This reminds of ShrinkWrap Assignable interface, gridDialect.as(BatchableGridDIalect.class) if sense in case ..</technical_language>

Target:
public ForwardingGridDialect(GridDialect gridDialect) { Contracts.assertParameterNotNull( gridDialect, "gridDialect" ); this.gridDialect = gridDialect; this.batchableGridDialect = GridDialects.getDialectFacetOrNull( gridDialect, BatchableGridDialect.class ); this.queryableGridDialect = GridDialects.getDialectFacetOrNull( gridDialect, QueryableGridDialect.class ); }
Source:
<code>public AnnotatedChildEntity(EntityModel<C> entityModel, boolean forwardCommands, BiFunction<CommandMessage<?>, P, C> commandTargetResolver, BiFunction<EventMessage<?>, P, Stream<C>> eventTargetResolver) { this.entityModel = entityModel; this.eventTargetResolver = eventTargetResolver; this.commandHandlers = new HashMap<>(); this.commandHandlerInterceptors = new ArrayList<>(); if (forwardCommands) { entityModel.commandHandlers().forEach( (commandType, childHandler) -> commandHandlers.put( commandType, new ChildForwardingCommandMessageHandlingMember<>(childHandler, commandTargetResolver) ) ); <START> commandHandlerInterceptors.addAll( <END> entityModel.commandHandlerInterceptors() .stream() .map(ch -> new ChildForwardingCommandHandlerInterceptorHandlingMember<>(ch, commandTargetResolver)) .collect(Collectors.toList())); } }</code><technical_language>I this is right place call child interceptors. This child interceptors invoked, command handler is declared parent entity (?). I expect interceptor invocation happen in ChildForwardingCommandMessageHandlingMember</technical_language>

Target:
public AnnotatedChildEntity(EntityModel<C> entityModel, boolean forwardCommands, BiFunction<CommandMessage<?>, P, C> commandTargetResolver, BiFunction<EventMessage<?>, P, Stream<C>> eventTargetResolver) { this.entityModel = entityModel; this.eventTargetResolver = eventTargetResolver; this.commandHandlers = new HashMap<>(); if (forwardCommands) { entityModel.commandHandlers().forEach( (commandType, childHandler) -> commandHandlers .put(commandType, new ChildForwardingCommandMessageHandlingMember<>( entityModel.commandHandlerInterceptors(), childHandler, commandTargetResolver))); } }
Source:
<code>public TurtleRecordWriter(OutputStream out) throws IOException { <START> _ps = new BufferedWriter(new OutputStreamWriter(out, "UTF-8") , BUFFER_SIZE); <END> _decl.clear(); }</code><technical_language>close method called in finally block of write method. is executed if is exception, finally block care of closing writer</technical_language>

Target:
public TurtleRecordWriter(OutputStream out) { bufferedWriter = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8), BUFFER_SIZE); }
Source:
<code>public OutputToScreenNode(Context context) { super(context); displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); worldRenderer = context.get(WorldRenderer.class); WorldRenderer renderer = context.get(WorldRenderer.class); <START> requiresCondition(() -> renderer.getCurrentRenderStage() == MONO || renderer.getCurrentRenderStage() == LEFT_EYE); <END> addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL_URN)); bindFbo = new SetInputTextureFromFbo(0, FINAL_BUFFER, ColorTexture, displayResolutionDependentFBOs, DEFAULT_TEXTURED_MATERIAL_URN, "texture"); addDesiredStateChange(bindFbo); SwappableFBO gBufferPair = displayResolutionDependentFBOs.getGBufferPair(); lastUpdatedGBuffer = gBufferPair.getLastUpdatedFbo(); staleGBuffer = gBufferPair.getStaleFbo(); }</code><technical_language>Is this generating a warning? a number of renderers in Terasology strictly necessary this variable worldRenderer, for time being</technical_language>

Target:
public OutputToScreenNode(Context context) { super(context); displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); worldRenderer = context.get(WorldRenderer.class); requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE); addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL_URN)); bindFbo = new SetInputTextureFromFbo(0, FINAL_BUFFER, ColorTexture, displayResolutionDependentFBOs, DEFAULT_TEXTURED_MATERIAL_URN, "texture"); addDesiredStateChange(bindFbo); SwappableFBO gBufferPair = displayResolutionDependentFBOs.getGBufferPair(); lastUpdatedGBuffer = gBufferPair.getLastUpdatedFbo(); staleGBuffer = gBufferPair.getStaleFbo(); }
Source:
<code><START> public @Nullable QueryTypeDescriptorImpl typeDescriptor(@Nullable String cacheName, String typeName) { <END> return typesByName.get(new QueryTypeNameKey(cacheName, typeName)); }</code><technical_language>QueryTypeDescriptorImpl -> GridQueryTypeDescriptor</technical_language>

Target:
public @Nullable GridQueryTypeDescriptor typeDescriptor(@Nullable String cacheName, String typeName) { return typesByName.get(new QueryTypeNameKey(cacheName, typeName)); }
Source:
<code>public QueryIterator(final String chr, final int start, final int end, final List<Block> blocks) throws IOException { this.start = start; this.end = end; <START> chrAlias = chr; <END> mySeekableStream = getSeekableStream(); blockIterator = blocks.iterator(); advanceBlock(); readNextRecord(); chrAlias = (currentRecord == null ? chr : currentRecord.getContig()); }</code><technical_language>this is set final</technical_language>

Target:
public QueryIterator(final String chr, final int start, final int end, final List<Block> blocks) throws IOException { this.start = start; this.end = end; queryChr = chr; mySeekableStream = getSeekableStream(); blockIterator = blocks.iterator(); advanceBlock(); readNextRecord(); chrAlias = (currentRecord == null ? chr : currentRecord.getContig()); }
Source:
<code>BlobStoreCompactor(String dataDir, String storeId, StoreKeyFactory storeKeyFactory, StoreConfig config, StoreMetrics srcMetrics, StoreMetrics tgtMetrics, DiskIOScheduler diskIOScheduler, DiskSpaceAllocator diskSpaceAllocator, Log srcLog, Time time, UUID sessionId, UUID incarnationId) throws IOException, StoreException { this.dataDir = new File(dataDir); this.storeId = storeId; this.storeKeyFactory = storeKeyFactory; this.config = config; this.srcMetrics = srcMetrics; this.tgtMetrics = tgtMetrics; this.srcLog = srcLog; this.diskIOScheduler = diskIOScheduler; this.diskSpaceAllocator = diskSpaceAllocator; this.time = time; this.sessionId = sessionId; this.incarnationId = incarnationId; <START> this.useDirectIO = Platform.isLinux() && config.storeCompactionEnableDirectIO; <END> fixStateIfRequired(); logger.trace("Constructed BlobStoreCompactor for {}", dataDir); }</code><technical_language>in Utils.preAllocateFileIfNeeded(), code is if (System.getProperty("os.name").toLowerCase().startsWith("linux")) { ... } Do if is other</technical_language>

Target:
BlobStoreCompactor(String dataDir, String storeId, StoreKeyFactory storeKeyFactory, StoreConfig config, StoreMetrics srcMetrics, StoreMetrics tgtMetrics, DiskIOScheduler diskIOScheduler, DiskSpaceAllocator diskSpaceAllocator, Log srcLog, Time time, UUID sessionId, UUID incarnationId) throws IOException, StoreException { this.dataDir = new File(dataDir); this.storeId = storeId; this.storeKeyFactory = storeKeyFactory; this.config = config; this.srcMetrics = srcMetrics; this.tgtMetrics = tgtMetrics; this.srcLog = srcLog; this.diskIOScheduler = diskIOScheduler; this.diskSpaceAllocator = diskSpaceAllocator; this.time = time; this.sessionId = sessionId; this.incarnationId = incarnationId; this.useDirectIO = Utils.isLinux() && config.storeCompactionEnableDirectIO; fixStateIfRequired(); logger.trace("Constructed BlobStoreCompactor for {}", dataDir); }
Source:
<code>public void isConnected(Cardio2eConnectionEvent e) { <START> logger.debug("Cardio is " + (e.getIsConnected() ? "CONNECTED" : "DISCONNECTED") + "."); <END> }</code><technical_language>Usage of ? : is confusing in logging statements. This problem occurs times</technical_language>

Target:
public void isConnected(Cardio2eConnectionEvent e) { logger.info("Cardio is {}.", (e.getIsConnected() ? "CONNECTED" : "DISCONNECTED")); }
Source:
<code>public boolean isHandleRenamedFiles() { <START> return handleRenamedFiles; <END> }</code><technical_language>this potential NPE handleRenamedFiles is null, it</technical_language>

Target:
public boolean isHandleRenamedFiles() { return handleRenamedFiles != null && handleRenamedFiles; }
Source:
<code>public Iterable<AccountGroup.UUID> getAllOwners() { Set<AccountGroup.UUID> result = new HashSet<AccountGroup.UUID>(); Iterable<ProjectState> tree = tree(); for (ProjectState p : tree) { result.addAll(p.localOwners); } <START> return Collections.unmodifiableSet(result); <END> }</code><technical_language>Do need unmodifiableSet here? return result belong state of this object</technical_language>

Target:
public Iterable<AccountGroup.UUID> getAllOwners() { Set<AccountGroup.UUID> result = new HashSet<AccountGroup.UUID>(); Iterable<ProjectState> tree = tree(); for (ProjectState p : tree) { result.addAll(p.localOwners); } return result; }
Source:
<code>protected Map<Guid, KeyValuePairCompat<String, List<Guid>>> populateVmsMetadataForOvfUpdate(List<Guid> idsToProcess) { Map<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndTemplateMetadata = new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>(); List<VM> vms = getVmDao().getVmsByIds(idsToProcess); for (VM vm : vms) { if (VMStatus.ImageLocked != vm.getstatus()) { VmHandler.updateDisksFromDb(vm); if (verifyDisksNotLocked(vm.getDiskList())) { loadVmData(vm); <START> Long currentDbGeneration = getVmStaticDao().getDbGeneration(vm.getId()); <END> if (vm.getStaticData().getDb_generation() == currentDbGeneration.longValue()) { buildMetadataDictionaryForVm(vm, vmsAndTemplateMetadata); proccessedIdsInfo.add(vm.getId()); proccessedOvfGenerationsInfo.add(vm.getStaticData().getDb_generation()); } } } } return vmsAndTemplateMetadata; }</code><technical_language>autoboxing? long == Long in java</technical_language>

Target:
protected Map<Guid, KeyValuePairCompat<String, List<Guid>>> populateVmsMetadataForOvfUpdate(List<Guid> idsToProcess) { Map<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndTemplateMetadata = new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>(); List<VM> vms = getVmDao().getVmsByIds(idsToProcess); for (VM vm : vms) { if (VMStatus.ImageLocked != vm.getstatus()) { updateVmDisksFromDb(vm); if (verifyDisksNotLocked(vm.getDiskList())) { loadVmData(vm); Long currentDbGeneration = getVmStaticDao().getDbGeneration(vm.getId()); if (vm.getStaticData().getDb_generation().equals(currentDbGeneration)) { buildMetadataDictionaryForVm(vm, vmsAndTemplateMetadata); proccessedIdsInfo.add(vm.getId()); proccessedOvfGenerationsInfo.add(vm.getStaticData().getDb_generation()); } } } } return vmsAndTemplateMetadata; }
Source:
<code>public List<Tree> children() { <START> return elements.stream().map(element -> (Tree) element).collect(Collectors.toList()); <END> }</code><technical_language>Collections.unmodifiableList work in PyStatementListTreeImpl</technical_language>

Target:
public List<Tree> children() { return Collections.unmodifiableList(elements); }
Source:
<code>public void init(final ProcessorContext context) { internalProcessorContext = (InternalProcessorContext) context; <START> final String threadId = Thread.currentThread().getName(); <END> suppressionEmitSensor = ProcessorNodeMetrics.suppressionEmitSensor( threadId, context.taskId().toString(), internalProcessorContext.currentNode().name(), internalProcessorContext.metrics() ); buffer = requireNonNull((TimeOrderedKeyValueBuffer<K, V>) context.getStateStore(storeName)); buffer.setSerdesIfNull((Serde<K>) context.keySerde(), (Serde<V>) context.valueSerde()); }</code><technical_language>nit: inline threadId in suppressionEmitSensor call</technical_language>

Target:
public void init(final ProcessorContext context) { internalProcessorContext = (InternalProcessorContext) context; suppressionEmitSensor = ProcessorNodeMetrics.suppressionEmitSensor( Thread.currentThread().getName(), context.taskId().toString(), internalProcessorContext.currentNode().name(), internalProcessorContext.metrics() ); buffer = requireNonNull((TimeOrderedKeyValueBuffer<K, V>) context.getStateStore(storeName)); buffer.setSerdesIfNull((Serde<K>) context.keySerde(), (Serde<V>) context.valueSerde()); }
Source:
<code>public FluentWaitElementListMatcher not() { <START> FluentWaitElementListMatcher ret = new FluentWaitElementListMatcher(search, wait, untilElements); <END> ret.negation = !negation; return ret; }</code><technical_language>ret name sense me, set meaningful</technical_language>

Target:
public FluentWaitElementListMatcher not() { FluentWaitElementListMatcher negatedConditions = new FluentWaitElementListMatcher(search, wait, untilElements); negatedConditions.negation = !negation; return negatedConditions; }
Source:
<code>public static void addSmelting(int fluidOutput, IItemStack itemInput, int meltingPoint) { FluidStack fluid = FluidRegistry.getFluidStack("glass", fluidOutput); if (fluid == null){ <START> LogHelper.logWarning("Liquid Class is null for the Thermionic Fabricator"); <END> return; } ModTweaker.LATE_ADDITIONS.add(new AddSmelting(new FabricatorSmeltingRecipe(toStack(itemInput), fluid, meltingPoint))); }</code><technical_language>I "Liquid Glass"</technical_language>

Target:
public static void addSmelting(int fluidOutput, IItemStack itemInput, int meltingPoint) { FluidStack fluid = FluidRegistry.getFluidStack("glass", fluidOutput); if (fluid == null){ LogHelper.logWarning("Liquid Glass is null for the Thermionic Fabricator"); return; } ModTweaker.LATE_ADDITIONS.add(new AddSmelting(new FabricatorSmeltingRecipe(toStack(itemInput), fluid, meltingPoint))); }
Source:
<code>public int hashCode() { return Objects.hashCode( broadcaster, mediaType, availableFrom, channelGroups, genres, publisher, uri, aliasNamespace, <START> aliasNamespace <END> ); }</code><technical_language>typo</technical_language>

Target:
public int hashCode() { return Objects.hashCode( broadcaster, mediaType, availableFrom, channelGroups, genres, publisher, uri, aliasNamespace, aliasValue ); }
Source:
<code>public void handle(HttpExchange t) throws IOException { String rawQuery = t.getRequestURI().getQuery(); <START> String response = "Invalid Parameters. job_id is a required URL parameter."; <END> int statusCode = 400; String[] params = rawQuery.split("&"); for (String param : params) { String[] parts = param.split("="); String key = URLDecoder.decode(parts[0], "UTF-8"); if (key.equals("job_id")) { response = GetSuperstepData(URLDecoder.decode(parts[1], "UTF-8")); statusCode = 200; } } t.sendResponseHeaders(statusCode, response.length()); OutputStream os = t.getResponseBody(); os.write(response.getBytes()); os.close(); }</code><technical_language>try move close used. check if job id exists. If handle way. send error response. confusing response is initialized high up</technical_language>

Target:
public void handle(HttpExchange t) throws IOException { String rawQuery = t.getRequestURI().getQuery(); String jobId = null; String[] params = rawQuery.split("&"); for (String param : params) { String[] parts = param.split("="); String key = URLDecoder.decode(parts[0], "UTF-8"); if (key.equals("job_id")) { jobId = URLDecoder.decode(parts[1], "UTF-8"); } } String response; int statusCode; if (jobId == null) { statusCode = HttpURLConnection.HTTP_BAD_REQUEST; response = "Invalid parameters. job_id is a required parameter"; } else { statusCode = HttpURLConnection.HTTP_OK; response = GetSuperstepData(jobId); } t.sendResponseHeaders(statusCode, response.length()); OutputStream os = t.getResponseBody(); os.write(response.getBytes()); os.close(); }
Source:
<code>protected void configure(Object... args) { int index = 0; try { this.credentials = Credentials.getCredentialsBase64((byte[]) args[index++]); } catch (KeyException e1) { <START> logger.debug("Cannot decrypt credentials", e1); <END> } try { this.maxNodes = Integer.parseInt(args[index++].toString()); this.persistedInfraVariables.put(NB_HANDLED_NODES_KEY, 0); } catch (Exception e) { throw new IllegalArgumentException("Cannot determine max node"); } try { this.nodeTimeout = Integer.parseInt(args[index++].toString()); } catch (Exception e) { logger.warn("Cannot determine node timeout, using default:" + this.nodeTimeout, e); } this.paProperties = args[index].toString(); }</code><technical_language>logger debug</technical_language>

Target:
protected void configure(Object... args) { int index = 0; try { Object possibleCredentials = args[index++]; if (possibleCredentials != null) { this.credentials = Credentials.getCredentialsBase64((byte[]) possibleCredentials); } } catch (KeyException e1) { throw new IllegalArgumentException("Cannot decrypt credentials", e1); } try { this.maxNodes = Integer.parseInt(args[index++].toString()); this.persistedInfraVariables.put(NB_HANDLED_NODES_KEY, 0); } catch (Exception e) { throw new IllegalArgumentException("Cannot determine max node"); } try { this.nodeTimeout = Integer.parseInt(args[index++].toString()); } catch (Exception e) { logger.warn("Cannot determine node timeout, using default:" + this.nodeTimeout, e); } this.paProperties = args[index].toString(); }
Source:
<code>public void removeLeftoverDevices(VmBase vmBase) { List<VmDevice> spiceChannels = vmDeviceDao.getVmDeviceByVmIdTypeAndDevice( vmBase.getId(), VmDeviceGeneralType.CHANNEL, VmDeviceType.SPICEVMC.getName()); if (!hasGraphicsDevice(vmBase.getId(), GraphicsType.SPICE)) { removeVmDevices(spiceChannels); } <START> } <END></code><technical_language>I expect in 99% of cases, a VM defined SPICE restarted times. please move #899 'if' block reduce number of queries database</technical_language>

Target:
public void removeLeftoverDevices(VmBase vmBase) { if (!hasGraphicsDevice(vmBase.getId(), GraphicsType.SPICE)) { List<VmDevice> spiceChannels = vmDeviceDao.getVmDeviceByVmIdTypeAndDevice( vmBase.getId(), VmDeviceGeneralType.CHANNEL, VmDeviceType.SPICEVMC.getName()); removeVmDevices(spiceChannels); } }
Source:
<code>public void createStripeGatewayAccountWithCredentials() throws Exception { Map<String, Object> payload = ImmutableMap.of( "type", "test", "payment_provider", "stripe", "service_name", "My shiny new stripe service", "credentials", ImmutableMap.of( <START> "credentials_type", "stripe", <END> "account_id", "abc")); String gatewayAccountId = givenSetup() .body(toJson(payload)) .post(ACCOUNTS_API_URL) .then() .statusCode(201) .contentType(JSON) .body("gateway_account_id", not(isEmptyString())) .body("service_name", is("My shiny new stripe service")) .body("type", is("test")) .body("links.size()", is(1)) .body("links[0].href", matchesPattern("https://localhost:[0-9]*/v1/api/accounts/[0-9]*")) .body("links[0].rel", is("self")) .body("links[0].method", is("GET")) .extract() .body() .jsonPath() .getString("gateway_account_id"); Optional<GatewayAccountEntity> gatewayAccount = gatewayAccountDao.findById(Long.valueOf(gatewayAccountId)); assertThat(gatewayAccount.isPresent(), is(true)); assertThat(gatewayAccount.get().getCredentials().get("account_id"), is("abc")); }</code><technical_language>need this property (credentials_type) selfservice</technical_language>

Target:
public void createStripeGatewayAccountWithCredentials() throws Exception { Map<String, Object> payload = ImmutableMap.of( "type", "test", "payment_provider", "stripe", "service_name", "My shiny new stripe service", "credentials", ImmutableMap.of("stripe_account_id", "abc")); String gatewayAccountId = givenSetup() .body(toJson(payload)) .post(ACCOUNTS_API_URL) .then() .statusCode(201) .contentType(JSON) .body("gateway_account_id", not(isEmptyString())) .body("service_name", is("My shiny new stripe service")) .body("type", is("test")) .body("links.size()", is(1)) .body("links[0].href", matchesPattern("https://localhost:[0-9]*/v1/api/accounts/[0-9]*")) .body("links[0].rel", is("self")) .body("links[0].method", is("GET")) .extract() .body() .jsonPath() .getString("gateway_account_id"); Optional<GatewayAccountEntity> gatewayAccount = gatewayAccountDao.findById(Long.valueOf(gatewayAccountId)); assertThat(gatewayAccount.isPresent(), is(true)); assertThat(gatewayAccount.get().getCredentials().get("stripe_account_id"), is("abc")); }
Source:
<code>public void dispose() { phone.mCM.unregisterForSIMLockedOrAbsent(this); phone.mCM.unregisterForOffOrNotAvailable(this); phone.mCM.unregisterForSIMReady(this); <START> this.removeCallbacksAndMessages(null); <END> this.absentRegistrants = null; this.pinLockedRegistrants = null; this.networkLockedRegistrants = null; this.status = null; this.phone = null; }</code><technical_language>this.removeCallbacksAndMessages(null) instead. Done in Patch set 2</technical_language>

Target:
public void dispose() { phone.mCM.unregisterForSIMLockedOrAbsent(this); phone.mCM.unregisterForOffOrNotAvailable(this); phone.mCM.unregisterForSIMReady(this); }
Source:
<code><START> public InputKind(String relpath, Class inputClass, String kind) { <END> this.relpath = relpath; this.inputClass = inputClass; this.kind = kind; knownKinds.put(kind, this); }</code><technical_language>SDK-internal. Package access please</technical_language>

Target:
private InputKind(String relpath, Class inputClass, String kind) { this.relpath = relpath; this.inputClass = inputClass; this.kind = kind; knownKinds.put(kind, this); }
Source:
<code>private int compareValues(Value a, Value b, int sortType) { if (a == b) { return 0; } if (a == null) { return -1; } else if (b == null) { return 1; } boolean aNull = a == ValueNull.INSTANCE; boolean bNull = b == ValueNull.INSTANCE; if (aNull || bNull) { return SortOrder.compareNull(aNull, sortType); } int t2 = Value.getHigherOrder(a.getType(), b.getType()); <START> String[] enumerators = ValueEnum.getEnumeratorsForBinaryOperation(a, b); <END> int comp = a.convertTo(t2, -1, mode, null, enumerators) .compareTypeSafe(b.convertTo(t2, -1, mode, null, enumerators), compareMode); if ((sortType & SortOrder.DESCENDING) != 0) { comp = -comp; } return comp; }</code><technical_language>This method allocates a new empty array invocation if types enumerations. cheap enough, designed if higher order is Value.ENUM. code is everywhere: Java if (t2 == Value.ENUM) { String[] enumerators = ValueEnum.getEnumeratorsForBinaryOperation(a, b); a = a.convertToEnum(enumerators); b = b.convertToEnum(enumerators); } else { a = a.conventTo(t2, -1, mode) b = b.convertTo(t2, -1, mode); } (May need a specialized convertTo() additional argument operand enumerators if type is ENUM target type is ENUM avoid ugly patterns.)</technical_language>

Target:
private int compareValues(Value a, Value b, int sortType) { if (a == b) { return 0; } if (a == null) { return -1; } else if (b == null) { return 1; } boolean aNull = a == ValueNull.INSTANCE; boolean bNull = b == ValueNull.INSTANCE; if (aNull || bNull) { return SortOrder.compareNull(aNull, sortType); } int t2 = Value.getHigherOrder(a.getType(), b.getType()); if (t2 == Value.ENUM) { String[] enumerators = ValueEnum.getEnumeratorsForBinaryOperation(a, b); a = a.convertToEnum(enumerators); b = b.convertToEnum(enumerators); } else { a = a.convertTo(t2, -1, mode); b = b.convertTo(t2, -1, mode); } int comp = a.compareTypeSafe(b, compareMode); if ((sortType & SortOrder.DESCENDING) != 0) { comp = -comp; } return comp; }
Source:
<code>public static void send(Message message, OutputStream outputStream) throws IOException { <START> synchronized (outputStream) { <END> log.trace("Writing on: " + outputStream); StringBuffer toSend = new StringBuffer(message.getCommand().toString()); toSend.append("\n"); Iterator<String> keys = message.getHeaders().keySet().iterator(); while (keys.hasNext()) { String key = keys.next(); String value = message.getHeaders().get(key); toSend.append(key); toSend.append(":"); toSend.append(value); toSend.append("\n"); } toSend.append("\n"); outputStream.write(toSend.toString().getBytes()); if (message.getBody() != null) { outputStream.write(message.getBody()); } outputStream.write("\000\n\n".getBytes()); log.trace("Wrote on: " + outputStream); } }</code><technical_language>I studied issue in detail code changes I need synchronize method, bit writes socket. In fact, if assemble data do a single write I expect OutputStream write out in a single - I need synchronization all</technical_language>

Target:
public static void send(Message message, OutputStream outputStream) throws IOException { log.trace("Writing on: " + outputStream); synchronized (outputStream) { outputStream.write(message.getCommand().getBytes()); outputStream.write(EOL); for (Map.Entry<String, String> header : message.getHeaders().entrySet()) { outputStream.write(header.getKey().getBytes()); outputStream.write(COLON); outputStream.write(header.getValue().getBytes()); outputStream.write(EOL); } outputStream.write(EOL); if(message.getBody() != null) { outputStream.write(message.getBody()); } outputStream.write(EOM); } log.trace("Wrote on: " + outputStream); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); String title = extras.getString(GraphView.TITLE); if (title == null) { requestWindowFeature(Window.FEATURE_NO_TITLE); } else if (title.length() > 0) { setTitle(title); } String html = extras.getString(GraphView.HTML); mView = new GraphView(this, title, true); try { WebView view = (WebView) mView.getView(html); setContentView(view); } catch (InvalidStateException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>Hmm, sure, good call finish() here, I suspect hang a blank screen</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); String title = extras.getString(GraphView.TITLE); if (title == null) { requestWindowFeature(Window.FEATURE_NO_TITLE); } else if (title.length() > 0) { setTitle(title); } String html = extras.getString(GraphView.HTML); mView = new GraphView(this, title, true); try { WebView view = (WebView) mView.getView(html); setContentView(view); } catch (InvalidStateException e) { e.printStackTrace(); finish(); } }