auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCacheUsesCacheManagerClassLoaderForDefaultURI() { CachingProvider cachingProvider = Caching.getCachingProvider(); LimitedClassLoader limitedClassLoader = new LimitedClassLoader(cachingProvider.getDefaultClassLoader()); CacheManager cacheManager = cachingProvider.getCacheManager(cachingProvider.getDefaultURI(), limitedClassLoader); MutableConfiguration<Object, Object> configuration = new MutableConfiguration<Object, Object>(); Cache<Object, Object> cache = cacheManager.createCache("test", configuration); cache.put(1L, new Customer(1L)); try { cache.get(1L); fail("Expected ClassNotFoundException"); } catch (AssertionError e) { assertThat(e.getMessage(), is("No com.pany here")); } }

Target:
public void testCacheUsesCacheManagerClassLoaderForDefaultURI() { CachingProvider cachingProvider = Caching.getCachingProvider(); LimitedClassLoader limitedClassLoader = new LimitedClassLoader(cachingProvider.getDefaultClassLoader()); CacheManager cacheManager = cachingProvider.getCacheManager(cachingProvider.getDefaultURI(), limitedClassLoader); MutableConfiguration<Object, Object> configuration = new MutableConfiguration<Object, Object>(); Cache<Object, Object> cache = cacheManager.createCache("test", configuration); cache.put(1L, new Customer(1L)); try { cache.get(1L); fail("Expected AssertionError"); } catch (AssertionError e) { assertThat(e.getMessage(), is("No com.pany here")); } }
Source:
public Map<String, ObjectReplicationPolicy> getObjectReplicationSourcePolicies() { Map<String, ObjectReplicationPolicy> objectReplicationSourcePolicies = new HashMap<>(); this.objectReplicationDestinationPolicyId = this.objectReplicationRuleStatus.getOrDefault("policy-id", null); if (objectReplicationDestinationPolicyId == null) { for (String str : this.objectReplicationRuleStatus.keySet()) { String[] split = str.split("_"); String policyId = split[0]; String ruleId = split[1]; if (objectReplicationSourcePolicies.containsKey(policyId)) { objectReplicationSourcePolicies.get(policyId) .putRuleAndStatus(ruleId, this.objectReplicationRuleStatus.get(str)); } else { ObjectReplicationPolicy policy = new ObjectReplicationPolicy(policyId); policy.putRuleAndStatus(ruleId, objectReplicationRuleStatus.get(str)); objectReplicationSourcePolicies.put(policyId, policy); } } } return objectReplicationSourcePolicies; }

Target:
public Map<String, ObjectReplicationPolicy> getObjectReplicationSourcePolicies() { return this.objectReplicationSourcePolicies; }
Source:
public void testLeaderInformationChangedAndShouldBeCorrected() throws Exception { final TestingLeaderElectionDriver.TestingLeaderElectionDriverFactory testingLeaderElectionDriverFactory = new TestingLeaderElectionDriver.TestingLeaderElectionDriverFactory(); final DefaultLeaderElectionService leaderElectionService = new DefaultLeaderElectionService( testingLeaderElectionDriverFactory); final TestingContender testingContender = new TestingContender(TEST_URL, leaderElectionService); leaderElectionService.start(testingContender); final TestingLeaderElectionDriver testingLeaderElectionDriver = testingLeaderElectionDriverFactory.getCurrentLeaderDriver(); assertThat(testingLeaderElectionDriver, is(notNullValue())); testingLeaderElectionDriver.isLeader(); testingContender.waitForLeader(timeout); testingLeaderElectionDriver.leaderInformationChanged(LeaderInformation.empty()); assertThat(testingLeaderElectionDriver.getLeaderInformation().getLeaderAddress(), is(TEST_URL)); testingLeaderElectionDriver.leaderInformationChanged( new LeaderInformation(UUID.randomUUID(), "faulty-address")); assertThat(testingLeaderElectionDriver.getLeaderInformation().getLeaderAddress(), is(TEST_URL)); leaderElectionService.stop(); }

Target:
public void testLeaderInformationChangedAndShouldBeCorrected() throws Exception { new Context() {{ runTest(() -> { testingLeaderElectionDriver.isLeader(); final LeaderInformation expectedLeader = LeaderInformation.known( leaderElectionService.getLeaderSessionID(), TEST_URL); testingLeaderElectionDriver.leaderInformationChanged(LeaderInformation.empty()); assertThat(testingLeaderElectionDriver.getLeaderInformation(), is(expectedLeader)); testingLeaderElectionDriver.leaderInformationChanged( LeaderInformation.known(UUID.randomUUID(), "faulty-address")); assertThat(testingLeaderElectionDriver.getLeaderInformation(), is(expectedLeader)); }); }}; }
Source:
public FileBasedConfig openSystemConfig(Config parent, FS fs) { FileBasedConfig c = createSystemConfig(parent, fs); systemConfig.set(c); return c; }

Target:
public FileBasedConfig openSystemConfig(Config parent, FS fs) { File configFile = fs.getGitSystemConfig(); if (configFile == null) { return new FileBasedConfig(null, fs) { @Override public void load() { } @Override public boolean isOutdated() { return false; } }; } return new FileBasedConfig(parent, configFile, fs); }
Source:
public BlockType deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { String value = json.getAsString(); try { return BlockType.valueOf(value.toUpperCase()); }catch (Exception ex){ logger.error(ex); return BlockType.OTHERS; } }

Target:
public BlockType deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { String value = json.getAsString(); try { return BlockType.valueOf(value.toUpperCase(Locale.US)); }catch (Exception ex){ logger.error(ex); return BlockType.OTHERS; } }
Source:
private String getIdentifierConceptId(final DataType dataType) { return checkNotNull(SnomedRefSetUtil.DATATYPE_TO_REFSET_MAP.get(dataType), "Error while getting identifier concept ID for concrete data type reference set. Type: " + dataType); }

Target:
private String getIdentifierConceptId(final DataType dataType) { return checkNotNull(SnomedRefSetUtil.DATATYPE_TO_REFSET_MAP.get(dataType), "Error while getting identifier concept ID for concrete domain reference set. Type: " + dataType); }
Source:
public int getNLTMMessageType(byte[] decodedNLTMMessage) throws IdentityOAuth2Exception { int messageType; if (decodedNLTMMessage.length > 8) { messageType = decodedNLTMMessage[8]; } else { throw new IdentityOAuth2Exception( "Cannot extract message type from NLTM Token. Decoded token length is less than 8."); } if (messageType < 1 || messageType > 3) { throw new IdentityOAuth2Exception( "Invalid NLTM message type:" + messageType + ". Should be one of 1,2 or 3."); } return messageType; }

Target:
public int getNLTMMessageType(byte[] decodedNLTMMessage) throws IdentityOAuth2Exception { int messageType; if (decodedNLTMMessage.length > MESSAGE_TYPE_BYTE_INDEX) { messageType = decodedNLTMMessage[MESSAGE_TYPE_BYTE_INDEX]; } else { throw new IdentityOAuth2Exception( "Cannot extract message type from NLTM Token. Decoded token length is less than 8."); } if (messageType < NTLM_TYPE_1_TOKEN || messageType > NTLM_TYPE_3_TOKEN) { throw new IdentityOAuth2Exception( "Invalid NLTM message type:" + messageType + ". Should be one of 1,2 or 3."); } return messageType; }
Source:
public void loadLists() { try { if (!Files.exists(blacklistPath)) { Files.createFile(blacklistPath); } if (!Files.exists(whitelistPath)) { Files.createFile(whitelistPath); } blacklistedIDs = gson.fromJson(Files.newBufferedReader(blacklistPath), Set.class); whitelistedIDs = gson.fromJson(Files.newBufferedReader(whitelistPath), Set.class); } catch (IOException e) { logger.error("Whitelist or blacklist files not found:"); e.printStackTrace(); } }

Target:
private void loadLists() { try { if (createFiles()) { blacklistedIDs = gson.fromJson(Files.newBufferedReader(blacklistPath), Set.class); whitelistedIDs = gson.fromJson(Files.newBufferedReader(whitelistPath), Set.class); if (blacklistedIDs == null) { blacklistedIDs = new HashSet<>(); } if (whitelistedIDs == null) { whitelistedIDs = new HashSet<>(); } } } catch (IOException e) { logger.error("Whitelist or blacklist files not found:", e); } }
Source:
private void checkPermission(Session session) throws ZebedeeException { try { if (session == null || !zebedeeCmsService.getPermissions().canEdit(session.getEmail())) { throw new UnauthorizedException("You are not authorised to create collections."); } } catch (IOException io) { error().data("user", session).logAndThrow (io, "Unexpected error while trying to access permissions"); } }

Target:
private void checkPermission(Session session) throws ZebedeeException { try { if (session == null || !zebedeeCmsService.getPermissions().canEdit(session.getEmail())) { throw new UnauthorizedException("You are not authorised to create collections."); } } catch (IOException io) { error().data("user", session.getEmail()).logException(io, CHECK_PERMISSIONS_ERROR); throw new UnexpectedErrorException(CHECK_PERMISSIONS_ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }
Source:
public Object fromBody(ResponseBody body, Type type) throws IOException { InputStream is = body.byteStream(); try { return LoganSquare.parse(is, (Class) type); } finally { try { is.close(); } catch (IOException ignored) { } } }

Target:
public Object fromBody(ResponseBody body, Type type) throws IOException { InputStream is = body.byteStream(); try { if (ParameterizedType.class.isAssignableFrom(type.getClass())) { ParameterizedType parameterizedType = (ParameterizedType) type; return LoganSquare.parseList(is, (Class) parameterizedType.getActualTypeArguments()[0]); } else { return LoganSquare.parse(is, (Class) type); } } catch (Exception e) { throw new RuntimeException(e); } finally { try { is.close(); } catch (IOException ignored) { } } }
Source:
protected void writeEntityBody(Annotation entity, JsonGenerator jg) throws IOException { jg.writeStringField(COMMENT_AUTHOR_FIELD, entity.getAuthor()); jg.writeStringField(COMMENT_TEXT_FIELD, entity.getText()); jg.writeStringField(COMMENT_DOCUMENT_ID_FIELD, entity.getDocumentId()); String creationDate = entity.getCreationDate() != null ? entity.getCreationDate().toString() : null; jg.writeStringField(COMMENT_CREATION_DATE_FIELD, creationDate); String modificationDate = entity.getModificationDate() != null ? entity.getModificationDate().toString() : null; jg.writeStringField(COMMENT_MODIFICATION_DATE_FIELD, modificationDate); jg.writeStringField(ANNOTATION_ID, entity.getId()); jg.writeStringField(ANNOTATION_XPATH, entity.getXpath()); jg.writeStringField(ANNOTATION_ENTITY_ID, ((ExternalEntity) entity).getEntityId()); jg.writeStringField(ANNOTATION_ORIGIN, ((ExternalEntity) entity).getOrigin()); jg.writeStringField(ANNOTATION_ENTITY, ((ExternalEntity) entity).getEntity()); }

Target:
protected void writeEntityBody(Annotation entity, JsonGenerator jg) throws IOException { jg.writeStringField(COMMENT_AUTHOR_FIELD, entity.getAuthor()); jg.writeStringField(COMMENT_TEXT_FIELD, entity.getText()); jg.writeStringField(COMMENT_DOCUMENT_ID_FIELD, entity.getDocumentId()); String creationDate = entity.getCreationDate() != null ? entity.getCreationDate().toString() : null; jg.writeStringField(COMMENT_CREATION_DATE_FIELD, creationDate); String modificationDate = entity.getModificationDate() != null ? entity.getModificationDate().toString() : null; jg.writeStringField(COMMENT_MODIFICATION_DATE_FIELD, modificationDate); jg.writeStringField(ANNOTATION_ID, entity.getId()); jg.writeStringField(ANNOTATION_XPATH, entity.getXpath()); if (entity instanceof ExternalEntity) { jg.writeStringField(EXTERNAL_ENTITY_ID, ((ExternalEntity) entity).getEntityId()); jg.writeStringField(EXTERNAL_ENTITY_ORIGIN, ((ExternalEntity) entity).getOrigin()); jg.writeStringField(EXTERNAL_ENTITY, ((ExternalEntity) entity).getEntity()); } }
Source:
boolean diffQuery() throws Exception { Long start = EnvironmentEdgeManager.currentTimeMillis(); Date startDate = Calendar.getInstance().getTime(); String newCSV = queryVerifier.exportCSV(query); boolean verifyResult = queryVerifier.doDiff(query, newCSV); String explainPlan = pUtil.getExplainPlan(query); getThreadTime().getRunTimesInMs().add(new RunTime( verifyResult == true ? PherfConstants.DIFF_PASS : PherfConstants.DIFF_FAIL, explainPlan, startDate, -1L, (int) (EnvironmentEdgeManager.currentTimeMillis() - start), (EnvironmentEdgeManager.currentTimeMillis() - start) >= executionDurationInMs)); return ((EnvironmentEdgeManager.currentTimeMillis() - start) >= executionDurationInMs); }

Target:
private void diffQuery() throws Exception { Long start = EnvironmentEdgeManager.currentTimeMillis(); Date startDate = Calendar.getInstance().getTime(); String newCSV = queryVerifier.exportCSV(query); boolean verifyResult = queryVerifier.doDiff(query, newCSV); String explainPlan = pUtil.getExplainPlan(query); long elapsedTime = EnvironmentEdgeManager.currentTimeMillis() - start; getThreadTime().getRunTimesInMs().add(new RunTime( verifyResult == true ? PherfConstants.DIFF_PASS : PherfConstants.DIFF_FAIL, explainPlan, startDate, -1L, elapsedTime, !(elapsedTime >= executionDurationInMs))); }
Source:
public @Nullable Converter<ResponseBody, ?> responseBodyConverter( Type type, Annotation[] annotations, Retrofit retrofit) { if (type instanceof Class && ((Class<?>) type).isAnnotationPresent(XmlRootElement.class)) { switch (convertingMediaType) { case XML: return new JaxbXmlResponseConverter<>(contextForType((Class<?>) type), unmarshalProps, (Class<?>) type); case JSON: return new JaxbJsonResponseConverter<>(contextForType((Class<?>) type), unmarshalProps, (Class<?>) type); default: throw new IllegalArgumentException("Unsupported content type: " + convertingMediaType); } } return null; }

Target:
public @Nullable Converter<ResponseBody, ?> responseBodyConverter( Type type, Annotation[] annotations, Retrofit retrofit) { JAXBContext context = contextForType((Class<?>) type); if (contentType.equals(XML)) { if (((Class<?>) type).isAnnotationPresent(XmlRootElement.class)) { return new JaxbXmlResponseConverter<>(context, (Class<?>) type); } } else { return new JaxbGenericResponseConverter<>(context, (Class<?>) type); } return null; }
Source:
public ImageIcon getImageIcon(int size) { Image image = getImage(size); return (image == null) ? null : new ImageIcon(image); }

Target:
public @Nullable ImageIcon getImageIcon(int size) { Image image = getImage(size); return (image == null) ? null : new ImageIcon(image); }
Source:
private Stream<Constraint> addFlowFromLearnedConstraints(ExplodedGraph.Node currentNode) { ExplodedGraph.Node parent = currentNode.parent(); if (parent == null) { return Stream.empty(); } return currentNode.learnedConstraints() .filter(lc -> lc.symbolicValue().equals(symbolicValue) && (lc.constraint == null || domains.stream().anyMatch(d -> d.isAssignableFrom(lc.constraint.getClass())))) .map(LearnedConstraint::constraint) .peek(lc -> learnedConstraintFlow(lc, currentNode, parent).forEach(flow::add)); }

Target:
private Stream<Constraint> addFlowFromLearnedConstraints(ExplodedGraph.Node currentNode) { ExplodedGraph.Node parent = currentNode.parent(); if (parent == null) { return Stream.empty(); } return currentNode.learnedConstraints() .filter(lc -> lc.symbolicValue().equals(symbolicValue)) .filter(this::learnedConstraintForDomains) .map(LearnedConstraint::constraint) .peek(lc -> learnedConstraintFlow(lc, currentNode, parent).forEach(flow::add)); }
Source:
EventStore(Executor streamExecutor, StorageFactory storageFactory, @Nullable Logger logger) { super(); final ERepository eventRepository = new ERepository(); eventRepository.initStorage(storageFactory); this.storage = eventRepository; this.streamExecutor = streamExecutor; this.logger = logger; }

Target:
private EventStore(Executor streamExecutor, StorageFactory storageFactory, @Nullable Logger logger) { super(); final ERepository eventRepository = new ERepository(); eventRepository.initStorage(storageFactory); this.storage = eventRepository; this.streamExecutor = streamExecutor; this.logger = logger; }
Source:
public static void reEncryptAllFiles(SQLiteDatabase db, String oldKey, String newKey) { final StringBuilder path = new StringBuilder(db.getPath()).append(EXTERNAL_BLOBS_SUFFIX); final File dir = new File(path.toString()); if (dir.exists()) { final File[] tables = dir.listFiles(); if (tables != null) { for (final File table : tables) { final File[] blobs = table.listFiles(); if (blobs != null) { for (final File blob : blobs) { final StringBuilder json = new StringBuilder(); String result; try { final BufferedReader br = new BufferedReader(new FileReader(blob)); String line; while ((line = br.readLine()) != null) { json.append(line).append('\n'); } br.close(); result = Encryptor.legacyDecrypt(json.toString(), oldKey); blob.delete(); final FileOutputStream outputStream = new FileOutputStream(blob, false); outputStream.write(Encryptor.encrypt(result, newKey).getBytes()); outputStream.close(); } catch (IOException ex) { SmartStoreLogger.e(TAG, "Exception occurred while rekeying external files", ex); } } } } } } }

Target:
public static synchronized void reEncryptAllFiles(SQLiteDatabase db, String oldKey, String newKey) { final File dir = new File(db.getPath() + EXTERNAL_BLOBS_SUFFIX); if (dir.exists()) { final File[] tables = dir.listFiles(); if (tables != null) { for (final File table : tables) { final File[] blobs = table.listFiles(); if (blobs != null) { for (final File blob : blobs) { final StringBuilder json = new StringBuilder(); String result; try { final BufferedReader br = new BufferedReader(new FileReader(blob)); String line; while ((line = br.readLine()) != null) { json.append(line).append('\n'); } br.close(); if (oldKey.getBytes().length == 24) { result = Encryptor.legacyDecrypt(json.toString(), oldKey); } else { result = Encryptor.decrypt(json.toString(), oldKey); } blob.delete(); final FileOutputStream outputStream = new FileOutputStream(blob, false); outputStream.write(Encryptor.encrypt(result, newKey).getBytes()); outputStream.close(); } catch (IOException ex) { SmartStoreLogger.e(TAG, "Exception occurred while rekeying external files", ex); } } } } } } }
Source:
public void dataCenterWithClusterSelectedItemChanged() { DataCenterWithCluster dataCenterWithCluster = getModel().getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster == null) { return; } StoragePool dataCenter = dataCenterWithCluster.getDataCenter(); if (dataCenter == null) { return; } if (dataCenter.getQuotaEnforcementType() != QuotaEnforcementTypeEnum.DISABLED) { getModel().getQuota().setIsAvailable(true); } else { getModel().getQuota().setIsAvailable(false); } getModel().getIsRngEnabled().setIsChangeable(true); setRngAvailability(); getModel().getEmulatedMachine().setIsAvailable(dataCenterWithCluster.getCluster().getCompatibilityVersion().greaterOrEquals(Version.v4_2)); postDataCenterWithClusterSelectedItemChanged(); }

Target:
public void dataCenterWithClusterSelectedItemChanged() { DataCenterWithCluster dataCenterWithCluster = getModel().getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster == null) { return; } StoragePool dataCenter = dataCenterWithCluster.getDataCenter(); if (dataCenter == null) { return; } if (dataCenter.getQuotaEnforcementType() != QuotaEnforcementTypeEnum.DISABLED) { getModel().getQuota().setIsAvailable(true); } else { getModel().getQuota().setIsAvailable(false); } getModel().getIsRngEnabled().setIsChangeable(true); setRngAvailability(); getModel().getEmulatedMachine().updateChangeability(ConfigurationValues.Q35EmulatedMachineSupported, dataCenterWithCluster.getCluster().getCompatibilityVersion()); updateEmulatedMachines(); postDataCenterWithClusterSelectedItemChanged(); }
Source:
public static Chain decode(byte[] payload) { final List<Element> elements = new ArrayList<Element>(); if (payload.length != 0) { ByteBuffer buffer = ByteBuffer.wrap(payload); boolean isSequenced = buffer.get() == 1; if (isSequenced) { while (buffer.hasRemaining()) { final long sequence = buffer.getLong(); int payloadSize = buffer.getInt(); buffer.limit(buffer.position() + payloadSize); final ByteBuffer elementPayload = buffer.slice(); buffer.position(buffer.limit()); buffer.limit(buffer.capacity()); elements.add(new SequencedElement() { @Override public long getSequenceNumber() { return sequence; } @Override public ByteBuffer getPayload() { return elementPayload.duplicate(); } }); } } else { while (buffer.hasRemaining()) { int payloadSize = buffer.getInt(); buffer.limit(buffer.position() + payloadSize); final ByteBuffer elementPayload = buffer.slice(); buffer.position(buffer.limit()); buffer.limit(buffer.capacity()); elements.add(new Element() { @Override public ByteBuffer getPayload() { return elementPayload.duplicate(); } }); } } } return new Chain() { final List<Element> elementList = Collections.unmodifiableList(elements); @Override public Iterator<Element> reverseIterator() { return Util.reverseIterator(elementList); } @Override public boolean isEmpty() { return elementList.isEmpty(); } @Override public Iterator<Element> iterator() { return elementList.iterator(); } }; }

