mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8188083: NullPointerExcpn-java.awt.image.FilteredImageSource.startProduction JDK-8079607
Reviewed-by: serb, prr, jdv
This commit is contained in:
parent
72e094dcd4
commit
c0e7592e4e
2 changed files with 217 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -35,7 +35,8 @@ import java.awt.image.ColorModel;
|
|||
/**
|
||||
* This class is an implementation of the ImageProducer interface which
|
||||
* takes an existing image and a filter object and uses them to produce
|
||||
* image data for a new filtered version of the original image.
|
||||
* image data for a new filtered version of the original image. Furthermore,
|
||||
* {@code FilteredImageSource} is safe for use by multiple threads.
|
||||
* Here is an example which filters an image by swapping the red and
|
||||
* blue components:
|
||||
* <pre>
|
||||
|
@ -171,7 +172,7 @@ public class FilteredImageSource implements ImageProducer {
|
|||
* @param ic the consumer for the filtered image
|
||||
* @see ImageConsumer
|
||||
*/
|
||||
public void startProduction(ImageConsumer ic) {
|
||||
public synchronized void startProduction(ImageConsumer ic) {
|
||||
if (proxies == null) {
|
||||
proxies = new Hashtable<>();
|
||||
}
|
||||
|
@ -198,7 +199,7 @@ public class FilteredImageSource implements ImageProducer {
|
|||
*
|
||||
* @see ImageConsumer
|
||||
*/
|
||||
public void requestTopDownLeftRightResend(ImageConsumer ic) {
|
||||
public synchronized void requestTopDownLeftRightResend(ImageConsumer ic) {
|
||||
if (proxies != null) {
|
||||
ImageFilter imgf = proxies.get(ic);
|
||||
if (imgf != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue