auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static Class[] getClasses(String packageName) throws ClassNotFoundException, IOException { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); assert classLoader != null; String path = packageName.replace('.', '/'); Enumeration<URL> resources = classLoader.getResources(path); List<File> dirs = new ArrayList<>(); while (resources.hasMoreElements()) { URL resource = resources.nextElement(); dirs.add(new File(resource.getFile())); } ArrayList<Class> classes = new ArrayList<>(); for (File directory : dirs) { classes.addAll(findClasses(directory, packageName)); } return classes.toArray(new Class[classes.size()]); }

Target:
private static Class[] getClasses(String packageName) throws ClassNotFoundException, IOException { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); assert classLoader != null; String path = packageName.replace('.', '/'); Enumeration<URL> resources = classLoader.getResources(path); List<File> dirs = new ArrayList<>(); while (resources.hasMoreElements()) { URL resource = resources.nextElement(); dirs.add(new File(resource.getFile())); } ArrayList<Class> classes = new ArrayList<>(); for (File directory : dirs) { classes.addAll(findClasses(directory, packageName)); } return classes.toArray(new Class[0]); }
Source:
private boolean isCloseable(Type type) { return type.isSubtypeOf(JAVA_IO_AUTO_CLOSEABLE) || type.isSubtypeOf(JAVA_IO_CLOSEABLE); }

Target:
private static boolean isCloseable(Type type) { return type.isSubtypeOf(JAVA_IO_AUTO_CLOSEABLE) || type.isSubtypeOf(JAVA_IO_CLOSEABLE); }
Source:
public void testNullHeaderReferenceIndex() { SAMRecord sam = new SAMRecordSetBuilder().addFrag("test", 0, 1, false, false, "3S9M", null, 2); final SAMFileHeader header = sam.getHeader(); sam.setHeader(null); sam.setReferenceIndex(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); Assert.assertTrue(sam.getReferenceIndex().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX)); Assert.assertTrue(sam.getReferenceName().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME)); sam = new SAMRecordSetBuilder().addFrag("test", 0, 1, false, false, "3S9M", null, 2); sam.setHeader(null); sam.setReferenceName(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME); Assert.assertTrue(sam.getReferenceIndex() == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); sam = new SAMRecord(null); Assert.assertTrue(sam.getReferenceIndex() == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); sam = new SAMRecord(null); final String unresolvableRefName = "unresolvable"; sam.setReferenceName(unresolvableRefName); sam.setHeader(header); Assert.assertTrue(sam.getReferenceIndex() == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); }

Target:
public void testNullHeaderReferenceIndex() { SAMRecord sam = createTestRecordHelper(); final SAMFileHeader samHeader = sam.getHeader(); int originalRefIndex = sam.getReferenceIndex(); Assert.assertTrue(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX != originalRefIndex); sam.setHeader(null); Assert.assertTrue(null == sam.mReferenceIndex); sam.setHeader(samHeader); Assert.assertTrue(sam.getReferenceIndex().equals(originalRefIndex)); sam.setHeader(null); sam.setReferenceIndex(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); Assert.assertTrue(sam.getReferenceIndex().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX)); Assert.assertTrue(sam.getReferenceName().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME)); sam = new SAMRecord(null); Assert.assertTrue(null == sam.mReferenceIndex); Assert.assertTrue(sam.getReferenceIndex() == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); final String unresolvableRefName = "unresolvable"; sam.setReferenceName(unresolvableRefName); sam.setHeader(samHeader); Assert.assertTrue(null == sam.mReferenceIndex); Assert.assertTrue(sam.getReferenceIndex() == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); }
Source:
private static void setAnnotationNode(FieldNode fn, CompactFieldNode cfn) { List<CompactAnnotationNode> annotations = new LinkedList<CompactAnnotationNode>(); for (Object visibleAnnotation : fn.visibleAnnotations) { CompactAnnotationNode node = new CompactAnnotationNode(); Map<String, Object> annotationMap = new HashMap<String, Object>(); if (visibleAnnotation instanceof AnnotationNode) { AnnotationNode annotation = (AnnotationNode) visibleAnnotation; if (annotation.desc.contains("InputPortFieldAnnotation") || annotation.desc.contains("OutputPortFieldAnnotation")) { List<Object> annotationValues = annotation.values; if (annotationValues != null) { int index = 0; while (index < annotationValues.size()) { annotationMap.put((String) annotationValues.get(index++), annotationValues.get(index++)); } node.setAnnotations(annotationMap); annotations.add(node); } } } cfn.setVisibleAnnotations(annotations); } }

Target:
private static void setAnnotationNode(FieldNode fn, CompactFieldNode cfn) { List<CompactAnnotationNode> annotations = new LinkedList<CompactAnnotationNode>(); for (Object visibleAnnotation : fn.visibleAnnotations) { CompactAnnotationNode node = new CompactAnnotationNode(); Map<String, Object> annotationMap = new HashMap<String, Object>(); if (visibleAnnotation instanceof AnnotationNode) { AnnotationNode annotation = (AnnotationNode) visibleAnnotation; if (annotation.desc.contains("InputPortFieldAnnotation") || annotation.desc.contains("OutputPortFieldAnnotation")) { List<Object> annotationValues = annotation.values; if (annotationValues != null) { int index = 0; while (index <= annotationValues.size() - 2) { String key = (String)annotationValues.get(index++); Object value = annotationValues.get(index++); annotationMap.put(key, value); } node.setAnnotations(annotationMap); annotations.add(node); } } } cfn.setVisibleAnnotations(annotations); } }
Source:
protected void onNewIntent(Intent intent) { if (intent!=null) { Log.d(TAG, "Intent: " + intent.getIntExtra("extraBufferId", -1) + " " + intent.getDataString()); int requestedBuffer = intent.getIntExtra("extraBufferId", -1); if (requestedBuffer == -99) { openedDrawer = Gravity.START; } else if (requestedBuffer != -1) { openedBuffer = requestedBuffer; } loadBufferAndDrawerState(); } }

Target:
protected void onNewIntent(Intent intent) { if (intent!=null) { Log.d(TAG, "Intent: " + intent.getIntExtra("extraBufferId", -1) + " " + intent.getDataString()); int requestOpenBuffer = intent.getIntExtra("extraBufferId", -1); boolean requestOpenDrawer = intent.getBooleanExtra("extraDrawer", false); if (requestOpenBuffer != -1) { openedBuffer = requestOpenBuffer; } if (requestOpenDrawer) { openedDrawer = Gravity.START; } loadBufferAndDrawerState(); } }
Source:
public synchronized KeyValueStore getKeyValueStore(String name) { KeyValueStoreProvider provider = providers.get(name); if (provider == null) { KeyValueStoreDescriptor descriptor = getDescriptor(XP_CONFIG, name); if (descriptor == null) { descriptor = getDescriptor(XP_CONFIG, DEFAULT_STORE_ID); if (descriptor == null) { return defaultStore; } } try { provider = descriptor.klass.newInstance(); provider.initialize(descriptor); } catch (ReflectiveOperationException e) { throw new RuntimeException(e); } providers.put(name, provider); } return provider; }

Target:
public synchronized KeyValueStore getKeyValueStore(String name) { KeyValueStoreProvider provider = providers.get(name); if (provider == null) { KeyValueStoreDescriptor descriptor = getDescriptor(XP_CONFIG, name); if (descriptor == null) { descriptor = getDescriptor(XP_CONFIG, DEFAULT_STORE_ID); if (descriptor == null) { return defaultStore; } } try { provider = descriptor.klass.getDeclaredConstructor().newInstance(); provider.initialize(descriptor); } catch (ReflectiveOperationException e) { throw new RuntimeException(e); } providers.put(name, provider); } return provider; }
Source:
private String sizeSuffix(double size) { if (hasFlag(F_VARIABLE_SIZE)) { if (hasFlag(MiscType.F_DRONE_CARRIER_CONTROL) || hasFlag(MiscType.F_ATAC) || hasFlag(MiscType.F_DTAC)) { return String.format(" (%d %s)", (int) size, size > 1 ? Messages.getString("MiscType.drones") : Messages.getString("MiscType.drone")); } else if (hasFlag(MiscType.F_MASH)) { return String.format(" (%d %s)", (int) size, size > 1 ? Messages.getString("MiscType.theaters") : Messages.getString("MiscType.theater")); } else if (hasFlag(MiscType.F_LADDER)) { return String.format(" (%d m"); } } return ""; }

Target:
private String sizeSuffix(double size) { if (hasFlag(F_VARIABLE_SIZE)) { if (hasFlag(MiscType.F_DRONE_CARRIER_CONTROL) || hasFlag(MiscType.F_ATAC) || hasFlag(MiscType.F_DTAC)) { return String.format(" (%d %s)", (int) size, size > 1 ? Messages.getString("MiscType.drones") : Messages.getString("MiscType.drone")); } else if (hasFlag(MiscType.F_MASH)) { return String.format(" (%d %s)", (int) size, size > 1 ? Messages.getString("MiscType.theaters") : Messages.getString("MiscType.theater")); } else if (hasFlag(MiscType.F_LADDER)) { return String.format(" (%d m)", (int) size); } } return ""; }
Source:
public static boolean usesAuthentication(Entity entity) { String keyfileContents = entity.config().get(MongoDBAuthenticationMixins.MONGODB_KEYFILE_CONTENTS); String keyfileUrl = entity.config().get(MongoDBAuthenticationMixins.MONGODB_KEYFILE_URL); if (!(Strings.isEmpty(keyfileContents) || Strings.isEmpty(keyfileUrl))) { throw new IllegalStateException("keyfile contents and keyfile location cannot both be set"); } if (Strings.isEmpty(keyfileContents) && Strings.isEmpty(keyfileUrl)) { return false; } return true; }

Target:
public static boolean usesAuthentication(Entity entity) { String keyfileContents = entity.config().get(MongoDBAuthenticationMixins.MONGODB_KEYFILE_CONTENTS); String keyfileUrl = entity.config().get(MongoDBAuthenticationMixins.MONGODB_KEYFILE_URL); return Strings.isNonBlank(keyfileContents) || Strings.isNonBlank(keyfileUrl); }
Source:
public void testAncestorGroups() throws Exception { DocumentModel groupABCD = getGroup("ABCD"); userManager.createGroup(groupABCD); DocumentModel groupAB = getGroup("AB"); groupAB.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("ABCD")); userManager.createGroup(groupAB); DocumentModel groupCD = getGroup("CD"); groupCD.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("ABCD")); userManager.createGroup(groupCD); DocumentModel groupA = getGroup("A"); groupA.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("AB")); userManager.createGroup(groupA); DocumentModel groupB = getGroup("B"); groupB.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("AB")); userManager.createGroup(groupB); DocumentModel groupC = getGroup("C"); groupC.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("CD")); userManager.createGroup(groupC); DocumentModel groupD = getGroup("D"); groupD.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("CD")); userManager.createGroup(groupD); assertEquals(Arrays.asList("AB", "A", "B", "CD", "C", "D"), userManager.getAncestorGroups("ABCD")); }

Target:
public void testAncestorGroups() throws Exception { DocumentModel groupABCD = getGroup("ABCD"); userManager.createGroup(groupABCD); DocumentModel groupAB = getGroup("AB"); groupAB.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("ABCD")); userManager.createGroup(groupAB); DocumentModel groupCD = getGroup("CD"); groupCD.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("ABCD")); userManager.createGroup(groupCD); DocumentModel groupA = getGroup("A"); groupA.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("AB")); userManager.createGroup(groupA); DocumentModel groupB = getGroup("B"); groupB.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("AB")); userManager.createGroup(groupB); DocumentModel groupC = getGroup("C"); groupC.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("CD")); userManager.createGroup(groupC); DocumentModel groupD = getGroup("D"); groupD.setPropertyValue("group:subGroups", (Serializable) Collections.singletonList("CD")); userManager.createGroup(groupD); assertTrue(CollectionUtils.isEqualCollection(Arrays.asList("AB", "A", "B", "CD", "C", "D"), userManager.getAncestorGroups("ABCD"))); }
Source:
public void processValidCitationTest() throws GrobidServiceException { String response = grobidService.processCitation("Derwing, T. M., Rossiter, M. J., & Munro, " + "M. J. (2002). Teaching native speakers to listen to foreign-accented speech. " + "Journal of Multilingual and Multicultural Development, 23(4), 245-259.", 1); assertNotNull(response); assertTrue(response.charAt(0) == '@'); }

Target:
public void processValidCitationTest() throws IOException { String response = grobidService.processCitation("Derwing, T. M., Rossiter, M. J., & Munro, " + "M. J. (2002). Teaching native speakers to listen to foreign-accented speech. " + "Journal of Multilingual and Multicultural Development, 23(4), 245-259.", GrobidService.ConsolidateCitations.WITH_METADATA); String[] responseRows = response.split("\n"); assertNotNull(response); assertEquals('@', response.charAt(0)); assertTrue(responseRows[1].contains("author") && responseRows[1].contains("Derwing and M Rossiter")); assertTrue(responseRows[2].contains("title") && responseRows[2].contains("Teaching native speakers")); assertTrue(responseRows[3].contains("journal") && responseRows[3].contains("Journal of Multilingual and Multicultural")); assertTrue(responseRows[4].contains("year") && responseRows[4].contains("2002")); assertTrue(responseRows[5].contains("pages") && responseRows[5].contains("245--259")); assertTrue(responseRows[6].contains("volume") && responseRows[6].contains("23")); assertTrue(responseRows[7].contains("number") && responseRows[7].contains("4")); }
Source:
private boolean storageDomainStatusIsValid() { if (getStorageDomainStatus() == StorageDomainStatus.Active) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_ACTIVE); } if (isInternalExecution()) { return checkStorageDomainStatus(StorageDomainStatus.InActive, StorageDomainStatus.Unknown, StorageDomainStatus.Locked, StorageDomainStatus.Maintenance); } return checkStorageDomainStatus(StorageDomainStatus.InActive, StorageDomainStatus.Unknown, StorageDomainStatus.Maintenance); }

Target:
private boolean storageDomainStatusIsValid() { boolean returnValue; if (isInternalExecution()) { returnValue = checkStorageDomainStatus(StorageDomainStatus.InActive, StorageDomainStatus.Unknown, StorageDomainStatus.Locked, StorageDomainStatus.Maintenance); } else { returnValue = checkStorageDomainStatus(StorageDomainStatus.InActive, StorageDomainStatus.Unknown, StorageDomainStatus.Maintenance); } return returnValue; }
Source:
private void validateName(DigitalExchange digitalExchange) { if (getDigitalExchanges().stream() .filter(de -> digitalExchange.getName().equals(de.getName())) .findAny().isPresent()) { BeanPropertyBindingResult errors = new BeanPropertyBindingResult(digitalExchange, DIGITAL_EXCHANGE_LABEL); errors.reject(ERRCODE_DIGITAL_EXCHANGE_NAME_TAKEN, new Object[]{digitalExchange.getName()}, "digitalExchange.name.taken"); throw new ValidationConflictException(errors); } }

Target:
private void validateName(DigitalExchange digitalExchange) { if (getDigitalExchanges().stream() .anyMatch(de -> digitalExchange.getName().equals(de.getName()))) { BeanPropertyBindingResult errors = new BeanPropertyBindingResult(digitalExchange, DIGITAL_EXCHANGE_LABEL); errors.reject(ERRCODE_DIGITAL_EXCHANGE_NAME_TAKEN, new Object[]{digitalExchange.getName()}, "digitalExchange.name.taken"); throw new ValidationConflictException(errors); } }
Source:
public void setUp() { if (kvs == null) { kvs = CassandraKeyValueService.create( CassandraKeyValueServiceConfigManager.createSimpleManager(CassandraContainer.KVS_CONFIG), CassandraContainer.LEADER_CONFIG, Mockito.mock(Logger.class)); } kvs.createTable(TEST_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA); kvs.truncateTable(TEST_TABLE); TracingQueryRunner queryRunner = new TracingQueryRunner( Mockito.mock(Logger.class), new TracingPrefsConfig()); SingleRowColumnPager singleRowPager = new SingleRowColumnPager(kvs.clientPool, queryRunner); cellPager = new CellPager(singleRowPager, kvs.clientPool, queryRunner, pageSizingStrategy); }

Target:
public void setUp() { kvs.createTable(TEST_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA); kvs.truncateTable(TEST_TABLE); TracingQueryRunner queryRunner = new TracingQueryRunner( Mockito.mock(Logger.class), new TracingPrefsConfig()); SingleRowColumnPager singleRowPager = new SingleRowColumnPager(kvs.clientPool, queryRunner); cellPager = new CellPager(singleRowPager, kvs.clientPool, queryRunner, pageSizingStrategy); }
Source:
void scheduleMessage() { final String messageId = UUID.randomUUID().toString(); final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, messageId, 0); int enqueDelayInSec = 2; StepVerifier.create(sender.scheduleMessage(message, Instant.now().plusSeconds(enqueDelayInSec)) .delaySubscription(Duration.ofSeconds(enqueDelayInSec + 1)) .thenMany(receiver.receive().take(1))) .assertNext(receivedMessage -> { Assertions.assertArrayEquals(contents.getBytes(), receivedMessage.getBody()); Assertions.assertTrue(receivedMessage.getProperties().containsKey(MESSAGE_TRACKING_ID)); Assertions.assertEquals(messageId, receivedMessage.getProperties().get(MESSAGE_TRACKING_ID)); }) .verifyComplete(); }

Target:
void scheduleMessage() { final String messageId = UUID.randomUUID().toString(); final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, messageId, 0); final Instant scheduledEnqueueTime = Instant.now().plusSeconds(2); sender.scheduleMessage(message, scheduledEnqueueTime) .delaySubscription(Duration.ofSeconds(3)) .block(); StepVerifier.create(receiver.receive().take(1)) .assertNext(receivedMessage -> { Assertions.assertArrayEquals(contents.getBytes(), receivedMessage.getBody()); Assertions.assertTrue(receivedMessage.getProperties().containsKey(MESSAGE_TRACKING_ID)); Assertions.assertEquals(messageId, receivedMessage.getProperties().get(MESSAGE_TRACKING_ID)); }) .verifyComplete(); }
Source:
public void completeFromAddress() { String addressStreet = address != null ? address.get("street") : null; if (addressStreet != null) { if (this.street == null) { this.street = new HashMap<>(); } setOrReplace(addressStreet, this.street, "street"); } String addressCity = address != null ? address.get("city") : null; if (addressCity != null) { if (this.city == null) { this.city = new HashMap<>(); } setOrReplace(addressCity, this.city, "city"); } String addressSuburb = address != null ? address.get("suburb") : null; if (addressSuburb != null) { if (this.suburb == null) { this.suburb = new HashMap<>(); } setOrReplace(addressSuburb, this.suburb, "suburb"); } String addressNeighbourhood = address != null ? address.get("neighbourhood") : null; if (addressNeighbourhood != null) { if (this.neighbourhood == null) { this.neighbourhood = new HashMap<>(); } setOrReplace(addressNeighbourhood, this.neighbourhood, "neighbourhood"); } String addressPostCode = address != null ? address.get("postcode") : null; if (addressPostCode != null && !addressPostCode.equals(this.postcode)) { if (log.isDebugEnabled()) { log.debug("Replacing postcode "+this.postcode+" with "+ addressPostCode+ " for osmId #" + osmId); } this.postcode = addressPostCode; } }

Target:
public void completeFromAddress() { if (address == null) return; String addressStreet = address.get("street"); if (addressStreet != null) { this.street = nullToEmptyMap(this.street); setOrReplace(addressStreet, this.street, "street"); } String addressCity = address.get("city"); if (addressCity != null) { this.city = nullToEmptyMap(this.city); setOrReplace(addressCity, this.city, "city"); } String addressDistrict = address.get("suburb"); if (addressDistrict != null) { this.district = nullToEmptyMap(this.district); setOrReplace(addressDistrict, this.district, "suburb"); } String addressLocality = address.get("neighbourhood"); if (addressLocality != null) { this.locality = nullToEmptyMap(this.locality); setOrReplace(addressLocality, this.locality, "neighbourhood"); } String addressPostCode = address.get("postcode"); if (addressPostCode != null && !addressPostCode.equals(this.postcode)) { if (log.isDebugEnabled()) { log.debug("Replacing postcode "+this.postcode+" with "+ addressPostCode+ " for osmId #" + osmId); } this.postcode = addressPostCode; } }
Source:
private Statement createTimeToLive(Table table, boolean alter,int value, String unit, String column, int batchSize, int maxFrequency, String migrationTargetName) { if (!alter) { table.addTTL(value, unit, column, batchSize, maxFrequency, migrationTargetName); } else { if (table.getTTL() != null && !StringUtil.isEmpty(table.getTTL().migrationTarget) && !table.getTTL().migrationTarget.equalsIgnoreCase(migrationTargetName)){ throw unexpectedToken("The migration target can not be altered."); } } Object[] args = new Object[] { table.getName(), value, unit, column, batchSize, maxFrequency, migrationTargetName, Integer.valueOf(SchemaObject.CONSTRAINT), Boolean.valueOf(false), Boolean.valueOf(false) }; return new StatementSchema(null, StatementTypes.ALTER_TTL, args, null, table.getName()); }

Target:
private Statement createTimeToLive(Table table, boolean alter,int value, String unit, String column, int batchSize, int maxFrequency, String migrationTargetName) { if (!alter) { table.addTTL(value, unit, column, batchSize, maxFrequency, migrationTargetName); } else { if (table.getTTL() != null) { final String oldTarget = table.getTTL().migrationTarget; if (StringUtil.isEmpty(oldTarget) && !StringUtil.isEmpty(migrationTargetName)) { throw unexpectedToken("The migration target cannot be added."); } if (!StringUtil.isEmpty(oldTarget) && !oldTarget.equals(migrationTargetName)) { throw unexpectedToken("The migration target cannot be added."); } } else if (!StringUtil.isEmpty(migrationTargetName)) { throw unexpectedToken("The migration target cannot be added."); } } Object[] args = new Object[] { table.getName(), value, unit, column, batchSize, maxFrequency, migrationTargetName, Integer.valueOf(SchemaObject.CONSTRAINT), Boolean.valueOf(false), Boolean.valueOf(false) }; return new StatementSchema(null, StatementTypes.ALTER_TTL, args, null, table.getName()); }
Source:
public void delete(UserEntityFile userEntityFile) { getEntityManager().remove(userEntityFile); }

Target:
public void delete(UserEntityFile userEntityFile) { super.delete(userEntityFile); }
Source:
public int getErrorCode() { int errorCode; try { errorCode = Integer.parseInt(this.errorCode.toString()); } catch (NumberFormatException e) { errorCode = 0; } return errorCode; }

Target:
public int getErrorCode() { return this.errorCode; }
Source:
public long pauseMillis() { return 5L; }

Target:
public long pauseMillis() { return 50L; }
Source:
public void destroy() { if (taskScheduler != null) { taskScheduler.destroy(); } }

Target:
public void destroy() { taskScheduler.destroy(); }
Source:
public void setSaveOffline(boolean saved) { if (pages.isEmpty()) { emptyListSavePagesState = saved; return; } for (ReadingListPage page : pages) { page.savedOrSaving(saved); ReadingListPageDao.instance().upsert(page); } }

Target:
public void setSaveOffline(boolean saved) { emptyListSavePagesState = saved; for (ReadingListPage page : pages) { page.savedOrSaving(saved); } }
Source:
private static int zzUnpackTrans() { int result = new int[4374]; int offset = 0; zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; }

Target:
private static int zzUnpackTrans() { int result = new int[4374]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; }
Source:
public boolean addDependency(DynamicPomDependency dep, Path pomPath) { if (dep.getGroupID().isEmpty() || dep.getArtifactID().isEmpty()) { return false; } try { Dependency pomDep = getMavenDependency(dep); pomDep.setType("jar"); org.uberfire.java.nio.file.Path filePath = Paths.get(pomPath.toURI()); Model model = getPOMModel(filePath); Set keys = getKeysFromDeps(model.getDependencies()); if(!keys.contains(getKeyFromDep(dep))) { model.getDependencies().add(pomDep); }else{ return false; } writePOMModelOnFS(filePath, model); } catch (Exception ex) { logger.error(ex.getMessage(), ex); return false; } return true; }

Target:
public boolean addDependency(DynamicPomDependency dep, Path pomPath) { if (dep == null || !isGroupIDValid(dep) || !isArtifactIDValid(dep)) { return false; } try { Dependency pomDep = getMavenDependency(dep); org.uberfire.java.nio.file.Path filePath = Paths.get(pomPath.toURI()); Model model = getPOMModel(filePath); Map<String, String> keys = getKeysFromDeps(model.getDependencies()); String keyDep = getKeyFromDep(dep); if (!keys.containsKey(keyDep)) { model.getDependencies().add(pomDep); } else { String versionKey = keys.get(keyDep); List<Dependency> modelDeps = model.getDependencies(); for (Dependency modelDep : modelDeps) { if (modelDep.getGroupId().equals(dep.getGroupID()) && modelDep.getArtifactId().equals(dep.getArtifactID())) { modelDep.setVersion(versionKey); } } return false; } writePOMModelOnFS(filePath, model); } catch (Exception ex) { logger.error(ex.getMessage(), ex); return false; } return true; }
Source:
protected String[][] formatTableContents() { final String [][] formatArray = new String[this.tapeList.size()][]; int i = 0; for (final Tape tape : this.tapeList) { final String bucketArray = new String[this.columnCount]; bucketArray[0] = nullGuard(tape.getBarCode()); bucketArray[1] = nullGuardToString(tape.getId()); bucketArray[2] = nullGuardToString(tape.getState()); bucketArray[3] = nullGuardToDate(tape.getLastModified(), DATE_FORMAT); bucketArray[4] = nullGuardToString(tape.getAvailableRawCapacity()); bucketArray[5] = nullGuardToString(tape.getBucketId()); bucketArray[6] = nullGuardToString(tape.getAssignedToStorageDomain()); bucketArray[6] = nullGuardToString(tape.getAssignedToStorageDomain()); bucketArray[7] = nullGuardToString(tape.getEjectDate()); bucketArray[8] = nullGuard(tape.getEjectLocation()); bucketArray[9] = nullGuard(tape.getEjectLabel()); formatArray[i++] = bucketArray; } return formatArray; }

Target:
protected String[][] formatTableContents() { final String [][] formatArray = new String[this.tapeList.size()][]; int i = 0; for (final Tape tape : this.tapeList) { final String bucketArray = new String[this.columnCount]; bucketArray[0] = nullGuard(tape.getBarCode()); bucketArray[1] = nullGuardToString(tape.getId()); bucketArray[2] = nullGuardToString(tape.getState()); bucketArray[3] = nullGuardToDate(tape.getLastModified(), DATE_FORMAT); bucketArray[4] = nullGuardToString(tape.getAvailableRawCapacity()); bucketArray[5] = nullGuardToString(tape.getBucketId()); bucketArray[6] = nullGuardToString(tape.getAssignedToStorageDomain()); bucketArray[7] = nullGuardToDate(tape.getEjectDate(), DATE_FORMAT); bucketArray[8] = nullGuard(tape.getEjectLocation()); bucketArray[9] = nullGuard(tape.getEjectLabel()); bucketArray[10] = nullGuardToDate(tape.getEjectPending(), DATE_FORMAT); formatArray[i++] = bucketArray; } return formatArray; }
Source:
private static String learnedConstraintMessage(Constraint lc, ExplodedGraph.Node currentNode) { Tree nodeTree = currentNode.programPoint.syntaxTree(); String name = SyntaxTreeNameFinder.getName(nodeTree); if (nodeTree.is(Tree.Kind.METHOD_INVOCATION)) { return String.format("'%s' returns %s", name, lc.valueAsString()); } if (nodeTree.is(Tree.Kind.NEW_CLASS)) { return String.format("'new %s' returns %s", name, lc.valueAsString()); } return name == null ? lc.valueAsString() : String.format("assume '%s' is %s", name, lc.valueAsString()); }

Target:
private static String learnedConstraintMessage(Constraint lc, ExplodedGraph.Node currentNode) { Tree nodeTree = currentNode.programPoint.syntaxTree(); String name = SyntaxTreeNameFinder.getName(nodeTree); if (nodeTree.is(Tree.Kind.METHOD_INVOCATION)) { return String.format("'%s' returns %s", name, lc.valueAsString()); } if (nodeTree.is(Tree.Kind.NEW_CLASS)) { return String.format("Constructor call creates '%s'", lc.valueAsString()); } return name == null ? lc.valueAsString() : String.format("Implies '%s' is %s", name, lc.valueAsString()); }
Source:
public String captureScreenShot(int status, String className, String methodName, String screenShotName) throws IOException, InterruptedException { String getDeviceModel = null; System.out.println("Current Running Thread Status" + AppiumDriverManager.getDriver().getSessionId()); File scrFile = AppiumDriverManager.getDriver() .getScreenshotAs(OutputType.FILE); screenShotNameWithTimeStamp = currentDateAndTime(); if (DeviceManager.getMobilePlatform().equals(MobilePlatform.ANDROID)) { getDeviceModel = screenShotNameWithTimeStamp; screenShotAndFrame(status, scrFile, methodName, className, getDeviceModel, "android", screenShotName); } else if (DeviceManager.getMobilePlatform().equals(MobilePlatform.IOS)) { getDeviceModel = screenShotNameWithTimeStamp; screenShotAndFrame(status, scrFile, methodName, className, getDeviceModel, "iOS", screenShotName); } return getDeviceModel; }

Target:
public String captureScreenShot(int status, String className, String methodName, String screenShotName) throws IOException, InterruptedException { System.out.println("Current Running Thread Status" + AppiumDriverManager.getDriver().getSessionId()); File scrFile = AppiumDriverManager.getDriver() .getScreenshotAs(OutputType.FILE); screenShotNameWithTimeStamp = currentDateAndTime(); screenShotAndFrame(status, scrFile, methodName, className, screenShotNameWithTimeStamp, DeviceManager.getMobilePlatform().toString(), screenShotName); return screenShotNameWithTimeStamp; }
Source:
public Block sort( @OperatorDependency(operator = LESS_THAN, argumentTypes = {"E", "E"}) MethodHandle lessThanFunction, @TypeParameter("E") Type type, @SqlType("array(E)") Block block) { int arrayLength = block.getPositionCount(); if (positions.size() < arrayLength) { positions = Ints.asList(new int[arrayLength]); } for (int i = 0; i < arrayLength; i++) { positions.set(i, i); } Collections.sort(positions.subList(0, arrayLength), new Comparator<Integer>() { @Override public int compare(Integer p1, Integer p2) { boolean nullLeft = block.isNull(p1); boolean nullRight = block.isNull(p2); if (nullLeft && nullRight) { return 0; } if (nullLeft) { return 1; } if (nullRight) { return -1; } try { return type.compareTo(block, p1, block, p2); } catch (PrestoException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, e.getMessage()); } } }); if (pageBuilder.isFull()) { pageBuilder.reset(); } BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(0); for (int i = 0; i < arrayLength; i++) { type.appendTo(block, positions.get(i), blockBuilder); } pageBuilder.declarePositions(arrayLength); return blockBuilder.getRegion(blockBuilder.getPositionCount() - arrayLength, arrayLength); }

Target:
public Block sort( @OperatorDependency(operator = LESS_THAN, argumentTypes = {"E", "E"}) MethodHandle lessThanFunction, @TypeParameter("E") Type type, @SqlType("array(E)") Block block) { int arrayLength = block.getPositionCount(); if (positions.size() < arrayLength) { positions = Ints.asList(new int[arrayLength]); } for (int i = 0; i < arrayLength; i++) { positions.set(i, i); } Collections.sort(positions.subList(0, arrayLength), new Comparator<Integer>() { @Override public int compare(Integer p1, Integer p2) { boolean nullLeft = block.isNull(p1); boolean nullRight = block.isNull(p2); if (nullLeft && nullRight) { return 0; } if (nullLeft) { return 1; } if (nullRight) { return -1; } try { return type.compareTo(block, p1, block, p2); } catch (PrestoException e) { if (e.getErrorCode() == NOT_SUPPORTED.toErrorCode()) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Array contains elements not supported for comparison", e); } throw e; } } }); if (pageBuilder.isFull()) { pageBuilder.reset(); } BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(0); for (int i = 0; i < arrayLength; i++) { type.appendTo(block, positions.get(i), blockBuilder); } pageBuilder.declarePositions(arrayLength); return blockBuilder.getRegion(blockBuilder.getPositionCount() - arrayLength, arrayLength); }
Source:
public List<String> getComponentList() { return mComponentList; }

Target:
public List<String> getComponentList() { return new ArrayList<>( mComponentList ); }
Source:
public Set<UnitType> getCanNotTarget() { if (canNotTarget == null) { if (isSuicideOnAttack && isFirstStrike) { canNotTarget = new HashSet<>( CollectionUtils.getMatches( getData().getUnitTypeList().getAllUnitTypes(), Matches.unitTypeIsSuicideOnAttack().or(Matches.unitTypeIsSuicideOnDefense()))); } else { canNotTarget = new HashSet<>( CollectionUtils.getMatches( getData().getUnitTypeList().getAllUnitTypes(), Matches.unitTypeIsAir())); } } return canNotTarget; }

Target:
public Set<UnitType> getCanNotTarget() { if (canNotTarget == null) { final Predicate<UnitType> unitTypeMatch = (isSuicideOnAttack && isFirstStrike) ? Matches.unitTypeIsSuicideOnAttack().or(Matches.unitTypeIsSuicideOnDefense()) : Matches.unitTypeIsAir(); canNotTarget = new HashSet<>( CollectionUtils.getMatches( getData().getUnitTypeList().getAllUnitTypes(), unitTypeMatch)); } return canNotTarget; }
Source:
public void registerAttributes(ManagementResourceRegistration registry) { for (AttributeDefinition attr : ATTRIBUTES) { if (registerRuntimeOnly || !attr.getFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME)) { registry.registerReadWriteAttribute(attr, null, new ReloadRequiredWriteAttributeHandler(ATTRIBUTES)); } } }

Target:
public void registerAttributes(ManagementResourceRegistration registry) { ReloadRequiredWriteAttributeHandler reloadRequiredWriteAttributeHandler = new ReloadRequiredWriteAttributeHandler(ATTRIBUTES); for (AttributeDefinition attr : ATTRIBUTES) { if (registerRuntimeOnly || !attr.getFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME)) { registry.registerReadWriteAttribute(attr, null, reloadRequiredWriteAttributeHandler); } } }
Source:
public void recognizeCustomFormLabeledDataWithEmptyModelId(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormDataRunner(data -> beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller<OperationResult, CustomFormModel> syncPoller = getFormTrainingAsyncClient(httpClient, serviceVersion).beginTraining(trainingFilesUrl, useTrainingLabels).getSyncPoller(); syncPoller.waitForCompletion(); Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms(toFluxByteBuffer(data), "", CUSTOM_FORM_FILE_LENGTH, FormContentType.APPLICATION_PDF, true, null).getSyncPoller()); assertEquals(EXPECTED_INVALID_UUID_EXCEPTION_MESSAGE, ex.getMessage()); })); }

Target:
public void recognizeCustomFormLabeledDataWithEmptyModelId(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormDataRunner((data, dataLength) -> { Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms( new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, "") .setFormContentType(FormContentType.APPLICATION_PDF).setIncludeTextContent(true) .setPollInterval(durationTestMode)).getSyncPoller()); assertEquals(EXPECTED_INVALID_UUID_EXCEPTION_MESSAGE, ex.getMessage()); }); }
Source:
public void extractsQueryStringIgnoringAParameter() throws Exception { final String IGNORED_PARAM = "foo"; final Map<String, List<String>> queryString = someQueryString(); queryString.remove(IGNORED_PARAM); testWithHttpContext(queryString, httpContext -> assertThat(extractQueryString(httpContext.request(), Collections.singleton( IGNORED_PARAM ))) .isEqualTo( queryString )); }

Target:
public void extractsQueryStringIgnoringAParameter() throws Exception { final String IGNORED_PARAM = "foo"; final Map<String, List<String>> queryString = someQueryString(); testWithHttpContext(queryString, httpContext -> assertThat(extractQueryString(httpContext.request(), Collections.singleton( IGNORED_PARAM ))) .isEqualTo( quxQueryString() )); }
Source:
private boolean containsBeanDefiningAnnotation(Set<DotName> annotations) { for (DotName name : annotations) { if (scopeTypes.contains(name.toString())) { return true; } } return false; }

Target:
private boolean containsBeanDefiningAnnotation(Set<DotName> annotations) { for (DotName name : annotations) { if (beanDefiningAnnotations.contains(name)) { return true; } } return false; }
Source:
public Object createInstance(List<String> paths, String className, Object[] args) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException{ pathsCache = paths; Class<?> k = null; try{ k = searchPathsForClass(paths, className); } catch (SlimError errorClassNotFound){ try { MethodExecutionResult mER = invokeStaticMethod(className, paths, args); if(mER != null) return mER.getObject(); } catch (Throwable e) { throw new InstantiationException(String.format("Failed to call static method '%s': %s", className, new StringBuilder().append("\nCaused by: ").append(e.getClass().getName()).append(": ").append(e.getMessage()) + new StackTraceEnricher().getStackTraceAsString(e))); } throw errorClassNotFound; } Constructor<?> constructor = getConstructor(k, args); if (constructor == null) { throw new SlimError(String.format("message:<<%s %s>>", SlimServer.NO_CONSTRUCTOR, className)); } return newInstance(args, constructor); }

Target:
public Object createInstance(List<String> paths, String className, Object[] args) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException{ pathsCache = paths; Class<?> k = null; try{ k = searchPathsForClass(paths, className); } catch (SlimError errorClassNotFound) { try { MethodExecutionResult mER = invokeStaticMethod(className, paths, args); if (mER != null) { if (mER.hasResult()) { return mER.getObject(); } else { return mER.returnValue(); } } } catch (Throwable e) { throw new InstantiationException(new StringBuilder().append("Failed to call static method '").append(className).append("': ") .append("\nCaused by: ").append(e.getClass().getName()).append(": ") .append(e.getMessage()).append( new StackTraceEnricher().getStackTraceAsString(e)).toString()); } throw errorClassNotFound; } Constructor<?> constructor = getConstructor(k, args); if (constructor == null) { throw new SlimError(String.format("message:<<%s %s>>", SlimServer.NO_CONSTRUCTOR, className)); } return newInstance(args, constructor); }
Source:
public BlobOutput getBlob(BlobId blobId, ClusterMap map, boolean expiredBlobs) throws MessageFormatException, IOException { List<ReplicaId> replicas = blobId.getPartition().getReplicaIds(); BlobOutput blobOutput = null; for (ReplicaId replicaId : replicas) { try { blobOutput = getBlob(blobId, map, replicaId, expiredBlobs); break; } catch (Exception e) { } } return blobOutput; }

Target:
public BlobOutput getBlob(BlobId blobId, ClusterMap map, boolean expiredBlobs) throws MessageFormatException, IOException { List<ReplicaId> replicas = blobId.getPartition().getReplicaIds(); BlobOutput blobOutput = null; for (ReplicaId replicaId : replicas) { try { blobOutput = getBlob(blobId, map, replicaId, expiredBlobs); break; } catch (Exception e) { System.out.println("Get blob error "); e.printStackTrace(); } } return blobOutput; }
Source:
private StartpointSpecific() { super(); this.specificOffset = null; }

Target:
private StartpointSpecific() { this(null); }
Source:
public List<LatencyStat> getLatencyStats(Set<Double> percentiles) { return statBuckets.entrySet().stream() .flatMap(entry -> percentiles.stream().map(percentile -> { TimeValue tv = entry.getValue().getTimeValueAtPercentile(percentile); return new LatencyStat(entry.getKey(), percentile, tv); })) .collect(Collectors.toList()); }

Target:
public List<LatencyStat> getLatencyStats(Set<Double> percentiles) { return statBuckets.entrySet().stream() .flatMap(entry -> percentiles.stream().map(percentile -> { TimeValue tv = entry.getValue().getTimeValueAtPercentile(percentile); return new LatencyStat(entry.getKey(), percentile, tv); })) .collect(toList()); }
Source:
public static boolean isCType(IProject project) { try { if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { return true; } else { return false; } } catch (CoreException e) { MessageDialog.openError(null, "Getting Project type error", "project not found or is closed."); return false; } }

Target:
public static boolean isCType(IProject project) { try { if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { return true; } else { return false; } } catch (CoreException e) { MessageDialogSyncedRunnable.openErrorSyncedRunnable(ProfilingMessages.errorTitle, ProfilingMessages.errorGetProjectType); return false; } }
Source:
public void setUp() throws InterruptedException { outputTopic = createTopic(topicSuffixGenerator.incrementAndGet()); final Properties properties = new Properties(); properties.put(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG, 0); properties.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 100); properties.put(ConsumerConfig.METADATA_MAX_AGE_CONFIG, "1000"); properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); streamsConfiguration = StreamsTestUtils.getStreamsConfig("regex-source-integration-test-" + topicSuffixGenerator.get(), CLUSTER.bootstrapServers(), STRING_SERDE_CLASSNAME, STRING_SERDE_CLASSNAME, properties); }

Target:
public void setUp() throws InterruptedException { outputTopic = createTopic(topicSuffixGenerator.incrementAndGet()); final Properties properties = new Properties(); properties.put(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG, 0); properties.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 100); properties.put(ConsumerConfig.METADATA_MAX_AGE_CONFIG, "1000"); properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); streamsConfiguration = StreamsTestUtils.getStreamsConfig( IntegrationTestUtils.safeUniqueTestName(RegexSourceIntegrationTest.class, new TestName()), CLUSTER.bootstrapServers(), STRING_SERDE_CLASSNAME, STRING_SERDE_CLASSNAME, properties ); }
Source:
private String encodeBase64(String str) { byte[] stringBytes = new byte[0]; String b64EncodedString = null; try { stringBytes = str.getBytes("UTF-8"); b64EncodedString = new String(Base64.getEncoder().encode(stringBytes), "UTF-8"); } catch (UnsupportedEncodingException e) { } b64EncodedString = b64EncodedString.replace("=", ""); b64EncodedString = b64EncodedString.replace('/', '_'); b64EncodedString = b64EncodedString.replace('+', '-'); return b64EncodedString; }

Target:
private String encodeBase64(String str) { String b64EncodedString = null; try { byte[] stringBytes = str.getBytes("UTF-8"); b64EncodedString = new String(Base64.getEncoder().encode(stringBytes), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } b64EncodedString = b64EncodedString.replace("=", ""); b64EncodedString = b64EncodedString.replace('/', '_'); b64EncodedString = b64EncodedString.replace('+', '-'); return b64EncodedString; }
Source:
public static GsonBuilder createGson() { return new GsonBuilder().setLongSerializationPolicy(LongSerializationPolicy.STRING) .disableHtmlEscaping().registerTypeAdapter(LongAdder.class, new TypeAdapter<LongAdder>() { @Override public void write(JsonWriter out, LongAdder value) throws IOException { out.value(value.longValue()); } @Override public LongAdder read(JsonReader in) throws IOException { LongAdder value = new LongAdder(); value.add(in.nextLong()); return value; } }); }

Target:
public static GsonBuilder createGson() { return new GsonBuilder().setLongSerializationPolicy(LongSerializationPolicy.STRING) .registerTypeAdapter(LongAdder.class, new TypeAdapter<LongAdder>() { @Override public void write(JsonWriter out, LongAdder value) throws IOException { out.value(value.longValue()); } @Override public LongAdder read(JsonReader in) throws IOException { LongAdder value = new LongAdder(); value.add(in.nextLong()); return value; } }); }
Source:
public ImageFormat determineFormat(byte[] headerBytes, int headerSize) { if (headerSize < getHeaderSize()) { return null; } if (ImageFormatCheckerUtils.startsWithPattern(headerBytes, HEADER)) { return SVG_FORMAT; } for (String possibleHeaderTag : POSSIBLE_HEADER_TAGS) { byte[] possibleHeader = ImageFormatCheckerUtils.asciiBytes(possibleHeaderTag); if (ImageFormatCheckerUtils.startsWithPattern(headerBytes, possibleHeader) && ImageFormatCheckerUtils.indexOfPattern(headerBytes, HEADER) > -1) { return SVG_FORMAT; } } return null; }

Target:
public ImageFormat determineFormat(byte[] headerBytes, int headerSize) { if (headerSize < getHeaderSize()) { return null; } if (ImageFormatCheckerUtils.startsWithPattern(headerBytes, HEADER)) { return SVG_FORMAT; } for (byte[] possibleHeaderTag : POSSIBLE_HEADER_TAGS) { if (ImageFormatCheckerUtils.startsWithPattern(headerBytes, possibleHeaderTag) && ImageFormatCheckerUtils.indexOfPattern(headerBytes, headerBytes.length, HEADER, HEADER.length) > -1) { return SVG_FORMAT; } } return null; }
Source:
public void setStunned(boolean stunned) { if (stunned) { this.stunTick = 40; return; } this.stunTick = 0; }

Target:
public void setStunned(boolean stunned) { if (stunned) { this.stunTick = Constants.Entity.Ravager.STUNNED_TIME; return; } this.stunTick = 0; }
Source:
public void visitNode(Tree tree) { if (hasSemantic()) { MethodInvocationTree mit = (MethodInvocationTree) tree; Arguments arguments = mit.arguments(); if (SSLCONTEXT_GETINSTANCE_MATCHER.matches(mit)) { ExpressionTree firstArgument = arguments.get(0); if (firstArgument.is(Tree.Kind.STRING_LITERAL) && !STRONG_PROTOCOLS.contains(((LiteralTree) firstArgument).value())) { reportIssue(mit, "Change this code to use a stronger protocol."); } } } }

Target:
public void visitNode(Tree tree) { if (hasSemantic()) { MethodInvocationTree mit = (MethodInvocationTree) tree; Arguments arguments = mit.arguments(); if (SSLCONTEXT_GETINSTANCE_MATCHER.matches(mit)) { ExpressionTree firstArgument = arguments.get(0); if (firstArgument.is(Tree.Kind.STRING_LITERAL) && !STRONG_PROTOCOLS.contains(trimQuotes(((LiteralTree) firstArgument).value()))) { reportIssue(firstArgument, "Change this code to use a stronger protocol."); } } } }
Source:
void processPendingEmptyTrash(Account account) throws MessagingException { Store remoteStore = account.getRemoteStore(); Folder remoteFolder = remoteStore.getFolder(account.getTrashFolderName()); LocalStore localStore = account.getLocalStore(); LocalFolder localFolder = localStore.getFolder(account.getTrashFolderName()); try { if (remoteFolder.exists()) { remoteFolder.open(Folder.OPEN_MODE_RW); remoteFolder.setFlags(Collections.singleton(Flag.DELETED), true); if (Expunge.EXPUNGE_IMMEDIATELY == account.getExpungePolicy()) { remoteFolder.expunge(localFolder.getAllMessageUids(true)); } synchronizeFolder(account, remoteFolder, true, 0, null); compact(account, null); } } finally { closeFolder(localFolder); closeFolder(remoteFolder); } }

Target:
void processPendingEmptyTrash(Account account) throws MessagingException { Store remoteStore = account.getRemoteStore(); Folder remoteFolder = remoteStore.getFolder(account.getTrashFolderName()); try { if (remoteFolder.exists()) { remoteFolder.open(Folder.OPEN_MODE_RW); remoteFolder.setFlags(Collections.singleton(Flag.DELETED), true); if (Expunge.EXPUNGE_IMMEDIATELY == account.getExpungePolicy()) { remoteFolder.expunge(); } synchronizeFolder(account, remoteFolder, true, 0, null); compact(account, null); } } finally { closeFolder(remoteFolder); } }