Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven Plugin's PropertiesMergingResourceTransformer closes InputStream when it should not do so #34063

Closed
wants to merge 1 commit into from

Conversation

enimiste
Copy link
Contributor

@enimiste enimiste commented Feb 4, 2023

Hi,
This is a conformity fix, as the interface ReproducibleResourceTransformer requires that "An input stream for the resource, the implementation should not close this stream" :

public interface ReproducibleResourceTransformer
    extends ResourceTransformer
{
    /**
     * Transform an individual resource
     * @param resource The resource name
     * @param is An input stream for the resource, the implementation should *not* close this stream
     * @param relocators  A list of relocators
     * @param time the time of the resource to process
     * @throws IOException When the IO blows up
     */
    void processResource( String resource, InputStream is, List<Relocator> relocators, long time )
        throws IOException;
}

I think that the implementation shouldn't close the input stream.
Thanks

The "ReproducibleResourceTransformer" interface says that "An input stream for the resource, the implementation should *not* close this stream".
@pivotal-cla
Copy link

@enimiste Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@enimiste Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 4, 2023
@wilkinsona wilkinsona changed the title Remove inputStream.close() line to conform to the interface Maven Plugin's PropertiesMergingResourceTransformer closes InputStream when it should not do so Feb 6, 2023
@wilkinsona wilkinsona added the type: bug A general bug label Feb 6, 2023
@wilkinsona wilkinsona added this to the 2.7.x milestone Feb 6, 2023
@wilkinsona wilkinsona removed the status: waiting-for-triage An issue we've not yet triaged label Feb 6, 2023
@mhalbritter mhalbritter self-assigned this Feb 6, 2023
@mhalbritter
Copy link
Contributor

Thank you and congrats on your first spring boot contribution!

@mhalbritter mhalbritter modified the milestones: 2.7.x, 2.7.9 Feb 6, 2023
mhalbritter pushed a commit that referenced this pull request Feb 6, 2023
The "ReproducibleResourceTransformer" interface says that "An input
  stream for the resource, the implementation should *not* close this
  stream".

