Why is sonarLint saying 'Close this "Stream"' on Stream.of() but not on .stream() - sonarlint

I am using the sonarLint plugin in eclipse
On this line i get 'Close this "Stream"'
Stream.concat(Stream.of("a"),
Stream.of("b")).collect(Collectors.toSet());
but not on
Arrays.asList("a", "b").stream().collect(Collectors.toSet());
I don't understand why not its not the same message on both lines.
I am not sure if this is a java question or a sonarlint question.

This is an issue already fixed in the upcoming version (3.14) of the java plugin : https://jira.sonarsource.com/browse/SONARJAVA-1478
See this other question for more details : When is an IntStream actually closed?

Related

Apache POI 4.1 - new XSSFWorkbook causes POIXMLException: Strict OOXML isn't currently supported

I am aware that about 3-4 years ago, there was an issue(bug #57699) with reading .xlsx file (org.apache.poi.POIXMLException Strict OOXML isn't currently supported, please see bug #57699)
Today I tried Apache POI 4.1, I still see bug #57699 with the following 1 line of code:
XSSFWorkbook workbook = new XSSFWorkbook(uploadFile.getInputStream());
The exception message is below:
org.apache.poi.ooxml.POIXMLException: Strict OOXML isn't currently supported, please see bug #57699
Is there any workaround solution with bug #57699 beside using different format?
Thank you greatly for help!

Monodevelop fails to build, can't find Microsoft.DiaSymReader.Native.x86.dll'

I am trying to build a web api project using monodevelop on a mac. The thing is that after a few hiccups (explained in a question that turned out to be so messy I have just deleted) I get to the point of getting this error
/Users/myuser/git/LiveData/LiveData/CSC: Error CS0041: Unexpected error writing debug information -- 'Windows PDB writer is not available -- could not find Microsoft.DiaSymReader.Native.x86.dll' (CS0041) (LiveData)
In a windows machine the same project builds using visual studio targeting mono 4.5.
When I click on the error it tells me that /Users/myuser/git/LiveData/LiveData/CSC doesn't exist
Another thing is that in the folder structure of the solution there's a package folder (not the one inside the project) and inside this one I have a folder called Microsoft.Net.Compilers 1.3.2 that has inside another folder called "tools" that contains among other things csc.exe and the dll thta can't be found.
I have tried to install the dll directly in the project using nuget but even if it was installed the build showed me the same error
Thanks,
As for workaround for now you can just limit usage of Microsoft.Net.Compilers to Release configuration (edit *.csproj file):
<Import Project="..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props" Condition="'$(Configuration)' == 'Release' And Exists('..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" />
take a look at beginning of condition:
'$(Configuration)' == 'Release'
This way I can build and debug locally and build my project ie. in appharbor.
Building the project in release configuration should fix it!
This might not be completely related but may be helpful in some ways. Regarding the issue on 'could not find Microsoft.DiaSymReader.Native.x86.dll', have a look at this issue on GitHub: https://github.com/dotnet/cli/issues/3016
It seems like the solution is either:
Dependency to Microsoft.NETCore.Platforms needed for RID graph which
was missing. Any package which has transitive dependency on it (like
NETStandard.Library) could also make things work.
Adding dependency to "Microsoft.NETCore.Platforms": "1.0.1-" or
"NETStandard.Library":"1.5.0-" make it work.
adding Microsoft.NETCore.Platforms works as well

Why does VS2013 sometimes throws exception 0x80070057 when closing a file?

Sometimes, not all the time, Visual Studio 2013 w/ Update 1 on an up to date Win7 x64 machine throws an exception when closing a file, or multiple files doing "Close All But This". A dialog is shown referring you to the "ActivityLog.xml" file at "C:\Users\\AppData\Roaming\Microsoft\VisualStudio\12.0" which has one of the following entries for each file that was being closed. I am using the latest version of DevExpress controls.
How can I fix this? I did not find any similar issues though post Is there something I can/should do about this VS 2013 exception? was vaguely similar but this does not happen when I open a solution.
So far, it seems to occur mostly when having multiple instances of VS2013 open but I am unable to repro at will. Clearing the ComponentModelCache did not help in that it has occurred again after clearing the cache. The solution was originally a VS2012 solution and all new DevX, MVC and EF components have been updated to latest versions with NuGet.
<entry>
<record>858</record>
<time>2014/02/17 20:22:45.177</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure)
at Microsoft.VisualStudio.Shell.RunningDocumentTable.FindDocument(String moniker, IVsHierarchy& hierarchy, UInt32& itemid, UInt32& docCookie)
at Microsoft.VisualStudio.CodeSense.Editor.Roslyn.CodeElementTaggerProvider.CreateTagger(ITextView textView)
at Microsoft.VisualStudio.CodeSense.Editor.TaggerProvider`1.CreateTagger[T](ITextView textView, ITextBuffer buffer)
at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)</description>
This appears to be a bug in the Code Sense engine. They are requesting a document from the Running Document Table after the document has been closed. I encourage you to please file a bug on this (customer bugs get more attention than if I just filed it)
http://connect.microsoft.com/VisualStudio
The only thing you can do to stop this is to disable Code Sense
Tools -> Options
Text Editor -> All Languages -> Code Lens
Uncheck "Enable CodeLens"

Configuring xUnit for CUnit in Hudson CI

I want to use Hudson CI for my c-project, which also uses CUnit. However I've also come to understand that there is currently no plugin that supports CUnit. So I read on the internets that this might be possible using the xUnit plugin by translating between CUnit and JUnit, but using the supplied file yields an error.
[xUnit] [ERROR] - The plugin hasn't been performed correctly: Conversion error Error to convert the input XML document
So my question is; has anyone successfully run CUnit tests in hudson. And, in that case, how?
#Nubsis: Did you by any chance copy & paste from the listing? The downloadable file seems to work just fine.
If you found errors in it let me know so I can fix them and put an updated version on my blog so others don't run into the same problems you had.
As it turns out, there were some syntax errors in the xslt-file provided in the link. After correcting this and some identifiers it worked out well.

MySQL T4 Templates Error: Metadata file 'MySql.Data' could not be found

D:\Web\CityV2\App_Code\ActiveRecord.tt(0,0) : error CS0006: Compiling transformation: Metadata file 'MySql.Data' could not be found
Let me start by saying I'm using VWD 2008 Express.
These are the steps I've taken so far:
Created an entirely new project
Added references for Subsonic.Core.dll and MySql.Data.dll
Copied Active Record templates to project
Changed all <## include file="SQLServer.ttinclude" #> to <## include file="MySQL.ttinclude" #>
Copied the MySQL.ttinclude and Settings.ttinclude from the TemplateProviders folder
Updated Settings.ttinclude with my connectionstring and database information
Updated the Settings.ttinclude and created the external tool mapping as per ranomore's instructions
Attempted to build the code from the templates and received the error
I then realized that I didn't have MySql Connector "installed" on my dev box (even though I added a reference to the bin). So I proceeded to MySQL.com and downloaded the latest 6.0.4 connector msi and installed it (GAC). The error no longer appears, but neither does anything else: no new classes, no new errors, nothing [and yes, I refreshed the project after running the command ;-)].
Two things:
Am I missing a step somewhere?
Is there a way build the templates without needing MySQL installed to the GAC?
Unfortunately SubSonic 3 doesn't support VWD 2008 Express (or more specifically VWD doesn't support t4). There is a sort of workaround that ranomore came up with but it will require some work by you. See the following question for more details:
SubSonic ASP.NET MVC sample in Visual Web Developer Express
EDIT: I should have read your question properly you obviously already have the link above. Maybe worth your while downloading the trial of VS professional and seeing if you have more luck with that to see if it's worth outlaying the cash to buy it.
On a side note if you're looking to get an msdn subscription for free you should have a look into registering for the bizspark program