auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private DataSerializable readInternal(ObjectDataInput in, Class aClass) throws IOException { setInputVersion(in, version); DataSerializable ds = null; if (null != aClass) { try { try { ds = (DataSerializable) aClass.newInstance(); } catch (InstantiationException e) { throw clarifyInstantiationException(aClass, e); } } catch (Exception e) { throw new HazelcastSerializationException("Requested class " + aClass + " could not be instantiated.", e); } } final byte header = in.readByte(); int id = 0; int factoryId = 0; String className = null; try { if (isFlagSet(header, IDS_FLAG)) { factoryId = in.readInt(); final DataSerializableFactory dsf = factories.get(factoryId); if (dsf == null) { throw new HazelcastSerializationException("No DataSerializerFactory registered for namespace: " + factoryId); } id = in.readInt(); if (null == aClass) { ds = dsf.create(id); if (ds == null) { throw new HazelcastSerializationException(dsf + " is not be able to create an instance for ID: " + id + " on factory ID: " + factoryId); } } } else { className = in.readUTF(); if (null == aClass) { try { ds = ClassLoaderUtil.newInstance(in.getClassLoader(), className); } catch (NoSuchMethodException e) { throw clarifyNoSuchMethodException(in.getClassLoader(), className, e); } } } if (isFlagSet(header, EE_FLAG)) { in.readByte(); in.readByte(); } ds.readData(in); return ds; } catch (Exception e) { throw rethrowReadException(id, factoryId, className, e); } }

Target:
private DataSerializable readInternal(ObjectDataInput in, Class aClass) throws IOException { setInputVersion(in, version); DataSerializable ds = null; if (null != aClass) { try { ds = (DataSerializable) aClass.newInstance(); } catch (Exception e) { e = tryClarifyInstantiationException(aClass, e); throw new HazelcastSerializationException("Requested class " + aClass + " could not be instantiated.", e); } } final byte header = in.readByte(); int id = 0; int factoryId = 0; String className = null; try { if (isFlagSet(header, IDS_FLAG)) { factoryId = in.readInt(); final DataSerializableFactory dsf = factories.get(factoryId); if (dsf == null) { throw new HazelcastSerializationException("No DataSerializerFactory registered for namespace: " + factoryId); } id = in.readInt(); if (null == aClass) { ds = dsf.create(id); if (ds == null) { throw new HazelcastSerializationException(dsf + " is not be able to create an instance for ID: " + id + " on factory ID: " + factoryId); } } } else { className = in.readUTF(); if (null == aClass) { ds = ClassLoaderUtil.newInstance(in.getClassLoader(), className); } } if (isFlagSet(header, EE_FLAG)) { in.readByte(); in.readByte(); } ds.readData(in); return ds; } catch (Exception e) { e = tryClarifyNoSuchMethodException(in.getClassLoader(), className, e); throw rethrowReadException(id, factoryId, className, e); } }
Source:
private static <T> Object toObject( T value, Function<T,Object>... converters) { return Stream.of( converters) .map( converter -> converter.apply( value)) .filter( object -> object != null) .findFirst() .orElse( null); }

Target:
private static <T> Object toObject( T value, Function<T,Object>... converters) { return Stream.of( converters) .map( converter -> converter.apply( value)) .filter( Objects::nonNull) .findFirst() .orElse( null); }
Source:
public static void getLoad(DSFSessionState sessionState, final IDMContext context, final DSFDebugModelListener listener, final Object arg, final RequestMonitor rm) { IGDBHardwareAndOS2 hwService = sessionState.getService(IGDBHardwareAndOS2.class); if (hwService == null) { return; } hwService.getLoadInfo(context, new ImmediateDataRequestMonitor<ILoadInfo>(rm) { @Override protected void handleSuccess() { ILoadInfo loadInfo = getData(); listener.getLoadDone(context, loadInfo, arg); rm.done(); } } ); }

Target:
public static void getLoad(DSFSessionState sessionState, final IDMContext context, final DSFDebugModelListener listener, final Object arg, final RequestMonitor rm) { IGDBHardwareAndOS2 hwService = sessionState.getService(IGDBHardwareAndOS2.class); if (hwService == null) { listener.getLoadDone(context, null, arg); rm.done(); return; } hwService.getLoadInfo(context, new ImmediateDataRequestMonitor<ILoadInfo>(rm) { @Override protected void handleCompleted() { listener.getLoadDone(context, getData(), arg); rm.done(); } } ); }
Source:
void unlockSubtree(final String path, final long ignoreStoInodeId) throws IOException { boolean failed = true; try{ unlockSubtreeInternal(path, ignoreStoInodeId); }catch(Exception e ){ setAsyncLockRemoval(path); throw e; } }

Target:
void unlockSubtree(final String path, final long ignoreStoInodeId) throws IOException { try{ unlockSubtreeInternal(path, ignoreStoInodeId); }catch(Exception e ){ setAsyncLockRemoval(path); throw e; } }
Source:
public void wrapVoidNoReindex (final VoidDelegate delegate) { final ThreadContext threadContext = UtilMethods.get(INSTANCE.getContext(), ()->new ThreadContext()); boolean reindex = threadContext.isReindex(); try { threadContext.setReindex(false); this.setContext(threadContext); delegate.execute(); } catch(Exception e) { throw new DotRuntimeException(e); } finally { threadContext.setReindex(reindex); } }

Target:
public static void wrapVoidNoReindex (final VoidDelegate delegate) { final ThreadContext threadContext = getOrCreateContext(); final boolean reindex = threadContext.isReindex(); try { threadContext.setReindex(false); delegate.execute(); } catch(Throwable e) { throw new DotRuntimeException(e); } finally { threadContext.setReindex(reindex); } }
Source:
public List<String> getNames() { return List.of(SUBMERGE_SUBS_VS_AIR_ONLY); }

Target:
public List<String> getNames() { return valid() ? List.of(SUBMERGE_SUBS_VS_AIR_ONLY) : List.of(); }
Source:
public Map<String, LocalFileIngestPlugin<?>> getDefaultLocalIngestPlugins() { final Map<String, LocalFileIngestPlugin<?>> retVal = new HashMap<>(getPluginProviderRegistry().size()); for (final Entry<String, IngestFormatPluginProviderSpi<?, ?>> e : getPluginProviderRegistry().entrySet()) { retVal.put( e.getKey(), e.getValue().createLocalFileIngestPlugin(e.getValue().createOptionsInstances())); } return retVal; }

Target:
public Map<String, LocalFileIngestPlugin<?>> getDefaultLocalIngestPlugins() { return getPluginProviderRegistry().entrySet().stream().collect( Collectors.toMap( Entry::getKey, e -> e.getValue().createLocalFileIngestPlugin(e.getValue().createOptionsInstances()))); }
Source:
Optional<MemorySegment> getUnconsumedSegment() throws IOException { final int position = lengthBuffer.position(); if (position > 0) { MemorySegment segment = MemorySegmentFactory.allocateUnpooledSegment(position); lengthBuffer.position(0); segment.put(0, lengthBuffer, position); return Optional.of(segment); } if (recordLength > THRESHOLD_FOR_SPILLING) { throw new UnsupportedOperationException("Unaligned checkpoint currently do not support spilled " + "records."); } else if (recordLength != -1) { int leftOverSize = leftOverData != null ? leftOverLimit - leftOverStart : 0; int unconsumedSize = Integer.BYTES + accumulatedRecordBytes + leftOverSize; DataOutputSerializer serializer = new DataOutputSerializer(unconsumedSize); serializer.writeInt(recordLength); serializer.write(buffer, 0, accumulatedRecordBytes); if (leftOverSize > 0) { serializer.write(leftOverData, leftOverStart, leftOverSize); } MemorySegment segment = MemorySegmentFactory.allocateUnpooledSegment(unconsumedSize); segment.put(0, serializer.getSharedBuffer(), 0, segment.size()); return Optional.of(segment); } return Optional.empty(); }

Target:
Optional<MemorySegment> getUnconsumedSegment() throws IOException { final int position = lengthBuffer.position(); if (position > 0) { MemorySegment segment = MemorySegmentFactory.allocateUnpooledSegment(position); lengthBuffer.position(0); segment.put(0, lengthBuffer, position); return Optional.of(segment); } if (recordLength > THRESHOLD_FOR_SPILLING) { throw new UnsupportedOperationException("Unaligned checkpoint currently do not support spilled " + "records."); } else if (recordLength != -1) { int leftOverSize = leftOverLimit - leftOverStart; int unconsumedSize = Integer.BYTES + accumulatedRecordBytes + leftOverSize; DataOutputSerializer serializer = new DataOutputSerializer(unconsumedSize); serializer.writeInt(recordLength); serializer.write(buffer, 0, accumulatedRecordBytes); if (leftOverData != null) { serializer.write(leftOverData, leftOverStart, leftOverSize); } MemorySegment segment = MemorySegmentFactory.allocateUnpooledSegment(unconsumedSize); segment.put(0, serializer.getSharedBuffer(), 0, segment.size()); return Optional.of(segment); } return Optional.empty(); }
Source:
private com.google.gerrit.common.data.AccountInfo setAccountFromChangeInfo(ChangeInfo changeInfo) { com.google.gerrit.common.data.AccountInfo accountInfo; Account account; account = new Account(new Account.Id(changeInfo.getOwner().getId())); account.setFullName(changeInfo.getOwner().getName()); account.setUserName(changeInfo.getOwner().getUsername()); account.setPreferredEmail(changeInfo.getOwner().getEmail()); accountInfo = new com.google.gerrit.common.data.AccountInfo(account); return accountInfo; }

Target:
private com.google.gerrit.common.data.AccountInfo setAccountFromChangeInfo(ChangeInfo changeInfo) { com.google.gerrit.common.data.AccountInfo accountInfo; Account account = new Account(new Account.Id(changeInfo.getOwner().getId())); account.setFullName(changeInfo.getOwner().getName()); account.setUserName(changeInfo.getOwner().getUsername()); account.setPreferredEmail(changeInfo.getOwner().getEmail()); return new com.google.gerrit.common.data.AccountInfo(account); }
Source:
@Override public boolean equals (Object o){ if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DataNode dataNode = (DataNode) o; if (port != dataNode.port) { return false; } return hostname.equals(dataNode.hostname); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DataNode dataNode = (DataNode) o; if (port != dataNode.port) { return false; } return hostname.equals(dataNode.hostname); }
Source:
private void validateNestedAttributes(ModelNode subModel, AttributeDefinition attr, String absoluteParentName) throws OperationFailedException { AttributeDefinition[] subAttrs = ((ObjectTypeAttributeDefinition) attr).getValueTypes(); for (AttributeDefinition subAttr : subAttrs) { String subAttributeName = subAttr.getName(); String absoluteName = absoluteParentName + "." + subAttributeName; if (!subModel.hasDefined(subAttributeName)) { continue; } if (subAttr.getRequires() != null) { for (final String required : subAttr.getRequires()) { if (!subModel.hasDefined(required)) { throw ControllerLogger.ROOT_LOGGER.requiredAttributeNotSet(absoluteParentName + "." + required, absoluteName); } } } if (!isAllowed(subAttr, subModel)) { String[] alts = subAttr.getAlternatives(); StringBuilder sb = null; if (alts != null) { for (String alt : alts) { if (subModel.hasDefined(alt)) { if (sb == null) { sb = new StringBuilder(); } else { sb.append(", "); } sb.append(absoluteParentName + "." + alt); } } } throw new OperationFailedException(ControllerLogger.ROOT_LOGGER.invalidAttributeCombo(absoluteName, sb)); } handleObjectAttributes(subModel, subAttr, absoluteName); } }

Target:
private void validateNestedAttributes(ModelNode subModel, AttributeDefinition attr, String absoluteParentName) throws OperationFailedException { if (!subModel.isDefined()) { return; } AttributeDefinition[] subAttrs = ((ObjectTypeAttributeDefinition) attr).getValueTypes(); for (AttributeDefinition subAttr : subAttrs) { String subAttributeName = subAttr.getName(); String absoluteName = absoluteParentName + "." + subAttributeName; if (!subModel.hasDefined(subAttributeName) && isRequired(subAttr, subModel)) { throw new OperationFailedException(ControllerLogger.ROOT_LOGGER.required(subAttributeName)); } if (!subModel.hasDefined(subAttributeName)) { continue; } if (subAttr.getRequires() != null) { for (final String required : subAttr.getRequires()) { if (!subModel.hasDefined(required)) { throw ControllerLogger.ROOT_LOGGER.requiredAttributeNotSet(absoluteParentName + "." + required, absoluteName); } } } if (!isAllowed(subAttr, subModel)) { String[] alts = subAttr.getAlternatives(); StringBuilder sb = null; if (alts != null) { for (String alt : alts) { if (subModel.hasDefined(alt)) { if (sb == null) { sb = new StringBuilder(); } else { sb.append(", "); } sb.append(absoluteParentName + "." + alt); } } } throw new OperationFailedException(ControllerLogger.ROOT_LOGGER.invalidAttributeCombo(absoluteName, sb)); } handleObjectAttributes(subModel, subAttr, absoluteName); } }
Source:
private void createBuilderTask(List<Task<? extends Serializable>> rootTasks, boolean shouldCreateAnotherLoadTask) { Task<DependencyCollectionWork> dependencyTask = TaskFactory.get(new DependencyCollectionWork(), conf); setupDependencyTask(rootTasks, dependencyTask); if (shouldCreateAnotherLoadTask) { Task<ReplLoadWork> loadTask = TaskFactory.get(work, conf); dependencyTask.addDependentTask(loadTask); } }

Target:
private void createBuilderTask(List<Task<? extends Serializable>> rootTasks, boolean shouldCreateAnotherLoadTask) { if (shouldCreateAnotherLoadTask) { Task<ReplLoadWork> loadTask = TaskFactory.get(work, conf); dependency(rootTasks, loadTask); } }
Source:
public static String serialize(IBuildpathEntry[] entries, boolean isSystemLibrary, Map<String, String> attributes) throws IOException { ByteArrayOutputStream s = new ByteArrayOutputStream(); OutputStreamWriter writer = new OutputStreamWriter(s, "UTF8"); XMLWriter xmlWriter = new XMLWriter(writer, null , true ); HashMap<String, String> library = new HashMap<String, String>(); library.put(TAG_VERSION, String.valueOf(CURRENT_VERSION)); library.put(TAG_SYSTEMLIBRARY, String.valueOf(isSystemLibrary)); if (attributes != null) { library.putAll(attributes); } xmlWriter.printTag(TAG_USERLIBRARY, library, true, true, false); for (int i = 0, length = entries.length; i < length; ++i) { BuildpathEntry cpEntry = (BuildpathEntry) entries[i]; HashMap<String, String> archive = new HashMap<String, String>(); archive.put(TAG_PATH, cpEntry.getPath().toString()); boolean hasExtraAttributes = cpEntry.extraAttributes != null && cpEntry.extraAttributes.length != 0; boolean hasRestrictions = cpEntry.getAccessRuleSet() != null; xmlWriter.printTag(TAG_ARCHIVE, archive, true, true, !(hasExtraAttributes || hasRestrictions)); if (hasExtraAttributes) { cpEntry.encodeExtraAttributes(xmlWriter, true, true); } if (hasRestrictions) { cpEntry.encodeAccessRules(xmlWriter, true, true); } if (hasExtraAttributes || hasRestrictions) { xmlWriter.endTag(TAG_ARCHIVE, true , true ); } } xmlWriter.endTag(TAG_USERLIBRARY, true , true ); writer.flush(); writer.close(); return s.toString("UTF8"); }

Target:
public static String serialize(IBuildpathEntry[] entries, boolean isSystemLibrary, Map<String, String> attributes) throws IOException { ByteArrayOutputStream s = new ByteArrayOutputStream(); OutputStreamWriter writer = new OutputStreamWriter(s, "UTF8"); XMLWriter xmlWriter = new XMLWriter(writer, null , true ); HashMap<String, String> library = new HashMap<String, String>(); library.put(TAG_VERSION, String.valueOf(CURRENT_VERSION)); library.put(TAG_SYSTEMLIBRARY, String.valueOf(isSystemLibrary)); if (attributes != null) { for (String key : attributes.keySet()) { library.put(ATTRIBUTE_PREFIX + key, attributes.get(key)); } } xmlWriter.printTag(TAG_USERLIBRARY, library, true, true, false); for (int i = 0, length = entries.length; i < length; ++i) { BuildpathEntry cpEntry = (BuildpathEntry) entries[i]; HashMap<String, String> archive = new HashMap<String, String>(); archive.put(TAG_PATH, cpEntry.getPath().toString()); boolean hasExtraAttributes = cpEntry.extraAttributes != null && cpEntry.extraAttributes.length != 0; boolean hasRestrictions = cpEntry.getAccessRuleSet() != null; xmlWriter.printTag(TAG_ARCHIVE, archive, true, true, !(hasExtraAttributes || hasRestrictions)); if (hasExtraAttributes) { cpEntry.encodeExtraAttributes(xmlWriter, true, true); } if (hasRestrictions) { cpEntry.encodeAccessRules(xmlWriter, true, true); } if (hasExtraAttributes || hasRestrictions) { xmlWriter.endTag(TAG_ARCHIVE, true , true ); } } xmlWriter.endTag(TAG_USERLIBRARY, true , true ); writer.flush(); writer.close(); return s.toString("UTF8"); }
Source:
public ValidatorFactory getValidatorFactory() { if (validatorFactory == null) { Configuration configuration = Validation.byDefaultProvider().configure(); Configuration<?> conf = configuration.traversableResolver(new IronJacamarTraversableResolver()); validatorFactory = new IronJacamarValidatorFactory(conf.buildValidatorFactory()); } return validatorFactory; }

Target:
public ValidatorFactory getValidatorFactory() { return validatorFactory; }
Source:
public AsyncRegionReplicaReplayRetryingCaller(HashedWheelTimer retryTimer, AsyncClusterConnectionImpl conn, int maxAttempts, long operationTimeoutNs, TableName tableName, byte[] encodedRegionName, byte[] row, List<Entry> entries, int replicaId) { super(retryTimer, conn, ConnectionUtils.getPriority(tableName), conn.connConf.getPauseNs(), conn.connConf.getPauseForCQTBENs(), maxAttempts, operationTimeoutNs, conn.connConf.getWriteRpcTimeoutNs(), conn.connConf.getStartLogErrorsCnt()); this.tableName = tableName; this.encodedRegionName = encodedRegionName; this.row = row; this.entries = entries.toArray(new Entry[0]); this.replicaId = replicaId; this.loc = null; }

Target:
public AsyncRegionReplicaReplayRetryingCaller(HashedWheelTimer retryTimer, AsyncClusterConnectionImpl conn, int maxAttempts, long operationTimeoutNs, TableName tableName, byte[] encodedRegionName, byte[] row, List<Entry> entries, int replicaId) { super(retryTimer, conn, ConnectionUtils.getPriority(tableName), conn.connConf.getPauseNs(), conn.connConf.getPauseForCQTBENs(), maxAttempts, operationTimeoutNs, conn.connConf.getWriteRpcTimeoutNs(), conn.connConf.getStartLogErrorsCnt()); this.tableName = tableName; this.encodedRegionName = encodedRegionName; this.row = row; this.entries = entries.toArray(new Entry[0]); this.replicaId = replicaId; }
Source:
public static Date parseFromSolrDate(String date) { SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.getDefault()); Date ret; try { ret = format.parse(date); return ret; } catch (ParseException e) { log.error(e.getMessage(), e); } return new Date(); }

