You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We normally lean on Java Code Conventions but we must clarify this in documentation.
Wanted
The link to java coding conventions should be in SecHub documentation + mentioning following:
First static parts then other
first fields, than methods, after this internal classes
public before protected before package private and this before private
Constructors always on top of other methods (except static)
An example:
packagecom.example.demo;
publicclassDemoClass1{
publicstaticfinalStringPUBLIC_CONSTANT="I am public so I am before protected";
protectedstaticfinalStringPROTECTED_CONSTANT="I am protected means before package private";
staticfinalStringPACKAGE_PRIV_INTERNAL_CONSTANT="package private before private...";
privatestaticfinalStringPRIV_INTERNAL_CONSTANT="private internal constant at the end";
publicStringtestField1;
protectedStringtestField2;
StringtestField3;
privateStringtestField4;
publicstaticStringcreateInfo() {
return"from public...";
}
protectedstaticStringcreateInfo2() {
return"from protected...";
}
publicDemoClass1(){
this("from-public");
}
protectedDemoClass1(Stringfrom){
SpeakerSubclass.INSTANCE.speak("I am from: "+from);
}
privatestaticclassSpeakerSubclass {
privatestaticfinalSpeakerSubclassINSTANCE = newSpeakerSubclass();
privatevoidspeak(Stringwhat){
System.out.println(what);
}
}
}
The text was updated successfully, but these errors were encountered:
Situation
https://mercedes-benz.github.io/sechub/latest/sechub-techdoc.html#section-coding-conventions
Does not contain information how fields methods etc. shall be ordered in java etc.
We normally lean on Java Code Conventions but we must clarify this in documentation.
Wanted
The link to java coding conventions should be in SecHub documentation + mentioning following:
An example:
The text was updated successfully, but these errors were encountered: