Skip to content

Cleanup NetBeans Upgrader module. - #7155

Merged
mbien merged 1 commit into
apache:masterfrom
mbien:nb-upgrade-module-cleanup
Mar 18, 2024
Merged

mbien merged 1 commit into
apache:masterfrom
mbien:nb-upgrade-module-cleanup

Conversation

@mbien

@mbien mbien commented Mar 14, 2024 •

Copy link
Copy Markdown
Member

another pass over nb/o.n.upgrade.

  • removed dead code which was tested but not accessible at runtime
  • removed CVS specific code
  • moved test data into test folder
  • code renovation, esp file-IO
  • fixed all compiler warnings
  • bumps the module to java 11, this should be fine I think since the bootstrap module runs first which has the requirements check

@mbien mbien added Code cleanup Label for cleanup done on the Netbeans IDE ci:all-tests [ci] enable all tests ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Upgrade JDK Upgrade to the JDK requirements of a module. labels Mar 14, 2024
@mbien mbien added this to the NB22 milestone Mar 14, 2024
@mbien
mbien force-pushed the nb-upgrade-module-cleanup branch from 292b5b3 to f15c41c Compare March 14, 2024 08:22
d.setVisible (true);
}

static void doUpgrade (File source, String oldVersion)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method has a test but was not used at runtime. I moved a simpler version of this method into the AutoUpgradeTest so that no test coverage of Copy.copyDeep is lost.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the test from AutoUpgrade to CopyTest.

FileUtil.copyAttributes(sourceFile, tg);
}

public static void appendSelectedLines(File sourceFile, File targetFolder, String[] regexForSelection)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method is also not used. Here I removed the test too since this makes no deeper calls beside JDK code -> no real test coverage is lost

@mbien mbien removed the ci:all-tests [ci] enable all tests label Mar 14, 2024
@ebarboni

Copy link
Copy Markdown
Contributor

LGTM

@lkishalmi lkishalmi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@mbien mbien added the Platform [ci] enable platform tests (platform/*) label Mar 14, 2024
@mbien
mbien force-pushed the nb-upgrade-module-cleanup branch from f15c41c to f2cd9cc Compare March 14, 2024 21:47
@mbien

mbien commented Mar 14, 2024 •

Copy link
Copy Markdown
Member Author

found another left open stream while looking through it. Updated the PR, not really noteworthy since it was in a test. diff

@mbien
mbien force-pushed the nb-upgrade-module-cleanup branch from f2cd9cc to 4354765 Compare March 14, 2024 22:44
@mbien

mbien commented Mar 16, 2024

Copy link
Copy Markdown
Member Author

thanks for the reviews so far, planning to merge this Sunday evening UTC.

@mbien
mbien force-pushed the nb-upgrade-module-cleanup branch from 4354765 to 7d861a3 Compare March 17, 2024 04:59
@mbien

mbien commented Mar 17, 2024 •

Copy link
Copy Markdown
Member Author

sorry that I change things after it was already reviewed but I found a few more things to do after debugging.

When looking through IncludeExclude (which is a quite risky implementation), I noticed that the class isn't called at all. Turns out that the whole

final class Copy extends Object {
class isn't used.

AutoUpgrade (the entry point) is only using CopyFiles. and once its done Importer is called. CopyFiles has its own implementation of the import/exclude logic.

now the question is: should we remove more?
Copy, IncludeExclude, PathTransformation+ tests?

Or merge as is?

@mbien

mbien commented Mar 18, 2024

Copy link
Copy Markdown
Member Author

I am thinking that I am going to merge leave the other cleanup options for future PRs.

 - removed dead code which was tested but not accessible at runtime
 - removed CVS specific code
 - moved test data into test folder
 - code renovation, esp file-IO
 - fixed all compiler warnings
@mbien

mbien commented Mar 18, 2024

Copy link
Copy Markdown
Member Author

refreshing PR and preparing for merge

@mbien mbien removed the ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) label Mar 18, 2024
@mbien
mbien force-pushed the nb-upgrade-module-cleanup branch from 7d861a3 to 3034cb5 Compare March 18, 2024 10:21
@mbien
mbien merged commit 3be92f1 into apache:master Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code cleanup Label for cleanup done on the Netbeans IDE Platform [ci] enable platform tests (platform/*) Upgrade JDK Upgrade to the JDK requirements of a module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants