/*
 * Copyright 2015-present Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may obtain
 * a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package com.facebook.buck.util;

import com.sun.security.auth.module.UnixSystem;

/**
 * Fetches the user ID of the running process.
 */
public class UnixUserIdFetcher implements UserIdFetcher {
  @Override
  public long getUserId() {
    return new UnixSystem().getUid();
  }
}

@@ -644,47 +644,32 @@
 ort 
-com.sun.security.auth.module.UnixSystem
+java.lang.reflect.Method
 ;%0A%0A/
@@ -828,41 +828,322 @@
     
-return new UnixSystem().getUid();
+try %7B%0A      Class%3C?%3E cls = Class.forName(%22com.sun.security.auth.module.UnixSystem%22, true, null);%0A      Object unixSystem = cls.newInstance();%0A      Method getUid = cls.getDeclaredMethod(%22getUid%22);%0A      return (long) getUid.invoke(unixSystem);%0A    %7D catch (Exception e) %7B%0A      throw new RuntimeException(e);%0A    %7D
 %0A  %7D

Use reflection to access UnixSystem