See gh-34063
@enimiste enimiste deleted the patch-1 branch February 6, 2023 12:29
krenson pushed a commit to krenson/test-push that referenced this pull request Mar 15, 2023
…ot-starter-parent from 2.7.8 to 2.7.9 (patch)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [org.springframework.boot:spring-boot-starter-parent](https://spring.io/projects/spring-boot) ([source](https://github.com/spring-projects/spring-boot)) | parent | patch | `2.7.8` -> `2.7.9` |

---

### Release Notes

<details>
<summary>spring-projects/spring-boot</summary>

### [`v2.7.9`](https://github.com/spring-projects/spring-boot/releases/tag/v2.7.9)

[Compare Source](spring-projects/spring-boot@v2.7.8...v2.7.9)

#### 🐞 Bug Fixes

-   Maven Plugin's PropertiesMergingResourceTransformer closes InputStream when it should not do so [#&#8203;34063](spring-projects/spring-boot#34063)
-   Actuator Health web endpoint broken with Gson and Java 17 [#&#8203;34030](spring-projects/spring-boot#34030)
-   Dependency management for Mongo's Java Driver is incomplete [#&#8203;33941](spring-projects/spring-boot#33941)
-   Using devtools with Reactive application results in slower restarts [#&#8203;33855](spring-projects/spring-boot#33855)
-   Spies are not reset after test execution when using `@SpyBean` [#&#8203;33830](spring-projects/spring-boot#33830)
-   Properties Migrator does not detect properties of Map type that are marked as deprecated [#&#8203;27854](spring-projects/spring-boot#27854)

#### 📔 Documentation

-   Updated documentation for `@ConfigurationProperties` bean naming rules [#&#8203;34029](spring-projects/spring-boot#34029)
-   Restore "Use Jedis Instead of Lettuce" how-to documentation [#&#8203;33994](spring-projects/spring-boot#33994)
-   Add Redis application properties example [#&#8203;33965](spring-projects/spring-boot#33965)
-   Use Maven Central for release downloads in CLI installation documentation [#&#8203;33962](spring-projects/spring-boot#33962)
-   Actuator section is missing from documentation overview [#&#8203;33932](spring-projects/spring-boot#33932)
-   Add Javadoc since to OperationParameter.getAnnotation() [#&#8203;33914](spring-projects/spring-boot#33914)
-   Document additional configuration that is required for spring.mvc.throw-exception-if-no-handler-found=true to be effective [#&#8203;31660](spring-projects/spring-boot#31660)

#### 🔨 Dependency Upgrades

-   Upgrade to ActiveMQ 5.16.6 [#&#8203;34238](spring-projects/spring-boot#34238)
-   Upgrade to Byte Buddy 1.12.23 [#&#8203;34239](spring-projects/spring-boot#34239)
-   Upgrade to Dropwizard Metrics 4.2.16 [#&#8203;34240](spring-projects/spring-boot#34240)
-   Upgrade to Elasticsearch 7.17.9 [#&#8...
krenson pushed a commit to krenson/test-push that referenced this pull request Mar 15, 2023
…ot-starter-parent from 2.7.8 to 2.7.9 (patch)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [org.springframework.boot:spring-boot-starter-parent](https://spring.io/projects/spring-boot) ([source](https://github.com/spring-projects/spring-boot)) | parent | patch | `2.7.8` -> `2.7.9` |

---

### Release Notes

<details>
<summary>spring-projects/spring-boot</summary>

### [`v2.7.9`](https://github.com/spring-projects/spring-boot/releases/tag/v2.7.9)

[Compare Source](spring-projects/spring-boot@v2.7.8...v2.7.9)

#### 🐞 Bug Fixes

-   Maven Plugin's PropertiesMergingResourceTransformer closes InputStream when it should not do so [#&#8203;34063](spring-projects/spring-boot#34063)
-   Actuator Health web endpoint broken with Gson and Java 17 [#&#8203;34030](spring-projects/spring-boot#34030)
-   Dependency management for Mongo's Java Driver is incomplete [#&#8203;33941](spring-projects/spring-boot#33941)
-   Using devtools with Reactive application results in slower restarts [#&#8203;33855](spring-projects/spring-boot#33855)
-   Spies are not reset after test execution when using `@SpyBean` [#&#8203;33830](spring-projects/spring-boot#33830)
-   Properties Migrator does not detect properties of Map type that are marked as deprecated [#&#8203;27854](spring-projects/spring-boot#27854)

#### 📔 Documentation

-   Updated documentation for `@ConfigurationProperties` bean naming rules [#&#8203;34029](spring-projects/spring-boot#34029)
-   Restore "Use Jedis Instead of Lettuce" how-to documentation [#&#8203;33994](spring-projects/spring-boot#33994)
-   Add Redis application properties example [#&#8203;33965](spring-projects/spring-boot#33965)
-   Use Maven Central for release downloads in CLI installation documentation [#&#8203;33962](spring-projects/spring-boot#33962)
-   Actuator section is missing from documentation overview [#&#8203;33932](spring-projects/spring-boot#33932)
-   Add Javadoc since to OperationParameter.getAnnotation() [#&#8203;33914](spring-projects/spring-boot#33914)
-   Document additional configuration that is required for spring.mvc.throw-exception-if-no-handler-found=true to be effective [#&#8203;31660](spring-projects/spring-boot#31660)

#### 🔨 Dependency Upgrades

-   Upgrade to ActiveMQ 5.16.6 [#&#8203;34238](spring-projects/spring-boot#34238)
-   Upgrade to Byte Buddy 1.12.23 [#&#8203;34239](spring-projects/spring-boot#34239)
-   Upgrade to Dropwizard Metrics 4.2.16 [#&#8203;34240](spring-projects/spring-boot#34240)
-   Upgrade to Elasticsearch 7.17.9 [#&#8...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants