{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/2493","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/2493/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/2493/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/2493/events","html_url":"https://github.com/dotnet/corefx/pull/2493","id":97104551,"number":2493,"title":"Avoid unnecessary byte[] allocations in HttpContent","user":{"login":"justinvp","id":710598,"avatar_url":"https://avatars.githubusercontent.com/u/710598?v=3","gravatar_id":"","url":"https://api.github.com/users/justinvp","html_url":"https://github.com/justinvp","followers_url":"https://api.github.com/users/justinvp/followers","following_url":"https://api.github.com/users/justinvp/following{/other_user}","gists_url":"https://api.github.com/users/justinvp/gists{/gist_id}","starred_url":"https://api.github.com/users/justinvp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinvp/subscriptions","organizations_url":"https://api.github.com/users/justinvp/orgs","repos_url":"https://api.github.com/users/justinvp/repos","events_url":"https://api.github.com/users/justinvp/events{/privacy}","received_events_url":"https://api.github.com/users/justinvp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/corefx/labels/2%20-%20In%20Progress","name":"2 - In Progress","color":"CCCCCC"},{"url":"https://api.github.com/repos/dotnet/corefx/labels/cla-already-signed","name":"cla-already-signed","color":"009800"},{"url":"https://api.github.com/repos/dotnet/corefx/labels/Needs%20extra%20testing%20before%20merge","name":"Needs extra testing before merge","color":"e11d21"},{"url":"https://api.github.com/repos/dotnet/corefx/labels/System.Net","name":"System.Net","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-07-24T18:00:15Z","updated_at":"2015-08-25T04:56:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/2493","html_url":"https://github.com/dotnet/corefx/pull/2493","diff_url":"https://github.com/dotnet/corefx/pull/2493.diff","patch_url":"https://github.com/dotnet/corefx/pull/2493.patch"},"body":"`HttpContent.ReadAsStringAsync()` has a bunch of calls to `Encoding.GetPreamble()` as part of its encoding detection. `GetPreamble()` creates a new `byte[]` each time it is called. These `byte[]` allocations can be avoided."},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/134474274","html_url":"https://github.com/dotnet/corefx/pull/2493#issuecomment-134474274","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/2493","id":134474274,"user":{"login":"justinvp","id":710598,"avatar_url":"https://avatars.githubusercontent.com/u/710598?v=3","gravatar_id":"","url":"https://api.github.com/users/justinvp","html_url":"https://github.com/justinvp","followers_url":"https://api.github.com/users/justinvp/followers","following_url":"https://api.github.com/users/justinvp/following{/other_user}","gists_url":"https://api.github.com/users/justinvp/gists{/gist_id}","starred_url":"https://api.github.com/users/justinvp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinvp/subscriptions","organizations_url":"https://api.github.com/users/justinvp/orgs","repos_url":"https://api.github.com/users/justinvp/repos","events_url":"https://api.github.com/users/justinvp/events{/privacy}","received_events_url":"https://api.github.com/users/justinvp/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T04:56:55Z","updated_at":"2015-08-25T04:56:55Z","body":"Looks like the CI build is failing for unrelated reasons:\r\n\r\n```\r\nERROR: Failed to run DSL Script\r\njava.util.concurrent.ExecutionException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.plugins.flow.JobExecutionFailureException\r\n\tat java.util.concurrent.FutureTask.report(FutureTask.java:122)\r\n\tat java.util.concurrent.FutureTask.get(FutureTask.java:188)\r\n\tat java_util_concurrent_Future$get.call(Unknown Source)\r\n\tat com.cloudbees.plugins.flow.FlowDelegate$_parallel_closure6.doCall(FlowDSL.groovy:440)\r\n\tat sun.reflect.GeneratedMethodAccessor578.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\r\n\tat groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)\r\n\tat org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)\r\n\tat groovy.lang.Closure.call(Closure.java:415)\r\n\tat groovy.lang.Closure.call(Closure.java:428)\r\n\tat org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379)\r\n\tat org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1351)\r\n\tat org.codehaus.groovy.runtime.dgm$170.invoke(Unknown Source)\r\n\tat org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)\r\n\tat org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)\r\n\tat com.cloudbees.plugins.flow.FlowDelegate.parallel(FlowDSL.groovy:438)\r\n\tat sun.reflect.GeneratedMethodAccessor666.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\r\n\tat groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1079)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:723)\r\n\tat com.cloudbees.plugins.flow.FlowDelegate.invokeMethod(FlowDSL.groovy)\r\n\tat hudson.util.spring.ClosureScript.invokeMethod(ClosureScript.java:83)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:72)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)\r\n\tat Script1.run(Script1.groovy:1)\r\n\tat Script1$run.call(Unknown Source)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)\r\n\tat Script1$run.call(Unknown Source)\r\n\tat com.cloudbees.plugins.flow.FlowDSL.executeFlowScript(FlowDSL.groovy:84)\r\n\tat com.cloudbees.plugins.flow.FlowRun$BuildWithWorkspaceRunnerImpl.doRun(FlowRun.java:180)\r\n\tat hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)\r\n\tat hudson.model.Run.execute(Run.java:1741)\r\n\tat hudson.model.Run.run(Run.java:1679)\r\n\tat com.cloudbees.plugins.flow.FlowRun.run(FlowRun.java:153)\r\n\tat hudson.model.ResourceController.execute(ResourceController.java:98)\r\n\tat hudson.model.Executor.run(Executor.java:381)\r\nCaused by: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.plugins.flow.JobExecutionFailureException\r\n\tat org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:97)\r\n\tat groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)\r\n\tat org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)\r\n\tat groovy.lang.Closure.call(Closure.java:415)\r\n\tat groovy.lang.Closure.call(Closure.java:409)\r\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:262)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: com.cloudbees.plugins.flow.JobExecutionFailureException\r\n\tat sun.reflect.GeneratedConstructorAccessor394.newInstance(Unknown Source)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:526)\r\n\tat org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)\r\n\tat org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:186)\r\n\tat com.cloudbees.plugins.flow.FlowDelegate.fail(FlowDSL.groovy:171)\r\n\tat com.cloudbees.plugins.flow.FlowDelegate.statusCheck(FlowDSL.groovy:205)\r\n\tat com.cloudbees.plugins.flow.FlowDelegate.build(FlowDSL.groovy:210)\r\n\tat sun.reflect.GeneratedMethodAccessor584.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\r\n\tat groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1079)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:723)\r\n\tat com.cloudbees.plugins.flow.FlowDelegate.invokeMethod(FlowDSL.groovy)\r\n\tat hudson.util.spring.ClosureScript.invokeMethod(ClosureScript.java:83)\r\n\tat org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:407)\r\n\tat org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:346)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)\r\n\tat Script1$_run_closure1.doCall(Script1.groovy:17)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\r\n\tat groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)\r\n\tat org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)\r\n\tat Script1$_run_closure1.doCall(Script1.groovy)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\r\n\tat groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)\r\n\tat org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)\r\n\tat com.cloudbees.plugins.flow.FlowDelegate$_parallel_closure5_closure7.doCall(FlowDSL.groovy:427)\r\n\tat sun.reflect.GeneratedMethodAccessor552.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\r\n\tat groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)\r\n\tat org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)\r\n\tat groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)\r\n\tat com.cloudbees.plugins.flow.FlowDelegate$_parallel_closure5_closure7.doCall(FlowDSL.groovy)\r\n\tat sun.reflect.GeneratedMethodAccessor549.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\r\n\t... 9 more\r\n```"}}