This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 269881 - OpenProjects.getDefault().openProjects() throws TimeOutException
Summary: OpenProjects.getDefault().openProjects() throws TimeOutException
Status: NEW
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: Dev
Hardware: PC Windows 10 x64
: P3 normal (vote)
Assignee: Martin Kozeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-20 23:09 UTC by ztefan
Modified: 2017-02-20 23:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
A patch (712 bytes, application/octet-stream)
2017-02-20 23:09 UTC, ztefan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ztefan 2017-02-20 23:09:26 UTC
Created attachment 163673 [details]
A patch

OpenProjects.getDefault().openProjects().get(timeout, timeUnit) will only work as expected if timeUnit is MILLISECONDS.


Future<Project[]> openProjects = OpenProjects.getDefault().openProjects();

// This will work 
Project[] projects = openProjects.get(120000, TimeUnit.MILLISECONDS);

// This will throw TimeOutException (will be treated as 2 ms not 2 min)
Project[] projects = openProjects.get(2, TimeUnit.MINUTES);


To reproduce add the above code in to activate while start up or while opening some large project with a time out passing the time to open the projects, use openProjects.get(2, TimeUnit.DAYS) if you have a really large project, it will crash after 2 ms anyway or return successfully after project load if patch is used.