Target:
public static Chain decode(byte[] payload) { final List<Element> elements = new ArrayList<Element>(); if (payload.length != 0) { ByteBuffer buffer = ByteBuffer.wrap(payload); boolean isSequenced = buffer.get() == 1; if (isSequenced) { while (buffer.hasRemaining()) { long sequence = buffer.getLong(); int payloadSize = buffer.getInt(); buffer.limit(buffer.position() + payloadSize); ByteBuffer elementPayload = buffer.slice(); buffer.position(buffer.limit()); buffer.limit(buffer.capacity()); elements.add(getElement(sequence, elementPayload)); } } else { while (buffer.hasRemaining()) { int payloadSize = buffer.getInt(); buffer.limit(buffer.position() + payloadSize); ByteBuffer elementPayload = buffer.slice(); buffer.position(buffer.limit()); buffer.limit(buffer.capacity()); elements.add(getElement(elementPayload)); } } } return getChain(elements); }
Source:
public T getRecordForValues(String[] rawFieldNames, Object[] values) throws NoSuchElementException, InvalidIndexException { Pair<String, String[]> whereClause = helper.createWhere(rawFieldNames, values, em, t); Cursor c = helper.getHandle().query(table, new String[]{DatabaseHelper.ID_COL, DatabaseHelper.DATA_COL}, whereClause.first, whereClause.second, null, null, null); if (c.getCount() == 0) { throw new NoSuchElementException("No element in table " + table + " with names " + rawFieldNames + " and values " + values.toString()); } if (c.getCount() > 1) { throw new InvalidIndexException("Invalid unique column set" + rawFieldNames + ". Multiple records found with value " + values.toString(), rawFieldNames.toString()); } c.moveToFirst(); byte[] data = c.getBlob(c.getColumnIndexOrThrow(DatabaseHelper.DATA_COL)); int dbId = c.getInt(c.getColumnIndexOrThrow(DatabaseHelper.ID_COL)); c.close(); return newObject(data, dbId); }

Target:
public T getRecordForValues(String[] rawFieldNames, Object[] values) throws NoSuchElementException, InvalidIndexException { Pair<String, String[]> whereClause = helper.createWhere(rawFieldNames, values, em, t); Cursor c = helper.getHandle().query(table, new String[]{DatabaseHelper.ID_COL, DatabaseHelper.DATA_COL}, whereClause.first, whereClause.second, null, null, null); if (c.getCount() == 0) { throw new NoSuchElementException("No element in table " + table + " with names " + rawFieldNames + " and values " + values.toString()); } if (c.getCount() > 1) { throw new InvalidIndexException("Invalid unique column set" + rawFieldNames + ". Multiple records found with value " + values.toString(), rawFieldNames.toString()); } c.moveToFirst(); byte[] data = c.getBlob(c.getColumnIndexOrThrow(DatabaseHelper.DATA_COL)); c.close(); return newObject(data); }
Source:
public Matrix outerProduct(Vector vector, Factory factory) { if (vector == null) { throw new IllegalArgumentException("Vector can't be null."); } if (factory == null) { throw new IllegalArgumentException("Factory can't be null."); } if (length != vector.length()) { throw new IllegalArgumentException("Wrong vector length: " + vector.length()); } Matrix result = factory.createSquareMatrix(length); for (int i = 0; i < length; i++) { for (int j = 0; j < length; j++) { result.set(i, j, get(i) * vector.get(j)); } } return result; }

Target:
public Matrix outerProduct(Vector vector, Factory factory) { ensureFactoryIsNotNull(factory); if (vector == null) { throw new IllegalArgumentException("Vector can't be null."); } int otherLength = vector.length(); Matrix result = factory.createMatrix(length, otherLength); for (int i = 0; i < length; i++) { for (int j = 0; j < otherLength; j++) { result.set(i, j, get(i) * vector.get(j)); } } return result; }
Source:
public Mono<Void> handleMessage(Message<?> message) { Assert.notNull(message, "Message must not be null"); Assert.notNull(message.getPayload(), "Message payload must not be null"); if (this.loggingEnabled && this.logger.isDebugEnabled()) { this.logger.debug(this + " received message: " + message); } org.springframework.integration.support.management.MetricsContext start = null; SampleFacade sample = null; if (this.countsEnabled && this.metricsCaptor != null) { sample = this.metricsCaptor.start(); } try { if (this.shouldTrack) { message = MessageHistory.write(message, this, getMessageBuilderFactory()); } return handleMessageInternal(message); } catch (Exception e) { if (sample != null) { sample.stop(buildSendTimer(false, e.getClass().getSimpleName())); } if (this.countsEnabled) { this.handlerMetrics.afterHandle(start, false); } throw IntegrationUtils.wrapInHandlingExceptionIfNecessary(message, () -> "error occurred in message handler [" + this + "]", e); } }

Target:
public Mono<Void> handleMessage(Message<?> message) { Assert.notNull(message, "Message must not be null"); if (this.loggingEnabled && this.logger.isDebugEnabled()) { this.logger.debug(this + " received message: " + message); } if (this.shouldTrack) { message = MessageHistory.write(message, this, getMessageBuilderFactory()); } final Message<?> msg = message; return handleMessageInternal(msg) .doOnError(e -> this.logger.error( "An error occurred in message handler [" + this + "] on message [" + msg + "]", e)); }
Source:
public void setParent(Segment<?> parent) { this.parent = parent; }

Target:
void setParent(Segment<?> parent) { this.parent = parent; }
Source:
public List<SourceFile> downloadDescriptors(String entry, String descriptor, File tempDir) { String[] parts = entry.split(":"); String path = parts[0]; String version = (parts.length > 1) ? parts[1] : "master"; Workflow workflow = getDockstoreWorkflow(path); List<SourceFile> result = new ArrayList<>(); if (workflow != null) { try { List<SourceFile> files; if (descriptor.toLowerCase().equals("cwl")) { files = workflowsApi.secondaryCwl(workflow.getId(), version); } else if (descriptor.toLowerCase().equals("wdl")) { files = workflowsApi.secondaryWdl(workflow.getId(), version); } else { throw new UnsupportedOperationException("other languages not supported yet"); } writeSourceFilesToDisk(tempDir, result, files); } catch (ApiException e) { exceptionMessage(e, "Error getting file(s) from server", Client.API_ERROR); } catch (IOException e) { exceptionMessage(e, "Error writing to File", Client.IO_ERROR); } } return result; }

Target:
public List<SourceFile> downloadDescriptors(String entry, String descriptor, File tempDir) { String[] parts = entry.split(":"); String path = parts[0]; String version = (parts.length > 1) ? parts[1] : "master"; Workflow workflow = getDockstoreWorkflow(path); List<SourceFile> result = new ArrayList<>(); if (workflow != null) { try { List<SourceFile> files; if (descriptor.toLowerCase().equals(CWL_STRING)) { files = workflowsApi.secondaryCwl(workflow.getId(), version); } else if (descriptor.toLowerCase().equals(WDL_STRING)) { files = workflowsApi.secondaryWdl(workflow.getId(), version); } else { throw new UnsupportedOperationException("other languages not supported yet"); } writeSourceFilesToDisk(tempDir, result, files); } catch (ApiException e) { exceptionMessage(e, "Error getting file(s) from server", Client.API_ERROR); } catch (IOException e) { exceptionMessage(e, "Error writing to File", Client.IO_ERROR); } } return result; }
Source:
public void verifyCIDRValue() { final IpValue ipValue = new IpValue("10.0.0.5,192.168.0.0/24"); for (IPAddress ipAddress : new IPAddressRange("192.168.0.0", "192.168.0.255")) { assertThat(ipValue.isInRange(ipAddress.toUserString()), is(true)); } assertThat(ipValue.isInRange("10.0.0.5"), is(false)); }

Target:
public void verifyCIDRValue() { final IpValue ipValue = new IpValue("10.0.0.5,192.168.0.0/24"); for (IPAddress ipAddress : new IPAddressRange("192.168.0.0", "192.168.0.255")) { assertThat(ipValue.isInRange(ipAddress.toUserString()), is(true)); } assertThat(ipValue.isInRange("192.168.1.0"), is(false)); assertThat(ipValue.isInRange("192.168.2.0"), is(false)); assertThat(ipValue.isInRange("10.0.0.0"), is(false)); assertThat(ipValue.isInRange("10.0.0.1"), is(false)); assertThat(ipValue.isInRange("10.0.0.2"), is(false)); assertThat(ipValue.isInRange("10.0.0.3"), is(false)); assertThat(ipValue.isInRange("10.0.0.4"), is(false)); assertThat(ipValue.isInRange("10.0.0.5"), is(true)); assertThat(ipValue.isInRange("10.0.0.7"), is(false)); assertThat(ipValue.isInRange("10.0.0.8"), is(false)); assertThat(ipValue.isInRange("10.0.0.9"), is(false)); assertThat(ipValue.isInRange("10.0.0.10"), is(false)); }
Source:
public long getRetainedSizeInBytes() { long size = getInitialRetainedSizeInBytes(); for (int i = 0; i < decodedBlocks.length; i++) { size += decodedBlocks[i].getRetainedSizeInBytes(); } for (int i = 0; i < partitionBuffer.length; i++) { size += partitionBuffer[i].getRetainedSizeInBytes(); } return size; }

Target:
public long getRetainedSizeInBytes() { long size = 0; for (int i = 0; i < partitionBuffers.length; i++) { size += partitionBuffers[i].getRetainedSizeInBytes(); } for (int i = 0; i < decodedBlocks.length; i++) { size += decodedBlocks[i] == null ? 0 : decodedBlocks[i].getRetainedSizeInBytes(); } return size; }
Source:
public ImageDescriptor getImageDescriptor() { return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DUPLICATE_CONFIG); }

Target:
public ImageDescriptor getImageDescriptor() { return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_WIZBAN_IMPORT_CONFIGS); }
Source:
private boolean signalIsForUs(ITmfTrace sender) { if (sender == sp.getTrace()) { return true; } else if (sender instanceof TmfExperiment) { TmfExperiment exp = (TmfExperiment) sender; for (ITmfTrace childTrace : exp.getTraces()) { if (childTrace == sp.getTrace()) { return true; } } } return false; }

Target:
private boolean signalIsForUs(ITmfTrace sender) { if (sender == sp.getTrace()) { return true; } else if (sender instanceof TmfExperiment) { for (ITmfTrace childtrace : TmfTraceManager.getTraceSet(sender)) { if (sp.getTrace() == childtrace) { return true; } } } return false; }
Source:
public NettyAsyncHttpClient build() { HttpClient nettyHttpClient = HttpClient.create() .port(port) .wiretap(enableWiretap) .tcpConfiguration(tcpConfig -> { if (nioEventLoopGroup != null) { tcpConfig = tcpConfig.runOn(nioEventLoopGroup); } if (proxyOptions == null) { return tcpConfig; } ProxyProvider.Proxy nettyProxy; switch (proxyOptions.type()) { case HTTP: nettyProxy = ProxyProvider.Proxy.HTTP; break; case SOCKS4: nettyProxy = ProxyProvider.Proxy.SOCKS4; break; case SOCKS5: nettyProxy = ProxyProvider.Proxy.SOCKS5; break; default: throw logger.logExceptionAsWarning(new IllegalStateException("Unknown Proxy type '" + proxyOptions.type() + "' in use. Not configuring Netty proxy.")); } return tcpConfig.proxy(ts -> ts.type(nettyProxy).address(proxyOptions.address())); }); return new NettyAsyncHttpClient(nettyHttpClient); }

Target:
public NettyAsyncHttpClient build() { HttpClient nettyHttpClient = HttpClient.create() .port(port) .wiretap(enableWiretap) .tcpConfiguration(tcpConfig -> { if (nioEventLoopGroup != null) { tcpConfig = tcpConfig.runOn(nioEventLoopGroup); } if (proxyOptions != null) { ProxyProvider.Proxy nettyProxy; switch (proxyOptions.type()) { case HTTP: nettyProxy = ProxyProvider.Proxy.HTTP; break; case SOCKS4: nettyProxy = ProxyProvider.Proxy.SOCKS4; break; case SOCKS5: nettyProxy = ProxyProvider.Proxy.SOCKS5; break; default: throw logger.logExceptionAsWarning(new IllegalStateException("Unknown Proxy type '" + proxyOptions.type() + "' in use. Not configuring Netty proxy.")); } return tcpConfig.proxy(ts -> ts.type(nettyProxy).address(proxyOptions.address())); } return tcpConfig; }); return new NettyAsyncHttpClient(nettyHttpClient); }
Source:
public PassiveScannerOptionsPanel(I18N messages) { setName(messages.getString("pscan.options.main.name")); setLayout(new GridBagLayout()); scanOnlyInScopeCheckBox = new JCheckBox(messages.getString("pscan.options.main.label.scanOnlyInScope")); scanFuzzerMessagesCheckBox = new JCheckBox(messages.getString("pscan.options.main.label.scanFuzzerMessages")); int row = 0; add(scanOnlyInScopeCheckBox, LayoutHelper.getGBC(0, row, 1, 0.0D, 0)); row++; add(scanFuzzerMessagesCheckBox, LayoutHelper.getGBC(0, row, 1, 0.0D, 0)); add(new JLabel(), LayoutHelper.getGBC(0, 10, 1, 0.5D, 1.0D)); }

Target:
public PassiveScannerOptionsPanel(I18N messages) { setName(messages.getString("pscan.options.main.name")); GroupLayout layout = new GroupLayout(this); setLayout(layout); layout.setAutoCreateGaps(true); layout.setAutoCreateContainerGaps(true); scanOnlyInScopeCheckBox = new JCheckBox(messages.getString("pscan.options.main.label.scanOnlyInScope")); scanFuzzerMessagesCheckBox = new JCheckBox(messages.getString("pscan.options.main.label.scanFuzzerMessages")); layout.setHorizontalGroup( layout.createParallelGroup() .addComponent(scanOnlyInScopeCheckBox) .addComponent(scanFuzzerMessagesCheckBox)); layout.setVerticalGroup( layout.createSequentialGroup() .addComponent(scanOnlyInScopeCheckBox) .addComponent(scanFuzzerMessagesCheckBox)); }
Source:
void activate() { multimap.values() .forEach(EnrichmentFunction::activate); LinkedListMultimap<? extends Class<?>, ? extends EnrichmentFunction<?, ?, ?>> compacted = multimap.values() .stream() .filter(EnrichmentFunction::isActive) .collect(toMultimap(EnrichmentFunction::sourceClass, e -> e, LinkedListMultimap::create)); multimap = ImmutableMultimap.copyOf(compacted); }

Target:
void activate() { multimap.values() .forEach(EnrichmentFunction::activate); LinkedListMultimap<? extends Class<?>, ? extends EnrichmentFunction<?, ?, ?>> compacted = multimap.values() .stream() .filter(EnrichmentFunction::isActive) .collect(toMultimap(EnrichmentFunction::sourceClass, Function.identity(), LinkedListMultimap::create)); multimap = ImmutableMultimap.copyOf(compacted); }
Source:
public final ModelAndView display(String idString, ModelMap model) throws IOException { return prepare(model, create, verb + " " + qcTarget + " QCs", LimsUtils.parseIds(idString).stream() .flatMap(WhineyFunction.rethrow(this::load)) .sorted(new Comparator<QcDto>() { @Override public int compare(QcDto o1, QcDto o2) { return o1.getEntityAlias().compareTo(o2.getEntityAlias()); } }) .collect(Collectors.toList())); }

Target:
public final ModelAndView display(String idString, ModelMap model) throws IOException { return prepare(model, create, verb + " " + qcTarget + " QCs", LimsUtils.parseIds(idString).stream() .flatMap(WhineyFunction.rethrow(this::load)) .sorted(Comparator.comparing(QcDto::getEntityAlias)) .collect(Collectors.toList())); }
Source:
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertSignalEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, ""); assertDataIOSet(emptyEvent.getDataIOSet(), EMPTY_VALUE); }

Target:
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertSignalEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE); assertDataIOSet(emptyEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
public static short getNetmaskShortForm(String netmask) throws KuraException { if (netmask == null) { throw new KuraException(KuraErrorCode.INTERNAL_ERROR, "netmask is null"); } int netmaskValue = NetworkUtil.convertIp4Address(netmask); boolean hitZero = false; int displayMask = 1 << 31; int count = 0; for (int c = 1; c <= 32; c++) { if ((netmaskValue & displayMask) == 0) { hitZero = true; } else { if (hitZero) { s_logger.error("received invalid mask: " + netmask); throw new KuraException(KuraErrorCode.INTERNAL_ERROR, "received invalid mask: " + netmask); } count++; } netmaskValue <<= 1; } return (short) count; }

Target:
public static short getNetmaskShortForm(String netmask) { if (netmask == null) { throw new IllegalArgumentException("netmask is null"); } int netmaskValue = NetworkUtil.convertIp4Address(netmask); boolean hitZero = false; int displayMask = 1 << 31; int count = 0; for (int c = 1; c <= 32; c++) { if ((netmaskValue & displayMask) == 0) { hitZero = true; } else { if (hitZero) { s_logger.error("received invalid mask: " + netmask); throw new IllegalArgumentException("netmask is invalid: " + netmask); } count++; } netmaskValue <<= 1; } return (short) count; }
Source:
public void processElement(ProcessContext context) { Variant variant = context.element(); CallSimilarityCalculator callSimilarityCalculator = callSimilarityCalculatorFactory.get(isReferenceMajor(variant)); FluentIterable<KV<Call, Call>> pairs = PairGenerator.<Call, ImmutableList<Call>>allPairs(getSamplesWithVariant(variant), false, new VariantUtils.CallComparator()); for (KV<Call, Call> pair : pairs) { accumulateCallSimilarity(callSimilarityCalculator, pair.getKey(), pair.getValue()); } }

Target:
public void processElement(ProcessContext context) { Variant variant = context.element(); CallSimilarityCalculator callSimilarityCalculator = callSimilarityCalculatorFactory.get(isReferenceMajor(variant)); for (KV<Call, Call> pair : PairGenerator.WITHOUT_REPLACEMENT.allPairs( getSamplesWithVariant(variant), VariantUtils.CALL_COMPARATOR)) { accumulateCallSimilarity(callSimilarityCalculator, pair.getKey(), pair.getValue()); } }
Source:
public String findGPUHost() { List<Hosts> hosts = find(); for(Hosts host: hosts){ if(host.getNumGpus() > 0){ return host.getHostname(); } } return null; }

Target:
public String findGPUHost() { List<Hosts> hosts = find(); for(Hosts host: hosts){ if(host.getNumGpus() > 0 && host.getCondaEnabled()){ return host.getHostname(); } } return null; }
Source:
public static void output(@AggregationState PrecisionRecallState state, BlockBuilder out) { Iterator<BucketResult> resultsIterator = getResultsIterator(state); BlockBuilder entryBuilder = out.beginBlockEntry(); while (resultsIterator.hasNext()) { final BucketResult result = resultsIterator.next(); DoubleType.DOUBLE.writeDouble( entryBuilder, result.falsePositive / result.negative); } out.closeEntry(); }

Target:
public static void output(@AggregationState PrecisionRecallState state, BlockBuilder out) { Iterator<BucketResult> resultsIterator = getResultsIterator(state); BlockBuilder entryBuilder = out.beginBlockEntry(); while (resultsIterator.hasNext()) { BucketResult result = resultsIterator.next(); DoubleType.DOUBLE.writeDouble( entryBuilder, result.getFalsePositive() / result.getNegative()); } out.closeEntry(); }
Source:
public void testClearCache() throws IOException, ExecutionException, InterruptedException { this.warmCache(); HttpResponse response = httpClient().method("GET").path("/_filter_join/cache/stats").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); System.out.println(response); Map<String, Object> map = XContentHelper.convertToMap(new BytesArray(response.getBody().getBytes("UTF-8")), false).v2(); Map nodes = (Map) map.get("nodes"); for (Object node : nodes.values()) { Map stats = (Map) ((Map) node).get("stats"); assertThat((Integer) stats.get("size"), equalTo(1)); } response = httpClient().method("GET").path("/_filter_join/cache/clear").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); System.out.println(response); response = httpClient().method("GET").path("/_filter_join/cache/stats").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); map = XContentHelper.convertToMap(new BytesArray(response.getBody().getBytes("UTF-8")), false).v2(); nodes = (Map) map.get("nodes"); for (Object node : nodes.values()) { Map stats = (Map) ((Map) node).get("stats"); assertThat((Integer) stats.get("size"), equalTo(0)); } }