Target:
public static Date parseFromSolrDate(String date) { SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss'Z'"); format.setTimeZone(TimeZone.getTimeZone("ZULU")); Date ret; try { ret = format.parse(date); return ret; } catch (ParseException e) { log.error(e.getMessage(), e); } return new Date(); }
Source:
public void getVersionsForProgram(ArtifactId program, boolean onlyActive, ProgramVersions progVer) { ArtifactId teamDefId = atsApi.getAttributeResolver().getSoleAttributeValue(program, AtsAttributeTypes.TeamDefinitionReference, ArtifactId.SENTINEL); if (teamDefId.isValid()) { TeamDefinition jaxTeamDef = atsApi.getConfigService().getConfigurations().getIdToTeamDef().get(teamDefId.getId()); if (jaxTeamDef != null) { progVer.setTeam(ArtifactToken.valueOf(jaxTeamDef.getId(), jaxTeamDef.getName(), atsApi.getAtsBranch())); for (Long versionId : jaxTeamDef.getVersions()) { JaxVersion version = atsApi.getConfigService().getConfigurations().getIdToVersion().get(versionId); boolean verActive = version.isActive(); if (onlyActive && !verActive) { continue; } progVer.addVersion(ArtifactToken.valueOf(version.getId(), version.getName(), atsApi.getAtsBranch())); } } } }

Target:
public void getVersionsForProgram(ArtifactId program, boolean onlyActive, ProgramVersions progVer) { ArtifactId teamDefId = atsApi.getAttributeResolver().getSoleAttributeValue(program, AtsAttributeTypes.TeamDefinitionReference, ArtifactId.SENTINEL); if (teamDefId.isValid()) { TeamDefinition teamDef = atsApi.getConfigService().getConfigurations().getIdToTeamDef().get(teamDefId.getId()); if (teamDef != null) { progVer.setTeam(ArtifactToken.valueOf(teamDef.getId(), teamDef.getName(), atsApi.getAtsBranch())); for (Long versionId : teamDef.getVersions()) { JaxVersion version = atsApi.getConfigService().getConfigurations().getIdToVersion().get(versionId); boolean verActive = version.isActive(); if (onlyActive && !verActive) { continue; } progVer.addVersion(ArtifactToken.valueOf(version.getId(), version.getName(), atsApi.getAtsBranch())); } } } }
Source:
public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.edit_profile) { router.showUserProfileEditor(getActivity(), username); return true; } else { return super.onOptionsItemSelected(item); } }

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.edit_profile: { router.showUserProfileEditor(getActivity(), username); return true; } default: { return super.onOptionsItemSelected(item); } } }
Source:
public boolean equals(Object o) { return (o == this) || ((o instanceof java.util.Set) && areEqual(delegate, (java.util.Set<?>) o)); }

Target:
public boolean equals(Object o) { return TODO(); }
Source:
public void addAggregate(ExpressionType aggType, boolean isDistinct, Integer aggOutputColumn, AbstractExpression aggInputExpr) { m_aggregateTypes.add(aggType); if (isDistinct) { m_aggregateDistinct.add(1); } else { m_aggregateDistinct.add(0); } m_aggregateOutputColumns.add(aggOutputColumn); if (aggType.isNullary()) { assert(aggInputExpr == null); m_aggregateExpressions.add(null); } else { assert(aggInputExpr != null); m_aggregateExpressions.add(aggInputExpr.clone()); } m_workerOrCoordinator.add("WORKER"); }

Target:
public void addAggregate(ExpressionType aggType, boolean isDistinct, Integer aggOutputColumn, AbstractExpression aggInputExpr) { m_aggregateTypes.add(aggType); if (isDistinct) { m_aggregateDistinct.add(1); } else { m_aggregateDistinct.add(0); } m_aggregateOutputColumns.add(aggOutputColumn); if (aggType.isNullary()) { assert(aggInputExpr == null); m_aggregateExpressions.add(null); } else { assert(aggInputExpr != null); m_aggregateExpressions.add(aggInputExpr.clone()); } m_isWorker.add(true); m_isPartition.add(true); }
Source:
public void start() { if (started) { LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor."); return; } LOG.info("Starting ContainerHeartbeatMonitor"); scheduler.scheduleAtFixedRate(() -> { ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat(); if (!response.isAlive()) { scheduler.schedule(() -> { LOG.error("Gracefully shutdown timeout expired. Force exiting."); System.exit(1); }, SHUTDOWN_TIMOUT_MS, TimeUnit.MILLISECONDS); onContainerExpired.run(); } }, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS); started = true; }

Target:
public void start() { if (started) { LOG.warn("Skipping attempt to start an already started ContainerHeartbeatMonitor."); return; } LOG.info("Starting ContainerHeartbeatMonitor"); scheduler.scheduleAtFixedRate(() -> { ContainerHeartbeatResponse response = containerHeartbeatClient.requestHeartbeat(); if (!response.isAlive()) { scheduler.schedule(() -> { LOG.error("Graceful shutdown timeout expired. Force exiting."); System.exit(1); }, SHUTDOWN_TIMOUT_MS, TimeUnit.MILLISECONDS); onContainerExpired.run(); } }, 0, SCHEDULE_MS, TimeUnit.MILLISECONDS); started = true; }
Source:
protected void onLoad() { super.onLoad(); if (!BrowseCap.isMacintosh()) return; Element parent = getElement().getParentElement().getParentElement(); NodeList<Element> children = DomUtils.querySelectorAll(parent, "div[style*='z-index: -1']"); for (int i = 0; i < children.getLength(); i++) { Element el = children.getItem(i); com.google.gwt.dom.client.Style style = el.getStyle(); boolean doesNotSparkJoy = style.getZIndex() == "-1" && style.getOverflow() == "scroll" && style.getVisibility() == "hidden"; if (doesNotSparkJoy) style.setOverflow(com.google.gwt.dom.client.Style.Overflow.HIDDEN); } children = DomUtils.querySelectorAll(parent, "div[style*='overflow:']"); for (int i = 0; i < children.getLength(); i++) { Element el = children.getItem(i); com.google.gwt.dom.client.Style style = el.getStyle(); style.setOverflowX(Overflow.HIDDEN); } }

Target:
protected void onLoad() { super.onLoad(); if (!BrowseCap.isMacintosh()) return; Element parent = getElement().getParentElement().getParentElement(); NodeList<Element> children = DomUtils.querySelectorAll(parent, "div[style*='overflow:']"); for (int i = 0; i < children.getLength(); i++) { Element el = children.getItem(i); com.google.gwt.dom.client.Style style = el.getStyle(); String overflow = style.getOverflow(); if (!StringUtil.isNullOrEmpty(overflow)) style.setOverflowX(Overflow.HIDDEN); } }
Source:
public void testUntrashChildren() { createDocuments(); trashService.trashDocument(doc1); trashService.trashDocument(fold); transactionalFeature.nextTransaction(); fold = session.getDocument(new IdRef(fold.getId())); doc1 = session.getDocument(new IdRef(doc1.getId())); doc2 = session.getDocument(new IdRef(doc2.getId())); assertTrue(fold.isTrashed()); assertTrue(doc1.isTrashed()); assertTrue(doc2.isTrashed()); assertTrue(trashService.isMangledName(fold.getName())); assertTrue(trashService.isMangledName(doc1.getName())); assertFalse(trashService.isMangledName(doc2.getName())); trashService.untrashDocument(fold); transactionalFeature.nextTransaction(); fold = session.getDocument(new IdRef(fold.getId())); doc1 = session.getDocument(new IdRef(doc1.getId())); doc2 = session.getDocument(new IdRef(doc2.getId())); assertFalse(fold.isTrashed()); assertFalse(doc1.isTrashed()); assertFalse(doc2.isTrashed()); assertFalse(trashService.isMangledName(fold.getName())); assertFalse(trashService.isMangledName(doc1.getName())); }

Target:
public void testUntrashChildren() { createDocuments(); trashService.trashDocument(doc1); trashService.trashDocument(fold); transactionalFeature.nextTransaction(); fold = session.getDocument(new IdRef(fold.getId())); doc1 = session.getDocument(new IdRef(doc1.getId())); doc2 = session.getDocument(new IdRef(doc2.getId())); assertTrue(fold.isTrashed()); assertTrue(doc1.isTrashed()); assertTrue(doc2.isTrashed()); assertTrue(trashService.isMangledName(fold.getName())); assertTrue(trashService.isMangledName(doc1.getName())); assertFalse(trashService.isMangledName(doc2.getName())); trashService.untrashDocument(fold); transactionalFeature.nextTransaction(); fold = session.getDocument(new IdRef(fold.getId())); doc1 = session.getDocument(new IdRef(doc1.getId())); doc2 = session.getDocument(new IdRef(doc2.getId())); assertFalse(fold.isTrashed()); assertFalse(doc1.isTrashed()); assertFalse(doc2.isTrashed()); assertFalse(trashService.isMangledName(fold.getName())); assertFalse(trashService.isMangledName(doc1.getName())); assertFalse(trashService.isMangledName(doc2.getName())); }
Source:
private File findFile( String targetFile, File directory ) { File foundFile = null; boolean didFindFile = false; for ( File file : directory.listFiles() ) { if ( file.getName().equals( targetFile ) ) { foundFile = file; didFindFile = true; break; } } if ( !didFindFile ) { fail( "Could not find file " + targetFile ); } return foundFile; }

Target:
private File findFile( String targetFile, File directory ) { File file = new File( directory, targetFile ); if ( !file.exists() ) { fail( "Could not find file " + targetFile ); } return file; }
Source:
void onMessage(final Session session, final String message) { final MessageEnvelope envelope = GSON.fromJson(message, MessageEnvelope.class); messageListeners.stream() .filter( messageListener -> messageListener.messageType.getMessageTypeId().equals(envelope.getMessageTypeId())) .map(messageListener -> messageListener.messageType) .findAny() .ifPresent( messageType -> { final WebSocketMessage payload = (WebSocketMessage) envelope.getPayload(messageType.getPayloadType()); messageListeners.stream() .filter( messageListener -> messageListener .messageType .getMessageTypeId() .equals(envelope.getMessageTypeId())) .forEach( messageListener -> messageListener.listener.accept( WebSocketMessageContext.builder() .messagingBus(this) .senderSession(session) .message(payload) .build())); }); }

Target:
void onMessage(final Session session, final String message) { final MessageEnvelope envelope = GSON.fromJson(message, MessageEnvelope.class); determineMatchingMessageType(envelope) .ifPresent( messageType -> { final WebSocketMessage payload = envelope.getPayload(messageType.getPayloadType()); getListenersForMessageTypeId(envelope.getMessageTypeId()) .forEach( messageListener -> messageListener.listener.accept( WebSocketMessageContext.builder() .messagingBus(this) .senderSession(session) .message(payload) .build())); }); }
Source:
public void startService(Listener<T> listener) { recomputeNumBuckets(); bucketSlidingTimer = new Timer(); endOfBuckets = expiryPoint + (noOfBuckets * bucketSpan) - 1; logger.debug("bucket properties {}, {}", expiryPeriod, bucketSpan); logger.debug("bucket time params: start {}, expiry {}, end {}", startOfBuckets, expiryPoint, endOfBuckets); super.startService(listener); }

Target:
public void startService(Listener<T> listener) { recomputeNumBuckets(); bucketSlidingTimer = new Timer(); endOfBuckets = expiryPoint + expiryPeriod -1; logger.debug("bucket properties {}, {}", expiryPeriod, bucketSpan); logger.debug("bucket time params: start {}, expiry {}, end {}", startOfBuckets, expiryPoint, endOfBuckets); bucketSlidingTimer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { try { ((BucketStore.ExpirableBucketStore<T>) bucketStore).deleteExpiredBuckets(expiryPoint); } catch (IOException e) { throw new RuntimeException(e); } } }, cleanupTimeInMillis, cleanupTimeInMillis); super.startService(listener); }
Source:
public void testInvalidSinkSemantic() { ObjectIdentifier objectIdentifier = ObjectIdentifier.of( "default", "default", "sinkTable"); final Map<String, String> modifiedOptions = getModifiedOptions( getFullSinkOptions(), options -> { options.put("sink.semantic", "exactly-once"); }); final CatalogTable sinkTable = createKafkaSinkCatalogTable(modifiedOptions); thrown.expect(ValidationException.class); FactoryUtil.createTableSink( null, objectIdentifier, sinkTable, new Configuration(), Thread.currentThread().getContextClassLoader()); }

Target:
public void testInvalidSinkSemantic() { ObjectIdentifier objectIdentifier = ObjectIdentifier.of( "default", "default", "sinkTable"); final Map<String, String> modifiedOptions = getModifiedOptions( getFullSinkOptions(), options -> { options.put("sink.semantic", "exactly-once"); }); final CatalogTable sinkTable = createKafkaSinkCatalogTable(modifiedOptions); try { FactoryUtil.createTableSink( null, objectIdentifier, sinkTable, new Configuration(), Thread.currentThread().getContextClassLoader()); fail("Connector 'kafka-0.10' doesn't support 'sink.semantic'"); } catch (Exception e) { assertTrue(ExceptionUtils .findThrowableWithMessage(e, "Unsupported options:\n\nsink.semantic") .isPresent()); } }
Source:
public byte[] getContentAsBytes() { if (!hasContent()) { return new byte[0]; } try { InputStream is = getContent(); byte[] bytes = getBytes(is); if (bytes.length > 0 && isGzipped(getEncoding())) { is = new GZIPInputStream(new ByteArrayInputStream(bytes)); return getBytes(is); } return bytes; } catch (IOException e2) { throw new UnirestException(e2); } finally { EntityUtils.consumeQuietly(r.getEntity()); } }

Target:
public byte[] getContentAsBytes() { if (!hasContent()) { return new byte[0]; } try { InputStream is = getContent(); if (is.available() > 0 && isGzipped(getEncoding())) { is = new GZIPInputStream(getContent()); } return getBytes(is); } catch (IOException e2) { throw new UnirestException(e2); } finally { EntityUtils.consumeQuietly(r.getEntity()); } }
Source:
public Player(int x, int y, int id) { Random random = new Random(System.currentTimeMillis()); maxHitPoints = random.nextInt(11) + 10; curHitPoints = maxHitPoints/3; attackPower = random.nextInt(10) + 1; this.xPos = x; this.yPos = y; this.unitId = id; }

Target:
public Player(int x, int y, int id) { Random random = new Random(System.currentTimeMillis()); maxHitPoints = random.nextInt(11) + 10; curHitPoints = maxHitPoints; attackPower = random.nextInt(10) + 1; this.xPos = x; this.yPos = y; this.unitId = id; }
Source:
default void inputDetail() { or(mandatory(host().id()), mandatory(host().name())); }

Target:
default void inputDetail() { or(mandatory(storageDomain().id()), mandatory(storageDomain().name())); or(optional(disk().name()), optional(disk().alias())); }
Source:
private PathElement resolvePathAttribute(Class<?> entityClass, EntityDictionary dictionary, String fieldName) { Class<?> attributeClass = null; if (dictionary.isAttribute(entityClass, fieldName) || fieldName.equals(dictionary.getIdFieldName(entityClass))) { attributeClass = dictionary.getType(entityClass, fieldName); } return new PathElement(entityClass, attributeClass, fieldName); }

Target:
private PathElement resolvePathAttribute(Class<?> entityClass, EntityDictionary dictionary, String fieldName) { Class<?> attributeClass = Object.class; if (dictionary.isAttribute(entityClass, fieldName) || fieldName.equals(dictionary.getIdFieldName(entityClass))) { attributeClass = dictionary.getType(entityClass, fieldName); } return new PathElement(entityClass, attributeClass, fieldName); }
Source:
public void destroy() { LOG.info("===================="); LOG.info("Destroyed CountBean"); LOG.info("===================="); TestResultsBean.setPreDestroySessionScoped(true); }

Target:
public void destroy() { LOG.info("Destroyed CountBean"); TestResultsBean.setPreDestroySessionScoped(true); }
Source:
ClientOperation(int code) { this.code = code; notification = false; }

Target:
ClientOperation(int code) { this(code, false); }
Source:
public static String getEntryContentAsString(File file, String entryName) throws IOException { InputStream resultStream = getEntryContentAsStream(file, entryName); return IOUtils.toString(resultStream, Charsets.UTF_8); }

Target:
public static String getEntryContentAsString(File file, String entryName) throws IOException { try (InputStream resultStream = getEntryContentAsStream(file, entryName)) { return IOUtils.toString(resultStream, Charsets.UTF_8); } }
Source:
private String makeSslErrorPage() { final String warningMsg = getString(R.string.ssl_error_warning); final String exampleMsg = getString(R.string.ssl_error_example); final String continueMsg = getString(R.string.ssl_error_continue); final String certificateMsg = getString(R.string.ssl_error_view_certificate); return String.join("\n", makeHtmlTag(), "<head>", " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">", " <style>", " body {", " background-color:#fafafa;", " margin:auto;", " width:80%;", " margin-top: 96px", " }", " img {", " height:48px;", " width:48px;", " }", " div.warn {", " font-size:" + sp(16) + ";", " line-height:1.28;", " margin-top:16px;", " opacity:0.87;", " }", " div.example, div.vpnwarning {", " font-size:" + sp(14) + ";", " line-height:1.21905;", " margin-top:16px;", " opacity:0.54;", " }", " a {", " color:#4285F4;", " display:inline-block;", " font-size:" + sp(14) + ";", " font-weight:bold;", " height:48px;", " margin-top:24px;", " text-decoration:none;", " text-transform:uppercase;", " }", " a.certificate {", " margin-top:0px;", " }", " </style>", "</head>", "<body>", " <p><img src=quantum_ic_warning_amber_96.png><br>", " <div class=warn>" + warningMsg + "</div>", " <div class=example>" + exampleMsg + "</div>", getVpnMsgOrLinkToBrowser(), " <a class=certificate href=" + mCertificateOutToken + ">" + certificateMsg + "</a>", "</body>", "</html>"); }

Target:
private String makeSslErrorPage() { final String warningMsg = getString(R.string.ssl_error_warning); final String exampleMsg = getString(R.string.ssl_error_example); final String certificateMsg = getString(R.string.ssl_error_view_certificate); return String.join("\n", makeHtmlTag(), "<head>", " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">", " <style>", " body {", " background-color:#fafafa;", " margin:auto;", " width:80%;", " margin-top: 96px", " }", " img {", " height:48px;", " width:48px;", " }", " div.warn {", " font-size:" + sp(16) + ";", " line-height:1.28;", " margin-top:16px;", " opacity:0.87;", " }", " div.example, div.vpnwarning {", " font-size:" + sp(14) + ";", " line-height:1.21905;", " margin-top:16px;", " opacity:0.54;", " }", " a {", " color:#4285F4;", " display:inline-block;", " font-size:" + sp(14) + ";", " font-weight:bold;", " height:48px;", " margin-top:24px;", " text-decoration:none;", " text-transform:uppercase;", " }", " a.certificate {", " margin-top:0px;", " }", " </style>", "</head>", "<body>", " <p><img src=quantum_ic_warning_amber_96.png><br>", " <div class=warn>" + warningMsg + "</div>", " <div class=example>" + exampleMsg + "</div>", getVpnMsgOrLinkToBrowser(), " <a class=certificate href=" + mCertificateOutToken + ">" + certificateMsg + "</a>", "</body>", "</html>"); }
Source:
private void setRuntimeProperties(ExecutionParameters executionParameters, ExecutionOptions executionOptions) { if (executionParameters.getProperties().size() == 0) { return; } if(executionParameters.getProperties().size() > 1 || !executionParameters.getProperties().containsKey("root")) { logger.error("Attempt to overwrite properties of nodes other than the root flow detected: " + executionParameters.getProperties()); throw new CloudFlowException("Overwriting properties of jobs or nested flows is not " + "yet supported."); } Map<String, String> runtimeProps = executionParameters.getProperties().get("root"); if(runtimeProps.containsKey(CommonJobProperties.FAILURE_EMAILS)) { String rawEmails = runtimeProps.get(CommonJobProperties.FAILURE_EMAILS); if (!rawEmails.isEmpty()) { String[] emails = rawEmails.split("\\s*,\\s*|\\s*;\\s*|\\s+"); executionOptions.setFailureEmails(Arrays.asList(emails)); executionOptions.setFailureEmailsOverridden(true); } runtimeProps.remove(CommonJobProperties.FAILURE_EMAILS); } if(runtimeProps.containsKey(CommonJobProperties.SUCCESS_EMAILS)) { String rawEmails = runtimeProps.get(CommonJobProperties.SUCCESS_EMAILS); if (!rawEmails.isEmpty()) { String[] emails = rawEmails.split("\\s*,\\s*|\\s*;\\s*|\\s+"); executionOptions.setSuccessEmails((Arrays.asList(emails))); executionOptions.setSuccessEmailsOverridden(true); } runtimeProps.remove(CommonJobProperties.SUCCESS_EMAILS); } executionOptions.addAllFlowParameters(runtimeProps); }

Target:
private void setRuntimeProperties(ExecutionParameters executionParameters, ExecutionOptions executionOptions) { if (executionParameters.getProperties().size() == 0) { return; } if(executionParameters.getProperties().size() > 1 || !executionParameters.getProperties().containsKey(RUNTIME_PROPERTIES_ROOT_FLOW_KEYWORD)) { logger.error("Attempt to overwrite properties of nodes other than the root flow detected: " + executionParameters.getProperties()); throw new CloudFlowNotImplementedException("Overwriting properties of jobs or nested flows is not " + "yet supported."); } Map<String, Object> runtimeProps = executionParameters.getProperties() .get(RUNTIME_PROPERTIES_ROOT_FLOW_KEYWORD); if(runtimeProps.containsKey(CommonJobProperties.FAILURE_EMAILS)) { Object propValue = runtimeProps.get(CommonJobProperties.FAILURE_EMAILS); List<String> emails = getNotificationEmails(propValue); executionOptions.setFailureEmails(emails); executionOptions.setFailureEmailsOverridden(true); runtimeProps.remove(CommonJobProperties.FAILURE_EMAILS); } if(runtimeProps.containsKey(CommonJobProperties.SUCCESS_EMAILS)) { Object propValue = runtimeProps.get(CommonJobProperties.SUCCESS_EMAILS); List<String> emails = getNotificationEmails(propValue); executionOptions.setSuccessEmails(emails); executionOptions.setSuccessEmailsOverridden(true); runtimeProps.remove(CommonJobProperties.SUCCESS_EMAILS); } Map<String,String> azRuntimeProps = runtimeProps.entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().toString())); executionOptions.addAllFlowParameters(azRuntimeProps); }
Source:
public void testUnreadableDictionary() throws IOException { final Path liftOutput = Files.createTempFile("tmpouput", ".vcf"); liftOutput.toFile().deleteOnExit(); final Path rejectOutput = Files.createTempFile("tmpreject", ".vcf"); rejectOutput.toFile().deleteOnExit(); final Path input = TEST_DATA_PATH.toPath().resolve("testLiftoverBiallelicIndels.vcf"); final String[] args = new String[]{ "INPUT=" + input.toString(), "OUTPUT=" + liftOutput.toString(), "REJECT=" + rejectOutput.toString(), "CHAIN=" + CHAIN_FILE, "REFERENCE_SEQUENCE=" + REFERENCE_FILE, }; final Path dictionary = REFERENCE_FILE.toPath().resolveSibling(REFERENCE_FILE.getName().replace("fasta", "dict")); dictionary.toFile().setReadable(false); try { runPicardCommandLine(args); } finally { dictionary.toFile().setReadable(true); } }

Target:
public void testUnreadableDictionary() throws IOException { final Path liftOutput = Files.createTempFile("tmpouput", ".vcf"); liftOutput.toFile().deleteOnExit(); final Path rejectOutput = Files.createTempFile("tmpreject", ".vcf"); rejectOutput.toFile().deleteOnExit(); final Path input = TEST_DATA_PATH.toPath().resolve("testLiftoverBiallelicIndels.vcf"); final Path tmpCopyDir = Files.createTempDirectory("copy"); tmpCopyDir.toFile().deleteOnExit(); final Path referenceCopy = tmpCopyDir.resolve("refCopy.fasta"); referenceCopy.toFile().deleteOnExit(); Files.copy(REFERENCE_FILE.toPath(), referenceCopy); final Path dictCopy = referenceCopy.resolveSibling(referenceCopy.toFile().getName().replaceAll("fasta$", "dict")); dictCopy.toFile().deleteOnExit(); final Path dictionary = REFERENCE_FILE.toPath().resolveSibling(REFERENCE_FILE.getName().replaceAll("fasta$", "dict")); Files.copy(dictionary, dictCopy); dictCopy.toFile().setReadable(false); final String[] args = new String[]{ "INPUT=" + input, "OUTPUT=" + liftOutput, "REJECT=" + rejectOutput, "CHAIN=" + CHAIN_FILE, "REFERENCE_SEQUENCE=" + referenceCopy, }; runPicardCommandLine(args); }
Source:
private String toE164(String input) { if (input.startsWith("+")) return input; if (prefixEntry != null) { if (prefixEntry.international_prefix_pattern.length() > 0) { Matcher m = Pattern.compile(prefixEntry.international_prefix_pattern).matcher(input); if (m.lookingAt()) return "+" + m.replaceFirst(""); } if (prefixEntry.national_prefix.length() > 0 && input.startsWith(prefixEntry.national_prefix)) { return "+" + prefixEntry.ptsn_country_code + input.substring(prefixEntry.national_prefix.length()); } } return input; }

Target:
private String toE164(String input) { if (input.startsWith("+")) return input; if (prefixEntry != null) { if (internationalPrefixPattern != null) { Matcher m = internationalPrefixPattern.matcher(input); if (m.lookingAt()) return "+" + m.replaceFirst(""); } if (prefixEntry.national_prefix.length() > 0 && input.startsWith(prefixEntry.national_prefix)) { return "+" + prefixEntry.ptsn_country_code + input.substring(prefixEntry.national_prefix.length()); } } return input; }
Source:
public synchronized DataCenter getDataCenterById(String id) { DataCenter dataCenter = null; if (dataCenterMap.containsKey(id)) { return dataCenterMap.get(id); } try{ dataCenter = (DataCenter) loadObject(DataCenter.class, id); if (dataCenter == null){ dataCenter = new DataCenter(); dataCenter.setId(id); updateDataCenter(dataCenter); } else { log.info("Data center restored from file, id: {}", id); } } catch (RuntimeException e){ log.error("failed to load dataCenter object"); return dataCenter; } dataCenterMap.put(id, dataCenter); return dataCenter; }

Target:
public synchronized DataCenter getDataCenterById(String id) { DataCenter dataCenter = null; if (dataCenterMap.containsKey(id)) { return dataCenterMap.get(id); } try { dataCenter = loadObject(DataCenter.class, id) != null ? (DataCenter) loadObject(DataCenter.class, id) : reInitializeDataCenter(id); } catch (NullPointerException e) { log.error("failed to fetch datacenter by id, rewrite caches for DC {}", id); } finally { log.info("about to store DC: id object {}", id, dataCenter); dataCenterMap.put(id, dataCenter); } return dataCenter; }
Source:
public void testFormattedAmountFranceAndJPY() throws Exception { final FixedPriceInvoiceItem fixedItem = new FixedPriceInvoiceItem(UUID.randomUUID(), UUID.randomUUID(), null, null, UUID.randomUUID().toString(), UUID.randomUUID().toString(), new LocalDate(), new BigDecimal("1500.00"), Currency.JPY); final Invoice invoiceEUR = new DefaultInvoice(UUID.randomUUID(), new LocalDate(), new LocalDate(), Currency.JPY); invoiceEUR.addInvoiceItem(fixedItem); checkOutput(invoiceEUR, "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedChargedAmount}}</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedPaidAmount}}</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedBalance}}</strong></td>\n" + "</tr>", "<tr>\n" + " <td class=\"amount\"><strong>1 500,00 ￥</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>0,00 ￥</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>1 500,00 ￥</strong></td>\n" + "</tr>", Locale.FRANCE); }

Target:
public void testFormattedAmountFranceAndJPY() throws Exception { final FixedPriceInvoiceItem fixedItem = new FixedPriceInvoiceItem(UUID.randomUUID(), UUID.randomUUID(), null, null, UUID.randomUUID().toString(), UUID.randomUUID().toString(), new LocalDate(), new BigDecimal("1500.00"), Currency.JPY); final Invoice invoice = new DefaultInvoice(UUID.randomUUID(), new LocalDate(), new LocalDate(), Currency.JPY); invoice.addInvoiceItem(fixedItem); checkOutput(invoice, "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedChargedAmount}}</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedPaidAmount}}</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>{{invoice.formattedBalance}}</strong></td>\n" + "</tr>", "<tr>\n" + " <td class=\"amount\"><strong>1 500 ￥</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>0 ￥</strong></td>\n" + "</tr>\n" + "<tr>\n" + " <td class=\"amount\"><strong>1 500 ￥</strong></td>\n" + "</tr>", Locale.FRANCE); }
Source:
public void activate_subscription() { final BoundedContext boundedContext = setupBoundedContextForAggregateRepo(); final SubscriptionService subscriptionService = SubscriptionService.newBuilder() .addBoundedContext(boundedContext) .build(); final String type = boundedContext.getStand() .getAvailableTypes() .iterator() .next() .getTypeName(); final Target target = Target.newBuilder() .setType(type) .setIncludeAll(true) .build(); final Topic topic = Topic.newBuilder() .setTarget(target) .build(); final MemoizeStreamObserver<Subscription> subscriptionObserver = new MemoizeStreamObserver<>(); subscriptionService.subscribe(topic, subscriptionObserver); subscriptionObserver.checkFields(); final MemoizeStreamObserver<SubscriptionUpdate> activationObserver = new MemoizeStreamObserver<>(); subscriptionService.activate(subscriptionObserver.streamFlowValue, activationObserver); final ProjectId projectId = ProjectId.newBuilder().setId("some-id").build(); final Message projectState = Project.newBuilder().setId(projectId).build(); boundedContext.getStand().update(projectId, AnyPacker.pack(projectState)); activationObserver.checkFields(false); }

Target:
public void activate_subscription() { final BoundedContext boundedContext = setupBoundedContextForAggregateRepo(); final SubscriptionService subscriptionService = SubscriptionService.newBuilder() .addBoundedContext(boundedContext) .build(); final Target target = getProjectQueryTarget(); final Topic topic = Topic.newBuilder() .setTarget(target) .build(); final MemoizeStreamObserver<Subscription> subscriptionObserver = new MemoizeStreamObserver<>(); subscriptionService.subscribe(topic, subscriptionObserver); subscriptionObserver.verifyState(); final MemoizeStreamObserver<SubscriptionUpdate> activationObserver = new MemoizeStreamObserver<>(); subscriptionService.activate(subscriptionObserver.streamFlowValue, activationObserver); final ProjectId projectId = ProjectId.newBuilder().setId("some-id").build(); final Message projectState = Project.newBuilder().setId(projectId).build(); boundedContext.getStand().update(projectId, AnyPacker.pack(projectState)); activationObserver.verifyState(false); }
Source:
public ReferencePointManager() { referencePointToProjectMapper = new HashMap<IReferencePoint, IFolder>(); }

Target:
public ReferencePointManager() { referencePointToProjectMapper = new ConcurrentHashMap<IReferencePoint, IFolder>(); }