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

Get PsiClass' package by declaration in containingFile and not by its directory #1081 #1111

Merged
merged 1 commit into from
Oct 7, 2022

Conversation

volivan239
Copy link
Collaborator

Description

If package in which class was put doesn't match its directory, we should use packageName of containing PsiFile as packageName for class (and not the directory of containing file).

Fixes #1081

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Manual Scenario

Checked on scenario from #1081 (both when we launch action on misplaced class and when we launch action on method in other class where misplaced class is used) -- tests are generated correctly (although, IDEA can't always correctly handle wrong package).

Checklist (remove irrelevant options):

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

@volivan239 volivan239 force-pushed the volivan239/fix_classnotfound_wrong_package branch from 99f38a1 to 5569063 Compare October 7, 2022 08:56
@volivan239 volivan239 marked this pull request as ready for review October 7, 2022 08:56
@volivan239 volivan239 merged commit 5c15902 into main Oct 7, 2022
@volivan239 volivan239 deleted the volivan239/fix_classnotfound_wrong_package branch October 7, 2022 09:47
@alisevych alisevych added this to the 2022.10.1 Release milestone Oct 10, 2022
AbdullinAM pushed a commit to AbdullinAM/UTBotJava that referenced this pull request Oct 17, 2022
AbdullinAM pushed a commit to AbdullinAM/UTBotJava that referenced this pull request Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ClassNotFoundException in IDE when Java class is put in wrong package
3 participants