onCreateDialog implementation warning

When implementing the onCreateDialog method in Chapter 12 (page 230) for the DatePickerFragment class, I get the following warning from Android Studio:
Not annotated method overrides method annotated with @NonNull
This inspection reports problems related to @Nullable and @NotNull annotations usage configured in Constant conditions & exceptions inspection.

This seems to be an issue with which version of DialogFragment I am using. If I don’t use the support library version of DialogFragment (as seems to be indicated in the book), the warning disappears. Here is my code:

import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;

public class DatePickerFragment extends DialogFragment {
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new AlertDialog.Builder(getActivity())
.setPositiveButton(android.R.string.ok, null)

Changing the class declaration to extend android.app.DialogFragment solves the problem. Have I made some mistake in following the book instructions? Is this warning something I even need to worry about?