Override compulsion

11 views
Skip to first unread message

Anku

unread,
Apr 21, 2017, 4:57:30 AM4/21/17
to checkstyle
I want to add a compulsion in my source code for overriding certain method if a condition satisfies.

Here is more detail about it:
I have an interface, say Interface1 & a class which extends from another class, say Class1 extends BaseClass(with 2 methods).

Now if Class1 implements Interface1 then I need to add a compulsion for the developer to override the base class methods in Class1.

Is there any build in check available for it or do we need to write custom check for it.

Thanks!

Roman Ivanov

unread,
Apr 21, 2017, 7:54:08 AM4/21/17
to Anku, checkstyle
Hi Anku,

There is nothing ready to use for your problem. You need special module/Check for this.

the problem you might run into with Checkstyle is that Checkstyle does not have information about classes that are located in different files (base classes).

So it will be impossible in run time to find all base class methods(probably even without a source file at all, taken from jar).

For more information:


thanks,
Roman Ivanov

--
You received this message because you are subscribed to the Google Groups "checkstyle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to checkstyle+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages