Elements. Migrate ReplaceWithPartOrUriEmpty.

Change-Id: I5ea008521b5f4a89819b52965ae55d4f48198ddf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387421
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analysis_server/analyzer_use_new_elements.txt b/pkg/analysis_server/analyzer_use_new_elements.txt
index a193405..533d29b 100644
--- a/pkg/analysis_server/analyzer_use_new_elements.txt
+++ b/pkg/analysis_server/analyzer_use_new_elements.txt
@@ -417,6 +417,7 @@
 lib/src/services/correction/dart/replace_with_named_constant.dart
 lib/src/services/correction/dart/replace_with_not_null_aware.dart
 lib/src/services/correction/dart/replace_with_null_aware.dart
+lib/src/services/correction/dart/replace_with_part_of_uri.dart
 lib/src/services/correction/dart/replace_with_tear_off.dart
 lib/src/services/correction/dart/replace_with_unicode_escape.dart
 lib/src/services/correction/dart/replace_with_wildcard.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_part_of_uri.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_part_of_uri.dart
index 295c05f..2753c20 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_part_of_uri.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_part_of_uri.dart
@@ -5,7 +5,6 @@
 import 'package:analysis_server/src/services/correction/fix.dart';
 import 'package:analysis_server_plugin/edit/dart/correction_producer.dart';
 import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer_plugin/utilities/change_builder/change_builder_core.dart';
 import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
 import 'package:analyzer_plugin/utilities/range_factory.dart';
@@ -38,14 +37,10 @@
       return;
     }
 
-    var libraryElement = partOfDirective.element;
-    if (libraryElement is! LibraryElement) {
-      return;
-    }
-
-    var libraryPath = libraryElement.source.fullName;
+    var libraryFragment = libraryElement2.firstFragment;
+    var libraryPath = libraryFragment.source.fullName;
     var uriStr = _relativeUriText(libraryPath);
-    _uriStr = _uriStr;
+    _uriStr = uriStr;
 
     await builder.addDartFileEdit(file, (builder) {
       builder.addReplacement(