228 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
2
answers
212
views
junit.framework.AssertionFailedError: Expectation failure on verify: finalize(): expected: 1, actual: 0
I have an old test in code which uses EasyMock instead of Mockito.
When I run test locally then it works, however when it runs in gitlab pipeline then I get:
junit.framework.AssertionFailedError:
...
0
votes
1
answer
79
views
Why is subclass's finalize method, which overrides java.lang.Object's finalize method, called?
Here is the code block
public class Person {
int age;
String name;
//
@Override
public void finalize() throws Throwable{
System.out.println("Garbage collected --->...
0
votes
0
answers
62
views
Garbage Collection and Finalize()
I am trying to write a program that moves an elevator randomly through the floors of different buildings with different stories. I need to use the finalize() method to clean up after every building. ...
-2
votes
1
answer
277
views
Java Object.finalize() vs. C# IDisposable
I have extensive Java experience and know why finalize() is scheduled for a removal soon. On the other hand, my knowledge about C# is skin-deep - I am more or less aware about what features it offers ...
0
votes
0
answers
158
views
Java reference-aware cache
I have memory-expensive objects, that sometimes come with identical content. I would like to cache them as long as they're referenced at least once, and evict from the cache if all referenced are ...
1
vote
2
answers
3k
views
RxJS finalize operator vs tap({ finalize: () => {} })
Is there any difference between A and B? Are there any cases where one would behave differently than the other?
A)
observableHere
.pipe(
finalize(() => {
// Do stuff here
...
0
votes
1
answer
134
views
java System.gc() only works if I set obj=null implicitly?
I'm using Java 8 on windows 10 and I have this code snippet to test how System.gc() works:
public class testGc{
static class MyObject{
@Override
protected void finalize() throws ...
0
votes
0
answers
950
views
Many objects with finalize() in heap, i.e. PgConnection
When analyzing a heap dump of my application I noticed 1478 instances of java.lang.red.Finalizer class. 501 of them was referencing org.postgresql.jdbc.PgConnection class and another 501 sun.security....
4
votes
2
answers
3k
views
RxJS finalize(): pass the last emitted value to the callback
In my Angular service, I've got a loading prop which I set true as a first thing done in the method fetching data. I want to set loading to false after the data is downloaded. I was doing it in ...
0
votes
0
answers
508
views
Problem with MPI_Finalize at the end of a code
I have a Fortran 90 code which uses the MPI library. At the end of the code, I have the following statements to finish the program:
call MPI_Finalize(ierr)
write(6,*) ierr
stop
The code to ...
1
vote
0
answers
849
views
AlreadyFinalized("Context was already finalized.")
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import padding
import os
...
0
votes
3
answers
721
views
calling finalize() of super class in Kotlin
I have the following Java code I wanted to convert into Kotlin:
@Override
protected void finalize() throws Throwable {
try {
release();
} finally {
super.finalize();
}
}
...
1
vote
0
answers
259
views
Fortran Final Procedures Not Being Called in the Expected Manner [duplicate]
I have a container type that has an allocatable array of another type. When the final procedure is called on the container type and the allocatable array is deallocated, it doesn't trigger the final ...
-1
votes
1
answer
170
views
C# Will the typical IDisposable pattern not cause resource leak in some condition
Below is a typical IDisposable implementation for C# class which has managed and unmanaged resources both. My question is, Can there be a situation where ~DisposableObject() destructor method gets ...
0
votes
0
answers
216
views
Unload a dll loaded by a classloader in Java11
I had a scenario where I need to perform database connectivity using Java11 twice using Windows Authentication on SQL server.
Initially, the sqljdbc_auth.dll is loaded for the first call and the ...