Skip to content

Commit

Permalink
Remove redundant assignments in Advapi32Util (#1009)
Browse files Browse the repository at this point in the history
  • Loading branch information
koraktor authored and bhamail committed Aug 31, 2018
1 parent 180d4a3 commit d349212
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ public static Account getAccountByName(String systemName, String accountName) {

Account account = new Account();
account.accountType = peUse.getPointer().getInt(0);
account.name = accountName;

String[] accountNamePartsBs = accountName.split("\\\\", 2);
String[] accountNamePartsAt = accountName.split("@", 2);
Expand Down Expand Up @@ -459,7 +458,7 @@ public static Account[] getTokenGroups(HANDLE hToken) {
ArrayList<Account> userGroups = new ArrayList<Account>();
// make array of names
for (SID_AND_ATTRIBUTES sidAndAttribute : groups.getGroups()) {
Account group = null;
Account group;
try {
group = Advapi32Util.getAccountBySid(sidAndAttribute.Sid);
} catch (Exception e) {
Expand Down Expand Up @@ -2329,7 +2328,7 @@ public static enum EventLogType {
* An event log record.
*/
public static class EventLogRecord {
private EVENTLOGRECORD _record = null;
private EVENTLOGRECORD _record;
private String _source;
private byte[] _data;
private String[] _strings;
Expand Down Expand Up @@ -2463,14 +2462,14 @@ public EventLogRecord(Pointer pevlr) {
public static class EventLogIterator implements Iterable<EventLogRecord>,
Iterator<EventLogRecord> {

private HANDLE _h = null;
private HANDLE _h;
private Memory _buffer = new Memory(1024 * 64); // memory buffer to
// store events
private boolean _done = false; // no more events
private int _dwRead = 0; // number of bytes remaining in the current
// buffer
private Pointer _pevlr = null; // pointer to the current record
private int _flags = WinNT.EVENTLOG_FORWARDS_READ;
private int _flags;

public EventLogIterator(String sourceName) {
this(null, sourceName, WinNT.EVENTLOG_FORWARDS_READ);
Expand Down Expand Up @@ -2582,8 +2581,8 @@ public static ACE_HEADER[] getFileSecurity(String fileName,
boolean compact) {
int infoType = WinNT.DACL_SECURITY_INFORMATION;
int nLength = 1024;
boolean repeat = false;
Memory memory = null;
boolean repeat;
Memory memory;

do {
repeat = false;
Expand Down Expand Up @@ -2934,7 +2933,7 @@ public static boolean accessCheck(File file, AccessCheckPermission permissionToC
*/
public static SECURITY_DESCRIPTOR_RELATIVE getFileSecurityDescriptor(File file, boolean getSACL)
{
SECURITY_DESCRIPTOR_RELATIVE sdr = null;
SECURITY_DESCRIPTOR_RELATIVE sdr;
Memory securityDesc = getSecurityDescriptorForObject(file.getAbsolutePath().replaceAll("/", "\\"), AccCtrl.SE_OBJECT_TYPE.SE_FILE_OBJECT, getSACL);
sdr = new SECURITY_DESCRIPTOR_RELATIVE(securityDesc);
return sdr;
Expand Down

0 comments on commit d349212

Please sign in to comment.