Target:
public void testClearCache() throws IOException, ExecutionException, InterruptedException { this.warmCache(); HttpResponse response = httpClient().method("GET").path("/_filter_join/cache/stats").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); Map<String, Object> map = XContentHelper.convertToMap(new BytesArray(response.getBody().getBytes("UTF-8")), false).v2(); Map nodes = (Map) map.get("nodes"); for (Object node : nodes.values()) { Map stats = (Map) ((Map) node).get("stats"); assertThat((Integer) stats.get("size"), equalTo(1)); } response = httpClient().method("GET").path("/_filter_join/cache/clear").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); response = httpClient().method("GET").path("/_filter_join/cache/stats").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); map = XContentHelper.convertToMap(new BytesArray(response.getBody().getBytes("UTF-8")), false).v2(); nodes = (Map) map.get("nodes"); for (Object node : nodes.values()) { Map stats = (Map) ((Map) node).get("stats"); assertThat((Integer) stats.get("size"), equalTo(0)); } }
Source:
protected boolean canDoAction() { if (!isVmExist() || !acquireLockInternal()) { return false; } if (getParameters().getDiskInfo().isShareable() && getStorageDomain().getStorageType() == StorageType.GLUSTERFS) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISKS_NOT_SUPPORTED_ON_GLUSTER_DOMAIN); } VM vm = getVm(); if (vm != null) { if (!canRunActionOnNonManagedVm()) { return false; } updateDisksFromDb(); if (!isDiskCanBeAddedToVm(getParameters().getDiskInfo(), vm) || !isDiskPassPciAndIdeLimit(getParameters().getDiskInfo())) { return false; } } if (DiskStorageType.IMAGE == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfImageDiskCanBeAdded(vm); } if (DiskStorageType.LUN == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfLunDiskCanBeAdded(); } return true; }

Target:
protected boolean canDoAction() { if (!isVmExist() || !acquireLockInternal()) { return false; } VM vm = getVm(); if (vm != null) { if (!canRunActionOnNonManagedVm()) { return false; } updateDisksFromDb(); if (!isDiskCanBeAddedToVm(getParameters().getDiskInfo(), vm) || !isDiskPassPciAndIdeLimit(getParameters().getDiskInfo())) { return false; } } if (DiskStorageType.IMAGE == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfImageDiskCanBeAdded(vm); } if (DiskStorageType.LUN == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfLunDiskCanBeAdded(); } return true; }
Source:
private void writeVersion(DefaultInputModule module, ScannerReport.Component.Builder builder) { String version = getVersion(module); if (version != null) { checkArgument(version.length() <= 100, "The version name must not be longer then 100 characters"); builder.setVersion(version); } }

Target:
private void writeVersion(DefaultInputModule module, ScannerReport.Component.Builder builder) { String version = getVersion(module); if (version != null) { builder.setVersion(version); } }
Source:
public void validateSubscriptionChange(final Subscription old, final SubscriptionBase newValue) throws SubscriptionUpdateConflictException { if (!Objects.equals(newValue.getConsumerGroup(), old.getConsumerGroup())) { throw new SubscriptionUpdateConflictException("Not allowed to change subscription consumer group"); } if (!Objects.equals(newValue.getEventTypes(), old.getEventTypes())) { throw new SubscriptionUpdateConflictException("Not allowed to change subscription event types"); } if (!Objects.equals(newValue.getOwningApplication(), old.getOwningApplication())) { throw new SubscriptionUpdateConflictException("Not allowed to change owning application"); } if (!Objects.equals(newValue.getReadFrom(), old.getReadFrom())) { throw new SubscriptionUpdateConflictException("Not allowed to change read from"); } if (!Objects.equals(newValue.getInitialCursors(), old.getInitialCursors())) { throw new SubscriptionUpdateConflictException("Not allowed to change initial cursors"); } authorizationValidator.validateAuthorization(old.asResource(), newValue.asBaseResource()); }

Target:
public void validateSubscriptionChange(final Subscription old, final SubscriptionBase newValue) throws SubscriptionUpdateConflictException { if (!Objects.equals(newValue.getConsumerGroup(), old.getConsumerGroup())) { throw new SubscriptionUpdateConflictException("Not allowed to change subscription consumer group"); } if (!Objects.equals(newValue.getEventTypes(), old.getEventTypes())) { throw new SubscriptionUpdateConflictException("Not allowed to change subscription event types"); } if (!Objects.equals(newValue.getOwningApplication(), old.getOwningApplication())) { throw new SubscriptionUpdateConflictException("Not allowed to change owning application"); } if (!Objects.equals(newValue.getReadFrom(), old.getReadFrom())) { throw new SubscriptionUpdateConflictException("Not allowed to change read from"); } if (!Objects.equals(newValue.getInitialCursors(), old.getInitialCursors())) { throw new SubscriptionUpdateConflictException("Not allowed to change initial cursors"); } authorizationValidator.validateAuthorization(old.asResource(), newValue.asBaseResource(old.getId())); }
Source:
public void onResume() { super.onResume(); if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { titleEditText.post(new Runnable() { @Override public void run() { titleEditText.clearFocus(); } }); } }

Target:
public void onResume() { super.onResume(); if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { SoftKeyboardUtil.clearViewFocus(titleEditText); } }
Source:
private Predicate<Application> isLongWaitingApplications() { return application -> { LocalDate remindDate = application.getRemindDate(); if (remindDate == null) { Integer daysBeforeRemindForWaitingApplications = settingsService.getSettings().getAbsenceSettings().getDaysBeforeRemindForWaitingApplications(); LocalDate minDateForNotification = application.getApplicationDate() .plusDays(daysBeforeRemindForWaitingApplications); return minDateForNotification.isBefore(ZonedDateTime.now(UTC).toLocalDate()); } else { return !remindDate.isEqual(ZonedDateTime.now(UTC).toLocalDate()); } }; }

Target:
private Predicate<Application> isLongWaitingApplications() { return application -> { LocalDate remindDate = application.getRemindDate(); if (remindDate == null) { Integer daysBeforeRemindForWaitingApplications = settingsService.getSettings().getAbsenceSettings().getDaysBeforeRemindForWaitingApplications(); LocalDate minDateForNotification = application.getApplicationDate() .plusDays(daysBeforeRemindForWaitingApplications); return minDateForNotification.isBefore(LocalDate.now(UTC)); } else { return !remindDate.isEqual(LocalDate.now(UTC)); } }; }