-
Notifications
You must be signed in to change notification settings - Fork 6
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
FirstInstance post refactoring null checks #10
Draft
AlpTorac
wants to merge
36
commits into
CIPM-tools:build-pipeline
Choose a base branch
from
AlpTorac:fi-ref-splitted-null-check
base: build-pipeline
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
FirstInstance post refactoring null checks #10
AlpTorac
wants to merge
36
commits into
CIPM-tools:build-pipeline
from
AlpTorac:fi-ref-splitted-null-check
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from SimilarityChecker and related classes
Implement requests and handlers for certain similarity checking operations used in Java similarity switches Helps centralise the said operations Helps encapsulates some parameters that would otherwise unnecessarily clutter similarity checker and similarity switches
Builds upon the ...similarity.base package, extends and complements its elements with EMFtext Provides exemplary similarity checking requests and handlers (using them is not mandatory)
For Java-related similarity switches Currently empty Can help separate Java-related similarity switches from the rest in the future
to keep the logging logic for Java-related inner switches in one place
For Java-related inner switches to not implement some mutual operations multiple times
Created for Java-related similarity checking
For PCM-related similarity switches
For PCM-related inner similarity switches
For PCM-related similarity checker Use the extracted structure
For ID-based similarity checking of PCMs A separate similarity checker implementation will no longer be necessary To be integrated in the following future commits
For Java-related similarity checking
For logging Java-related inner switches
To their own files without modifying them Non-functional commit
Rename SimilaritySwitch to JavaSimilaritySwitch to indicate its intent better Use the extracted inner switches in the JavaSimilaritySwitch Non-functional commit
To create new Java-related similarity switches Non-functional commit
For Java-related inner switches that create further switches Non-functional commit
Use extracted structure in the Java-related inner switches Use implemented interfaces in the Java-related inner switches Non-functional commit
Non-functional commit
For Java-related similarity checking Non-functional commit
Rename SimilarityChecker to JavaSimilarityChecker Use the extracted structure in the JavaSimilarityChecker Delegate similarity switch creation by using a new similarity switch request Non-functional commit
Adapt classes affected by the changes to the Java-related part of the similarity checking Non-functional commit
To their own files without modifying them Non-functional commit
Use the extracted structure in PCM-related similarity switch Use extracted inner switches in PCM-related similarity switch Non-similarity switch
For creating new PCM-related similarity switches Non-functional commit
For PCM-related inner switches that create further switches Non-functional commit
Use implemented interfaces in PCM-related inner switches Use extracted structure in PCM-related inner switches Non-functional commit
For PCM similarity checker construction Non-functional commit
Non-functional commit
The dynamic toolbox can be set to use ID-based similarity checking handler Non-functional commit
To the PCM related similarity checker construction The FirstInstance should now work in a vacuum SecondInstance is not adapted to the changes yet
The SecondInstance should now work with the preceding changes to FirstInstance
Remove some intusive, non-informative log messages Format them too
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduction
Complements the preceding pull request (#9) with some null checks that prevent several NullPointerExceptions (NPEs).
Since some files were also formatted in the process, ignoring space and commentary differences makes the important changes more visible.
Details
The NPEs handled here can occur when certain attributes of certain Java-Model elements (in form of EObject instances) are not set properly. To circumvent such NPEs, null checks were added to Java-related "inner switches". Concretely, at positions where certain getter/access methods could return null.
Some added null checks are in form of:
if (var1 == null ^ var2 == null) return false;
If differences between var1 and var2 break similarity checking, only one side being null should immediately result in both objects not being similar. Their purpose is to detect differing attributes, which are relevant for similarity checking, and to return early, without proceeding further.