Program: 5225
Project: 5225
Buggy source:
@Override public StreamConfig create(final StreamId streamId,@Nullable final Properties props) throws Exception {
  NamespaceId streamNamespace=streamId.getParent();
  ensureAccess(streamNamespace,Action.WRITE);
  privilegesManager.revoke(streamId);
  final Properties properties=(props == null) ? new Properties() : props;
  try {
    privilegesManager.grant(streamId,authenticationContext.getPrincipal(),EnumSet.allOf(Action.class));
    String ownerPrincipal=properties.containsKey(Constants.Security.PRINCIPAL) ? properties.getProperty(Constants.Security.PRINCIPAL) : null;
    if (exists(streamId)) {
      verifyOwner(streamId,ownerPrincipal);
    }
 else {
      if (ownerPrincipal != null) {
        ownerAdmin.add(streamId,new KerberosPrincipalId(ownerPrincipal));
      }
    }
    final Location streamLocation=impersonator.doAs(streamId,new Callable<Location>(){
      @Override public Location call() throws Exception {
        assertNamespaceHomeExists(streamId.getParent());
        Location streamLocation=getStreamLocation(streamId);
        Locations.mkdirsIfNotExists(streamLocation);
        return streamLocation;
      }
    }
);
    return streamCoordinatorClient.createStream(streamId,new Callable<StreamConfig>(){
      @Override public StreamConfig call() throws Exception {
        if (exists(streamId)) {
          return null;
        }
        long createTime=System.currentTimeMillis();
        long partitionDuration=Long.parseLong(properties.getProperty(Constants.Stream.PARTITION_DURATION,cConf.get(Constants.Stream.PARTITION_DURATION)));
        long indexInterval=Long.parseLong(properties.getProperty(Constants.Stream.INDEX_INTERVAL,cConf.get(Constants.Stream.INDEX_INTERVAL)));
        long ttl=Long.parseLong(properties.getProperty(Constants.Stream.TTL,cConf.get(Constants.Stream.TTL)));
        int threshold=Integer.parseInt(properties.getProperty(Constants.Stream.NOTIFICATION_THRESHOLD,cConf.get(Constants.Stream.NOTIFICATION_THRESHOLD)));
        String description=properties.getProperty(Constants.Stream.DESCRIPTION);
        FormatSpecification formatSpec=null;
        if (properties.containsKey(Constants.Stream.FORMAT_SPECIFICATION)) {
          formatSpec=GSON.fromJson(properties.getProperty(Constants.Stream.FORMAT_SPECIFICATION),FormatSpecification.class);
        }
        final StreamConfig config=new StreamConfig(streamId,partitionDuration,indexInterval,ttl,streamLocation,formatSpec,threshold);
        impersonator.doAs(streamId,new Callable<Void>(){
          @Override public Void call() throws Exception {
            writeConfig(config);
            return null;
          }
        }
);
        createStreamFeeds(config);
        alterExploreStream(streamId,true,config.getFormat());
        streamMetaStore.addStream(streamId,description);
        publishAudit(streamId,AuditType.CREATE);
        SystemMetadataWriter systemMetadataWriter=new StreamSystemMetadataWriter(metadataStore,streamId,config,createTime,description);
        systemMetadataWriter.write();
        return config;
      }
    }
);
  }
 catch (  Exception e) {
    privilegesManager.revoke(streamId);
    ownerAdmin.delete(streamId);
    throw e;
  }
}

Fixed version (ground truth):
@Override @Nullable public StreamConfig create(final StreamId streamId,@Nullable final Properties props) throws Exception {
  NamespaceId streamNamespace=streamId.getParent();
  ensureAccess(streamNamespace,Action.WRITE);
  final Properties properties=(props == null) ? new Properties() : props;
  String ownerPrincipal=properties.containsKey(Constants.Security.PRINCIPAL) ? properties.getProperty(Constants.Security.PRINCIPAL) : null;
  if (exists(streamId)) {
    verifyOwner(streamId,ownerPrincipal);
    return null;
  }
  try {
    privilegesManager.revoke(streamId);
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str" + "String_Node_Str");
  }
  if (ownerPrincipal != null) {
    ownerAdmin.add(streamId,new KerberosPrincipalId(ownerPrincipal));
  }
  try {
    privilegesManager.grant(streamId,authenticationContext.getPrincipal(),EnumSet.allOf(Action.class));
    try {
      final Location streamLocation=impersonator.doAs(streamId,new Callable<Location>(){
        @Override public Location call() throws Exception {
          assertNamespaceHomeExists(streamId.getParent());
          Location streamLocation=getStreamLocation(streamId);
          Locations.mkdirsIfNotExists(streamLocation);
          return streamLocation;
        }
      }
);
      return createStream(streamId,properties,streamLocation);
    }
 catch (    Exception e) {
      privilegesManager.revoke(streamId);
      throw e;
    }
  }
 catch (  Exception e) {
    ownerAdmin.delete(streamId);
    throw e;
  }
}