diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
index 32784a3..b85addd 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
@@ -160,31 +160,6 @@
                                        intent));
     }
 
-    /**
-     * Creates an unprotected intent.
-     * @param ingressPoint the ingress connect point
-     * @param egressPoint the egress connect point
-     * @param intent the original intent
-     * @return the compilation result
-     * @deprecated 1.10.0
-     */
-    @Deprecated
-    private List<Intent> createUnprotectedIntent(ConnectPoint ingressPoint,
-                                                 ConnectPoint egressPoint,
-                                                 PointToPointIntent intent) {
-        List<Link> links = new ArrayList<>();
-        Path path = getPathOrException(intent, ingressPoint.deviceId(),
-                                       egressPoint.deviceId());
-
-        links.add(createEdgeLink(ingressPoint, true));
-        links.addAll(path.links());
-        links.add(createEdgeLink(egressPoint, false));
-
-        return asList(createPathIntent(new DefaultPath(PID, links, path.weight(),
-                                                       path.annotations()), intent,
-                                       PathIntent.ProtectionType.PRIMARY));
-    }
-
     private List<Intent> createUnprotectedLinkCollectionIntent(PointToPointIntent intent) {
         Path path = getPathOrException(intent, intent.filteredIngressPoint().connectPoint().deviceId(),
                                        intent.filteredEgressPoint().connectPoint().deviceId());
