auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Adapter getContentAdapter() { if <START> (adapter == null) { <END> adapter = new AdapterImpl() { @Override public void notifyChanged(final Notification notification) { int type = notification.getEventType(); switch (type) { case Notification.ADD: case Notification.ADD_MANY: case Notification.REMOVE: case Notification.REMOVE_MANY: refreshChildren(); break; case Notification.SET: break; } } }; } return adapter; }</code><technical_language>null == adapter</technical_language>

Target:
public Adapter getContentAdapter() { if (null == adapter) { adapter = new AdapterImpl() { @Override public void notifyChanged(final Notification notification) { int type = notification.getEventType(); switch (type) { case Notification.ADD: case Notification.ADD_MANY: case Notification.REMOVE: case Notification.REMOVE_MANY: refreshChildren(); break; case Notification.SET: break; } } }; } return adapter; }
Source:
<code>public static List<Class<?>> getSuperInterfaces(Class clazz) { <START> ArrayList<Class<?>> result = new ArrayList<Class<?>>(); <END> addImplementedSuperInterfaces(clazz, result); return result; }</code><technical_language>able diamond operator here, i.e. new ArrayList<>()</technical_language>

Target:
public static List<Class<?>> getSuperInterfaces(Class clazz) { ArrayList<Class<?>> result = new ArrayList<>(); addImplementedSuperInterfaces(clazz, result); return result; }
Source:
<code>private <START> Object getVmsFullInfoFromExternalProvider() <END> { try { return runVdsCommand(VDSCommandType.GetVmsFullInfoFromExternalProvider, buildGetRemoteVmsInfoParameters()).getReturnValue(); } catch (RuntimeException e) { if (!(e instanceof IllegalArgumentException)) { logFailureToGetVms(); } throw e; } }</code><technical_language>object? lets change time expect receive catch potential failures</technical_language>

Target:
private void getVmsFullInfoFromExternalProvider() { try { setReturnValue(runVdsCommand(VDSCommandType.GetVmsFullInfoFromExternalProvider, buildGetRemoteVmsInfoParameters()).getReturnValue()); } catch (RuntimeException e) { if (!(e instanceof IllegalArgumentException)) { logFailureToGetVms(); } throw e; } }
Source:
<code>public SChannelInput(final SynchronousQueue<Object> cell, final SChannel channel) { this.cell = cell; this.channel = channel; <START> if (VmSettings.ACTOR_TRACING | VmSettings.REPLAY) { <END> numReads = new AtomicInteger(0); } else { numReads = null; } }</code><technical_language>Single double pipe</technical_language>

Target:
public SChannelInput(final SynchronousQueue<Object> cell, final SChannel channel) { this.cell = cell; this.channel = channel; }
Source:
<code>public JsonElement serialize(Predicate src, Type typeOfSrc, JsonSerializationContext context) { if (src == null) return null; if (src instanceof StatePredicate) { JsonElement clause = gson.toJsonTree( ((StatePredicate) src).getCondition().getClause(), TriggerClause.class); JsonObject json = new JsonObject(); json.add("condition", clause); json.addProperty("triggersWhen", ((StatePredicate) src).getTriggersWhen().name()); json.addProperty("eventSource", src.getEventSource().name()); return json; <START> }else { <END> JsonObject ret = gson.toJsonTree(src).getAsJsonObject(); ret.addProperty("eventSource", src.getEventSource().name()); return ret; } }</code><technical_language>This is trivial cosmetic issue add space front of else? :)</technical_language>

Target:
public JsonElement serialize(Predicate src, Type typeOfSrc, JsonSerializationContext context) { if (src == null) return null; if (src instanceof StatePredicate) { JsonElement clause = gson.toJsonTree( ((StatePredicate) src).getCondition().getClause(), TriggerClause.class); JsonObject ret = new JsonObject(); ret.add("condition", clause); ret.addProperty("triggersWhen", ((StatePredicate) src).getTriggersWhen().name()); ret.addProperty("eventSource", src.getEventSource().name()); return ret; } else { JsonObject ret = gson.toJsonTree(src).getAsJsonObject(); ret.addProperty("eventSource", src.getEventSource().name()); return ret; } }
Source:
<code>protected int run() throws Exception { boolean errorOccurred = false; final HashSet<String> hs = new HashSet<String>(); hs.addAll(views); ViewOptionHandler voh = new ViewOptionHandler(null, null, null); for(String view_s : hs) { View view = null; try { try { view = voh.getView(view_s); <START> view.checkPermission(View.DELETE); <END> } catch (Exception e) { stderr.println(e.getMessage()); errorOccurred = true; continue; } ViewGroup group = view.getOwner(); if (!group.canDelete(view)) { stderr.format("%s does not allow to delete '%s' view\n", group.getDisplayName(), view.getViewName() ); errorOccurred = true; continue; } group.deleteView(view); } catch (Exception e) { stderr.format("Unexpected exception occurred during deletion of view '%s': %s\n", view == null ? "(null)" : view.getViewName(), e.getMessage() ); errorOccurred = true; continue; } } return errorOccurred ? -1 : 0; }</code><technical_language>a View::hasPermission() method</technical_language>

Target:
protected int run() throws Exception { boolean errorOccurred = false; final HashSet<String> hs = new HashSet<String>(); hs.addAll(views); ViewOptionHandler voh = new ViewOptionHandler(null, null, null); for(String view_s : hs) { View view = null; try { try { view = voh.getView(view_s); if (view == null) { stderr.println("user is missing the View/Read permission"); errorOccurred = true; continue; } view.checkPermission(View.DELETE); } catch (Exception e) { stderr.println(e.getMessage()); errorOccurred = true; continue; } ViewGroup group = view.getOwner(); if (!group.canDelete(view)) { stderr.format("%s does not allow to delete '%s' view\n", group.getDisplayName(), view.getViewName() ); errorOccurred = true; continue; } group.deleteView(view); } catch (Exception e) { final String errorMsg = String.format("Unexpected exception occurred during deletion of view '%s': %s", view == null ? "(null)" : view.getViewName(), e.getMessage()); stderr.println(errorMsg); LOGGER.warning(errorMsg); errorOccurred = true; continue; } } return errorOccurred ? -1 : 0; }
Source:
<code>public void fillHalfRecords(final ContextAccumulator fullContextAccumulator, final int contextSize) { final String padding = StringUtil.repeatCharNTimes('N', contextSize); for (Map.Entry<String,AlignmentAccumulator[]> fullContext : fullContextAccumulator.artifactMap.entrySet()) { final String context = fullContext.getKey(); final char centralBase = context.charAt(contextSize); final String leadingKey = context.substring(0, contextSize) + centralBase + padding; final String trailingKey = padding + centralBase + context.substring(contextSize + 1, context.length()); final AlignmentAccumulator[] trailingAlignmentAccumulators = this.artifactMap.get(trailingKey); final AlignmentAccumulator[] leadingAlignmentAccumulators = this.artifactMap.get(leadingKey); final AlignmentAccumulator[] fullAlignmentAccumulators = fullContext.getValue(); for (int i=0; i < fullAlignmentAccumulators.length; i++) { <START> trailingAlignmentAccumulators[i].mergeCounts(fullContext.getValue()[i]); <END> leadingAlignmentAccumulators[i].mergeCounts(fullContext.getValue()[i]); } } }</code><technical_language>fullContext.getValue() here. fullAlignmentAccumulators</technical_language>

Target:
public void fillHalfRecords(final ContextAccumulator fullContextAccumulator, final int contextSize) { final String padding = StringUtil.repeatCharNTimes('N', contextSize); for (Map.Entry<String,AlignmentAccumulator[]> fullContext : fullContextAccumulator.artifactMap.entrySet()) { final String fullContextKey = fullContext.getKey(); final char centralBase = fullContextKey.charAt(contextSize); final String leadingContextKey = fullContextKey.substring(0, contextSize) + centralBase + padding; final String trailingContextKey = padding + centralBase + fullContextKey.substring(contextSize + 1, fullContextKey.length()); final AlignmentAccumulator[] trailingAlignmentAccumulators = this.artifactMap.get(trailingContextKey); final AlignmentAccumulator[] leadingAlignmentAccumulators = this.artifactMap.get(leadingContextKey); final AlignmentAccumulator[] fullAlignmentAccumulators = fullContext.getValue(); for (int i=0; i < fullAlignmentAccumulators.length; i++) { trailingAlignmentAccumulators[i].merge(fullAlignmentAccumulators[i]); leadingAlignmentAccumulators[i].merge(fullAlignmentAccumulators[i]); } } }
Source:
<code>public static List<CqlIdentifier> wrap( @NonNull Iterable<String> in, @NonNull Function<String, CqlIdentifier> fn) { Preconditions.checkNotNull(in, "Input Iterable must not be null"); Preconditions.checkNotNull(fn, "CqlIdentifier conversion function must not be null"); <START> ImmutableList.Builder<CqlIdentifier> out = ImmutableList.builder(); <END> for (String name : in) { out.add(fn.apply(name)); } return out.build(); }</code><technical_language>I consistent result of apply fn.apply(name) checked Preconditions.checkNotNull is needed</technical_language>

Target:
private static List<CqlIdentifier> wrap( @NonNull Iterable<String> in, @NonNull Function<String, CqlIdentifier> fn) { Objects.requireNonNull(in, "Input Iterable must not be null"); Objects.requireNonNull(fn, "CqlIdentifier conversion function must not be null"); ImmutableList.Builder<CqlIdentifier> builder = ImmutableList.<CqlIdentifier>builder(); for (String name : in) { builder.add(fn.apply(name)); } return builder.build(); }
Source:
<code>private int getDistanceUntilEdge(Location location, BlockFace face) { Location destLoc = location.clone(); <START> int i; <END> for (i = 0; i < 22; ++i) { destLoc.add(face.getModX(), face.getModY(), face.getModZ()); if (!canBuildThrough(destLoc.getBlock().getType()) || downImmutable(destLoc).getBlock().getType() != Material.OBSIDIAN) { break; } } return destLoc.getBlock().getType() == Material.OBSIDIAN ? i : -1; }</code><technical_language>Rename i distance in this method</technical_language>

Target:
private int getDistanceUntilEdge(Location location, BlockFace face) { Location destLoc = location.clone(); int distance; for (distance = 0; distance <= MAX_PORTAL_WIDTH_HEIGHT; ++distance) { destLoc.add(face.getModX(), face.getModY(), face.getModZ()); if (!canBuildThrough(destLoc.getBlock().getType()) || downImmutable(destLoc).getBlock().getType() != Material.OBSIDIAN) { break; } } return destLoc.getBlock().getType() == Material.OBSIDIAN ? distance : -1; }
Source:
<code>public void test01_02_requestControllerHandling() { driver.findElement(By.id("requestControllerHandling_01_02")).click(); <START> dbLogProvider.waitForAssertion(); <END> assertThat(driver.getTitle(), is("terasoluna-gfw-functionaltest")); assertThat(dbLogProvider.countContainsMessageAndLevelsAndLogger( "\\[w.xx.0002\\] ResultMessages \\[type=info, list=\\[ResultMessage \\[code=i.gt.me.0004, args=\\[\\], text=null\\]\\]\\]", "INFO", "org.terasoluna.gfw.common.exception.ExceptionLogger"), is(1L)); assertThat(dbLogProvider.countContainsMessageAndLevelsAndLogger( "\\[w.xx.0002\\] ResultMessages \\[type=info, list=\\[ResultMessage \\[code=i.gt.me.0004, args=\\[\\], text=null\\]\\]\\]", "INFO", "org.terasoluna.gfw.common.exception.ExceptionLogger.Monitoring"), is(1L)); assertThat(driver.findElement(By.xpath(" "Info !!")); }</code><technical_language>@btoutnp - [ ] of Travis error is in some test cases check assertThat(driver.getTitle() is missing. For of test cases DB log assertion need assert title. For example, <LINK_0></technical_language>

Target:
public void test01_02_requestControllerHandling() { driver.findElement(By.id("requestControllerHandling_01_02")).click(); assertThat(driver.getTitle(), is("terasoluna-gfw-functionaltest")); assertThat(dbLogProvider.countContainsMessageAndLevelsAndLogger( "\\[w.xx.0002\\] ResultMessages \\[type=info, list=\\[ResultMessage \\[code=i.gt.me.0004, args=\\[\\], text=null\\]\\]\\]", "INFO", "org.terasoluna.gfw.common.exception.ExceptionLogger"), is(1L)); assertThat(dbLogProvider.countContainsMessageAndLevelsAndLogger( "\\[w.xx.0002\\] ResultMessages \\[type=info, list=\\[ResultMessage \\[code=i.gt.me.0004, args=\\[\\], text=null\\]\\]\\]", "INFO", "org.terasoluna.gfw.common.exception.ExceptionLogger.Monitoring"), is(1L)); assertThat(driver.findElement(By.xpath(" "Info !!")); }
Source:
<code>public void execute() { String namespace = "<LINK_0>"; String modelName = "typecheck in DT"; GetDMNModelCommand getDMNModelCommand = new GetDMNModelCommand(namespace, modelName); try { getDMNModelCommand.execute(registryContext); fail(); <START> } catch (IllegalStateException ignored) { <END> } registryContext.register(DMNRuntime.class, dmnRuntime); DMNModel dmnModel = getDMNModelCommand.execute(registryContext); assertEquals(namespace, dmnModel.getNamespace()); assertEquals(modelName, dmnModel.getName()); }</code><technical_language>Is this exception a correct state? This incorrect. This kind of catches in tests hide potential bugs in future</technical_language>

Target:
public void execute() { String namespace = "<LINK_0>"; String modelName = "typecheck in DT"; GetDMNModelCommand getDMNModelCommand = new GetDMNModelCommand(namespace, modelName); assertThatThrownBy(() -> getDMNModelCommand.execute(registryContext)) .isInstanceOf(IllegalStateException.class) .hasMessage("There is no DMNRuntime available"); registryContext.register(DMNRuntime.class, dmnRuntime); DMNModel dmnModel = getDMNModelCommand.execute(registryContext); assertEquals(namespace, dmnModel.getNamespace()); assertEquals(modelName, dmnModel.getName()); }
Source:
<code>public boolean executeOnce() { try (Socket ignored = new Socket(host, port)) { return true; } catch (IOException e) { ByteArrayOutputStream out = new ByteArrayOutputStream(); e.printStackTrace(new PrintStream(out)); String str = new String(out.toByteArray()); LOGGER.warn("This is a message from AppIDMan opening the socket didn't work because of: "); <START> LOGGER.warn(str); <END> return false; } }</code><technical_language>If want log exception, pass logger exception; logger decide log bother calculating stacktrace if severity threshold is sufficient</technical_language>

Target:
public boolean executeOnce() { try (Socket ignored = new Socket(host, port)) { return true; } catch (IOException e) { LOGGER.warn("Socket to host: " + host + " with port: " + String.valueOf(port) + " couldn't be opened", e); return false; } }
Source:
<code>public TouchCalibration getTouchCalibration(int surfaceRotation) { try { return mTouchCalibration[surfaceRotation]; } <START> catch (IllegalArgumentException ex) { <END> Slog.w(InputManagerService.TAG, "Cannot get touch calibration.", ex); return null; } }</code><technical_language>This thrown. I meant ArrayIndexOutOfBoundsException. nit: extra newline, catch line brace</technical_language>

Target:
public TouchCalibration getTouchCalibration(int surfaceRotation) { try { return mTouchCalibration[surfaceRotation]; } catch (ArrayIndexOutOfBoundsException ex) { Slog.w(InputManagerService.TAG, "Cannot get touch calibration.", ex); return null; } }
Source:
<code>public void deleteFromRegistry(String resourcePath) { try { registry.delete(resourcePath); <START> log.debug(resourcePath + " Registry Deleted"); <END> } catch (RegistryException e) { log.error(e.getMessage()); } }</code><technical_language>isDebugEnabled check debug log</technical_language>

Target:
public void deleteFromRegistry(String resourcePath) { try { registry.delete(resourcePath); if ((log.isDebugEnabled())) { log.debug(resourcePath + " Registry Deleted"); } } catch (RegistryException e) { log.error("error while handle with registry", e); } }
Source:
<code>public static void addCodedObs(Patient p, String conceptName, String conceptAnswer, String date) { Obs o = new Obs(); o.setPerson(p); o.setConcept(MohCacheUtils.getConcept(conceptName)); o.setValueCoded(MohCacheUtils.getConcept(conceptAnswer)); o.setObsDatetime(MohTestUtils.makeDate(date)); <START> Obs obs = Context.getObsService().saveObs(o, null); <END> }</code><technical_language>this change necessary? I a reason for if do obs later</technical_language>

Target:
public static void addCodedObs(Patient p, String conceptName, String conceptAnswer, String date) { Obs o = new Obs(); o.setPerson(p); o.setConcept(MohCacheUtils.getConcept(conceptName)); o.setValueCoded(MohCacheUtils.getConcept(conceptAnswer)); o.setObsDatetime(MohTestUtils.makeDate(date)); Context.getObsService().saveObs(o, null); }
Source:
<code>public void put(long ledgerId, long entryId, ByteBuf entry) { <START> lock.readLock().lock(); <END> int entrySize = entry.readableBytes(); int alignedSize = align64(entrySize); try { int offset = currentSegmentOffset.getAndAdd(alignedSize); if (offset + entrySize > segmentSize) { } else { cacheSegments.get(currentSegmentIdx).setBytes(offset, entry, entry.readerIndex(), entry.readableBytes()); cacheIndexes.get(currentSegmentIdx).put(ledgerId, entryId, offset, entrySize); return; } } finally { lock.readLock().unlock(); } lock.writeLock().lock(); try { int offset = currentSegmentOffset.getAndAdd(entrySize); if (offset + entrySize > segmentSize) { currentSegmentIdx = (currentSegmentIdx + 1) % cacheSegments.size(); currentSegmentOffset.set(alignedSize); cacheIndexes.get(currentSegmentIdx).clear(); offset = 0; } cacheSegments.get(currentSegmentIdx).setBytes(offset, entry, entry.readerIndex(), entry.readableBytes()); cacheIndexes.get(currentSegmentIdx).put(ledgerId, entryId, offset, entrySize); } finally { lock.writeLock().unlock(); } }</code><technical_language>move lock acquisitions line 'try' keywords, for unlock, line of 'finally'</technical_language>

Target:
public void put(long ledgerId, long entryId, ByteBuf entry) { int entrySize = entry.readableBytes(); int alignedSize = align64(entrySize); lock.readLock().lock(); try { int offset = currentSegmentOffset.getAndAdd(alignedSize); if (offset + entrySize > segmentSize) { } else { cacheSegments.get(currentSegmentIdx).setBytes(offset, entry, entry.readerIndex(), entry.readableBytes()); cacheIndexes.get(currentSegmentIdx).put(ledgerId, entryId, offset, entrySize); return; } } finally { lock.readLock().unlock(); } lock.writeLock().lock(); try { int offset = currentSegmentOffset.getAndAdd(entrySize); if (offset + entrySize > segmentSize) { currentSegmentIdx = (currentSegmentIdx + 1) % cacheSegments.size(); currentSegmentOffset.set(alignedSize); cacheIndexes.get(currentSegmentIdx).clear(); offset = 0; } cacheSegments.get(currentSegmentIdx).setBytes(offset, entry, entry.readerIndex(), entry.readableBytes()); cacheIndexes.get(currentSegmentIdx).put(ledgerId, entryId, offset, entrySize); } finally { lock.writeLock().unlock(); } }
Source:
<code>PermissionNameRenderer(Map<String, String> allFromOutside) { all = new HashMap<String, String>(); <START> all.putAll(allFromOutside); <END> for (Map.Entry<String, String> e : Util.C.permissionNames().entrySet()) { all.put(e.getKey(), e.getValue()); all.put(e.getKey().toLowerCase(), e.getValue()); } }</code><technical_language>This map is get possibly large if a lot of rules display. Instead lets try avoid copying keeping maps, static of permissions unmodified of server</technical_language>

Target:
PermissionNameRenderer(Map<String, String> allFromOutside) { fromServer = allFromOutside; }
Source:
<code>public void testInputStreamAsynchronousByteChannel() throws Exception { AsynchronousByteChannel abc = <START> mock(AsynchronousByteChannel.class); <END> InputStream is = Channels.newInputStream(abc); Future<Integer> result = mock(Future.class); ArgumentCaptor<ByteBuffer> bbCaptor = ArgumentCaptor.forClass(ByteBuffer.class); final byte[] data = new byte[10]; final int readCount = 5; when(abc.read(bbCaptor.capture())).thenReturn(result); when(result.get()).thenAnswer( new Answer<Integer>() { public Integer answer(InvocationOnMock invocation) { ByteBuffer bb = bbCaptor.getValue(); assertEquals(data.length, bb.remaining()); for (int i = 0;i < readCount;++i) { bb.put((byte)1); } return readCount; } }); assertEquals(readCount, is.read(data)); for (int i = 0;i < data.length;++i) { assertEquals((i < readCount) ? (byte)1 : (byte)0, data[i]); } }</code><technical_language>test easier read if a fake a mock (just throw methods expect called)? - is more boilerplate: AsynchronousByteChannel channel = new AsynchronousByteChannel() { public Future<Integer> read(ByteBuffer dst) { dst.put(new byte[] { 1, 2, 3, 4, 5 }; return CompletableFuture.completedFuture(5); } void read(ByteBuffer dst, A attachment, CompletionHandler<Integer,? super A> handler) { throw new UnsupportedOperationException("unexpected"); } ... }</technical_language>

Target:
public void testInputStreamAsynchronousByteChannel() throws Exception { AsynchronousByteChannel abc = mock(AsynchronousByteChannel.class); InputStream is = Channels.newInputStream(abc); Future<Integer> result = mock(Future.class); ArgumentCaptor<ByteBuffer> bbCaptor = ArgumentCaptor.forClass(ByteBuffer.class); final byte[] bytesRead = new byte[10]; when(abc.read(bbCaptor.capture())).thenReturn(result); when(result.get()).thenAnswer( new Answer<Integer>() { public Integer answer(InvocationOnMock invocation) { ByteBuffer bb = bbCaptor.getValue(); assertEquals(bytesRead.length, bb.remaining()); bb.put(new byte[] {0, 1, 2, 3, 4, 5, 6}); return 7; } }); assertEquals(7, is.read(bytesRead)); byte[] bytesExpected = new byte[] { 0, 1, 2, 3, 4, 5, 6, 0, 0, 0 }; assertTrue(Arrays.equals(bytesExpected, bytesRead)); Mockito.verify(abc).read(isA(ByteBuffer.class)); Mockito.verify(result).get(); }
Source:
<code>public void testDownstreamBuildSelector() throws Exception { FreeStyleProject upstream = jenkinsRule.createFreeStyleProject("upstream"); upstream.getBuildersList().add(new FileWriteBuilder("upstream_artifact.txt", "${BUILD_TAG}")); ArtifactArchiver aa = new ArtifactArchiver("upstream_artifact.txt"); aa.setFingerprint(true); upstream.getPublishersList().add(aa); FreeStyleProject copiee = jenkinsRule.createFreeStyleProject("copiee"); CopyArtifact ca = new CopyArtifact("upstream"); ca.setFingerprintArtifacts(true); copiee.getBuildersList().add(ca); copiee.getBuildersList().add(new FileWriteBuilder("artifact.txt", "foobar")); copiee.getPublishersList().add(new ArtifactArchiver("artifact.txt")); jenkinsRule.assertBuildStatusSuccess(upstream.scheduleBuild2(0)); jenkinsRule.assertBuildStatusSuccess(copiee.scheduleBuild2(0)); WorkflowJob copier = createWorkflow( "copier", <START> "step(copyArtifacts(projectName: 'copiee', selector: downstream(upstreamProjectName: 'upstream', upstreamBuildNumber: '1')));" <END> + "echo readFile('artifact.txt');" ); jenkinsRule.assertLogContains("foobar", jenkinsRule.assertBuildStatusSuccess(copier.scheduleBuild2(0))); }</code><technical_language>I saying-you in fact get test work properly step. Meaning need update, IIRC, workflow-basic-steps</technical_language>

Target:
public void testDownstreamBuildSelector() throws Exception { FreeStyleProject upstream = jenkinsRule.createFreeStyleProject("upstream"); upstream.getBuildersList().add(new FileWriteBuilder("upstream_artifact.txt", "${BUILD_TAG}")); ArtifactArchiver aa = new ArtifactArchiver("upstream_artifact.txt"); aa.setFingerprint(true); upstream.getPublishersList().add(aa); FreeStyleProject copiee = jenkinsRule.createFreeStyleProject("copiee"); CopyArtifact ca = new CopyArtifact("upstream"); ca.setFingerprintArtifacts(true); copiee.getBuildersList().add(ca); copiee.getBuildersList().add(new FileWriteBuilder("artifact.txt", "foobar")); copiee.getPublishersList().add(new ArtifactArchiver("artifact.txt")); jenkinsRule.assertBuildStatusSuccess(upstream.scheduleBuild2(0)); jenkinsRule.assertBuildStatusSuccess(copiee.scheduleBuild2(0)); WorkflowJob copier = jenkinsRule.createWorkflow( "copier", "copyArtifacts(projectName: 'copiee', selector: downstream(upstreamProjectName: 'upstream', upstreamBuildNumber: '1'));" + "echo readFile('artifact.txt');" ); jenkinsRule.assertLogContains("foobar", jenkinsRule.assertBuildStatusSuccess(copier.scheduleBuild2(0))); }
Source:
<code>protected T createInstance(Class<? extends T> beanClass) { if <START> (BeanInstanceUtil.hasInjectionConstructor(beanClass)) <END> { try { @SuppressWarnings("unchecked") Constructor<T> cons = (Constructor<T>) BeanInstanceUtil.getInjectionConstructor(beanClass); cons.setAccessible(true); Class<?>[] paramTypes = cons.getParameterTypes(); Object[] params = new Object[paramTypes.length]; for (int i = 0; i < paramTypes.length; i++) { params[i] = BEANS.get(paramTypes[i]); } return cons.newInstance(params); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { throw new BeanCreationException(beanClass == null ? null : beanClass.getName(), e); } } else { return BeanInstanceUtil.createBean(beanClass); } }</code><technical_language>Check for more constructor, throw exception if multiple constructors injection</technical_language>

Target:
protected T createInstance(Class<? extends T> beanClass) { @SuppressWarnings("unchecked") Constructor<T> injectCons = (Constructor<T>) BeanInstanceUtil.getInjectionConstructor(beanClass); if (injectCons != null) { try { injectCons.setAccessible(true); return injectCons.newInstance(BeanInstanceUtil.getInjectionArguments(injectCons.getParameterTypes())); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { throw new BeanCreationException(beanClass == null ? null : beanClass.getName(), e); } } else { return BeanInstanceUtil.createBean(beanClass); } }
Source:
<code>protected String sqlxmlToString(SQLXML sqlxml) throws SQLException { <START> String result = sqlxml.getString(); <END> sqlxml.free(); return result; }</code><technical_language>I needs null check</technical_language>

Target:
protected String sqlxmlToString(SQLXML sqlxml) throws SQLException { if (sqlxml == null) { return null; } try { String result = sqlxml.getString(); return result; } finally { sqlxml.free(); } }
Source:
<code>public void submitOnPushWithTag() throws GitAPIException, OrmException, IOException, ConfigInvalidException { grant(Permission.SUBMIT, project, "refs/for/refs/heads/master"); grant(Permission.CREATE, project, "refs/tags/*"); <START> PushOneCommit.Result r = pushWithTagTo("refs/for/master%submit"); <END> r.assertOkStatus(); r.assertChange(Change.Status.MERGED, null, admin); assertSubmitApproval(r.getPatchSetId()); assertCommit(project, "refs/heads/master"); assertTag(project, "refs/heads/master", PushOneCommit.TAG); }</code><technical_language>I this test main issue. main issue is pushing a commit a tag for review destination branch is updated immediately change is in review submitted. A correct test 1. create a commit tag push refs/for/master 2. verify tag successfully pushed 3. verify destination branch (refs/heads/master) updated 4. submit change (e.g. REST) 5. verify change is successfully merged branch is updated. This test of in another test class. I fix in MergeOp solve this problem</technical_language>

Target:
public void submitOnPushWithTag() throws GitAPIException, OrmException, IOException, ConfigInvalidException { grant(Permission.SUBMIT, project, "refs/for/refs/heads/master"); grant(Permission.CREATE, project, "refs/tags/*"); final String tag = "v1.0"; PushOneCommit push = new PushOneCommit(db, admin.getIdent()); push.setTag(tag); PushOneCommit.Result r = push.to(git, "refs/for/master%submit"); r.assertOkStatus(); r.assertChange(Change.Status.MERGED, null, admin); assertSubmitApproval(r.getPatchSetId()); assertCommit(project, "refs/heads/master"); assertTag(project, "refs/heads/master", tag); }
Source:
<code>public DataInputNavigableJsonAdapter(BufferObjectDataInput input, int initialOffset) { this.input = input; this.initialOffset = initialOffset; <START> } <END></code><technical_language>Do need set input position initial offset</technical_language>

Target:
public DataInputNavigableJsonAdapter(BufferObjectDataInput input, int initialOffset) { this.input = input; this.input.position(initialOffset); this.initialOffset = initialOffset; }
Source:
<code>protected void checkPortRange() { checkArgument((portRangeEnd == null && portRangeStart == null) <START> || (portRangeEnd != null && portRangeStart != null), "Port range must be both present or null"); <END> if (portRangeEnd != null) { checkArgument(protocol == Protocol.TCP || protocol == Protocol.UDP, "Port range can only be set for TCP or UDP"); checkArgument(portRangeEnd > portRangeStart, "portRangeEnd must be greater than portRangeStart"); checkArgument(portRangeEnd >= 1 && portRangeEnd <= 65534, "Port range end must be 1 to 65534"); checkArgument(portRangeStart >= 1 && portRangeStart <= 65534, "Port range start must be 1 to 65534"); } }</code><technical_language>[nit] This more concise: java checkArgument(!(portRangeEnd == null ^ portRangeStart == null), "Port range present null");</technical_language>

Target:
protected void checkPortRange() { checkArgument(!(portRangeEnd == null ^ portRangeStart == null), "Port range must be both present or null"); if (portRangeEnd != null) { checkArgument(protocol == Protocol.TCP || protocol == Protocol.UDP, "Port range can only be set for TCP or UDP"); checkArgument(portRangeEnd > portRangeStart, "portRangeEnd must be greater than portRangeStart"); checkArgument(portRangeEnd >= 1 && portRangeEnd <= 65534, "Port range end must be 1 to 65534"); checkArgument(portRangeStart >= 1 && portRangeStart <= 65534, "Port range start must be 1 to 65534"); } }
Source:
<code>public QueueingOrganisationStore(MessageSender<EntityUpdatedMessage> sender, OrganisationStore delegate) { this.delegate = checkNotNull(delegate); this.sender = checkNotNull(sender); clock = new SystemClock(); <START> entityIdCodec = SubstitutionTableNumberCodec.lowerCaseOnly(); <END> }</code><technical_language>Inconsistent of this</technical_language>

Target:
public QueueingOrganisationStore(MessageSender<EntityUpdatedMessage> sender, OrganisationStore delegate) { this(checkNotNull(sender), checkNotNull(delegate), new SystemClock(), SubstitutionTableNumberCodec.lowerCaseOnly()); }
Source:
<code>public MeasurementKey(StudyOutcomeMeasure<? extends Variable> som, Arm a, WhenTaken wt) { <START> if (som.getValue() == null) { <END> throw new NullPointerException("Variable may not be null"); } if (som.getValue() instanceof OutcomeMeasure && a == null) { throw new NullPointerException( "Arm may not be null for Endpoints/ADEs"); } if (wt == null) { throw new NullPointerException("Moment of measurement may not be null"); } d_som = som; d_arm = a; d_wt = wt; }</code><technical_language>I guess _will_ allow variable null, planning a placeholder of some kind</technical_language>

Target:
public MeasurementKey(StudyOutcomeMeasure<? extends Variable> som, Arm a, WhenTaken wt) { if (som.getValue() instanceof OutcomeMeasure && a == null) throw new NullPointerException("Arm may not be null for Endpoints/ADEs"); if (wt == null) throw new NullPointerException("Moment of measurement may not be null"); d_som = som; d_arm = a; d_wt = wt; }
Source:
<code>public boolean shouldPull(ImageData image) { <START> boolean result = unit.convert(OffsetDateTime.now(ZoneOffset.UTC).toEpochSecond() - image.getCreated(), TimeUnit.SECONDS) > maxAge; <END> if (result) { log.trace("Should pull image with tags: {}", Arrays.asList(image.getRepoTags())); } return result; }</code><technical_language>Instant.now().getEpochSecond()</technical_language>

Target:
public boolean shouldPull(ImageData image) { Duration imageAge = Duration.between(image.getCreated(), Instant.now()); boolean result = imageAge.compareTo(maxAge) > 0; if (result) { log.trace("Should pull image with tags: {}", Arrays.asList(image.getRepoTags())); } return result; }
Source:
<code>private void flushUndo(IUndoContext context) { if (DEBUG_OPERATION_HISTORY_DISPOSE) { Tracing.printTrace("OPERATIONHISTORY", "Flushing undo history for " + context); } synchronized (undoRedoHistoryLock) { Object[] filtered = filter(undoList, context); for (Object element : filtered) { IUndoableOperation operation = (IUndoableOperation) element; if (context == GLOBAL_UNDO_CONTEXT || operation.getContexts().length == 1) { undoList.remove(operation); internalRemove(operation); } else { IUndoContext[] contexts = operation.getContexts(); for (IUndoContext <START> context2 : <END> contexts) { if (context2.matches(context)) { operation.removeContext(context2); } } if (operation.getContexts().length == 0) { undoList.remove(operation); internalRemove(operation); } } } } ICompositeOperation endedComposite = null; synchronized (openCompositeLock) { if (openComposite != null) { if (openComposite.hasContext(context)) { if (context == GLOBAL_UNDO_CONTEXT || openComposite.getContexts().length == 1) { endedComposite = openComposite; openComposite = null; } else { openComposite.removeContext(context); } } } } if (endedComposite != null) { notifyNotOK(endedComposite); } }</code><technical_language>rename 'otherContext' 'assignedContext'</technical_language>

Target:
private void flushUndo(IUndoContext context) { if (DEBUG_OPERATION_HISTORY_DISPOSE) { Tracing.printTrace("OPERATIONHISTORY", "Flushing undo history for " + context); } synchronized (undoRedoHistoryLock) { Object[] filtered = filter(undoList, context); for (Object element : filtered) { IUndoableOperation operation = (IUndoableOperation) element; if (context == GLOBAL_UNDO_CONTEXT || operation.getContexts().length == 1) { undoList.remove(operation); internalRemove(operation); } else { for (IUndoContext undoContext : operation.getContexts()) { if (undoContext.matches(context)) { operation.removeContext(undoContext); } } if (operation.getContexts().length == 0) { undoList.remove(operation); internalRemove(operation); } } } } ICompositeOperation endedComposite = null; synchronized (openCompositeLock) { if (openComposite != null) { if (openComposite.hasContext(context)) { if (context == GLOBAL_UNDO_CONTEXT || openComposite.getContexts().length == 1) { endedComposite = openComposite; openComposite = null; } else { openComposite.removeContext(context); } } } } if (endedComposite != null) { notifyNotOK(endedComposite); } }
Source:
<code>private Map<String, Object> topicSettings(String prefix) { Map<String, Object> result = originalsWithPrefix(prefix); if (CONFIG_STORAGE_PREFIX.equals(prefix) && result.containsKey(PARTITIONS_SUFFIX)) { log.warn("Ignoring '{}{}={}' setting, since config topic partitions is always 1", prefix, PARTITIONS_SUFFIX, result.get("partitions")); } <START> Object removedPolicy = result.remove("cleanup.policy"); <END> if (removedPolicy != null) { log.warn("Ignoring '{}cleanup.policy={}' setting, since compaction is always used", prefix, removedPolicy); } result.remove(TOPIC_SUFFIX); result.remove(REPLICATION_FACTOR_SUFFIX); result.remove(PARTITIONS_SUFFIX); return result; }</code><technical_language>more import statement, I a reason get actual config from: TopicConfig.CLEANUP_POLICY_CONFIG. I agree a variable is a string, a nit</technical_language>

Target:
private Map<String, Object> topicSettings(String prefix) { Map<String, Object> result = originalsWithPrefix(prefix); if (CONFIG_STORAGE_PREFIX.equals(prefix) && result.containsKey(PARTITIONS_SUFFIX)) { log.warn("Ignoring '{}{}={}' setting, since config topic partitions is always 1", prefix, PARTITIONS_SUFFIX, result.get("partitions")); } Object removedPolicy = result.remove(TopicConfig.CLEANUP_POLICY_CONFIG); if (removedPolicy != null) { log.warn("Ignoring '{}cleanup.policy={}' setting, since compaction is always used", prefix, removedPolicy); } result.remove(TOPIC_SUFFIX); result.remove(REPLICATION_FACTOR_SUFFIX); result.remove(PARTITIONS_SUFFIX); return result; }
Source:
<code>protected void mergeBlocks(T stitchedFileMetaData) throws IOException { final Path dst = new Path(filePath, stitchedFileMetaData.getStitchedFileRelativePath()); PathFilter tempFileFilter = new PathFilter() { @Override public boolean accept(Path path) { return path.getName().startsWith(dst.getName()) && path.getName().endsWith(PART_FILE_EXTENTION); } }; if (outputFS.exists(dst.getParent())) { FileStatus[] statuses = outputFS.listStatus(dst.getParent(), tempFileFilter); for (FileStatus status : statuses) { String statusName = status.getPath().getName(); LOG.debug("deleting vagrant file {}", statusName); outputFS.delete(status.getPath(), true); } } tempOutFilePath = new Path(filePath, stitchedFileMetaData.getStitchedFileRelativePath() + '.' + System.currentTimeMillis() + PART_FILE_EXTENTION); try { writeTempOutputFile(stitchedFileMetaData); moveToFinalFile(stitchedFileMetaData); } catch (BlockNotFoundException e) { <START> LOG.info("Block file not found. Assuming recovery mode for file {}. ", e.getBlockPath(), <END> stitchedFileMetaData.getStitchedFileRelativePath()); outputFS.delete(tempOutFilePath, false); } }</code><technical_language>this message higher level INFO</technical_language>

Target:
protected void mergeBlocks(T stitchedFileMetaData) throws IOException { final Path dst = new Path(filePath, stitchedFileMetaData.getStitchedFileRelativePath()); PathFilter tempFileFilter = new PathFilter() { @Override public boolean accept(Path path) { return path.getName().startsWith(dst.getName()) && path.getName().endsWith(PART_FILE_EXTENTION); } }; if (outputFS.exists(dst.getParent())) { FileStatus[] statuses = outputFS.listStatus(dst.getParent(), tempFileFilter); for (FileStatus status : statuses) { String statusName = status.getPath().getName(); LOG.debug("deleting vagrant file {}", statusName); outputFS.delete(status.getPath(), true); } } tempOutFilePath = new Path(filePath, stitchedFileMetaData.getStitchedFileRelativePath() + '.' + System.currentTimeMillis() + PART_FILE_EXTENTION); try { writeTempOutputFile(stitchedFileMetaData); moveToFinalFile(stitchedFileMetaData); } catch (BlockNotFoundException e) { LOG.warn("Block file not found. Assuming recovery mode for file {}. ", e.getBlockPath(), stitchedFileMetaData.getStitchedFileRelativePath()); outputFS.delete(tempOutFilePath, false); } }
Source:
<code>protected void onLoadFailure(final Loader loader, final String resultMessage) { <START> showToast(WebsiteErrorMessageMap.get(resultMessage)); <END> }</code><technical_language>Toasting generic error messages user logging. is better</technical_language>

Target:
protected void onLoadFailure(final Loader loader, final String resultMessage) { String errorKey = resultMessage; if (resultMessage.contains("upvote")) { errorKey = WebsiteErrorMessageMap.ALREADY_UPVOTED; } showToast(WebsiteErrorMessageMap.get(errorKey)); }
Source:
<code>private void showAddContactDialog() { InputValidator inputValidator = new InputValidator() { @Override public boolean checkInput(String inputString) { return true; } @Override public boolean canClose(String inputString) { JID jid = new JID(inputString); return jid.isValid() && !jid.getName().isEmpty(); } }; String userID; try { userID = SafeDialogUtils.showInputDialog( project, Messages.AddContactButton_contact_jid_dialog_message, Messages.AddContactButton_contact_jid_dialog_initial_input, Messages.AddContactButton_contact_jid_dialog_title, inputValidator, new TextRange(0, 0)); } catch (IllegalAWTContextException e) { log.error("Account creation failed.", e); return; } if (userID == null) { log.debug("Adding contact canceled by user during user id entry."); return; } JID jid = new JID(userID); String nickname; try { nickname = SafeDialogUtils.showInputDialog( project, Messages.AddContactButton_contact_nickname_dialog_message, "", Messages.AddContactButton_contact_nickname_dialog_title); } catch (IllegalAWTContextException e) { log.error("Account creation failed.", e); return; } if (nickname == null) { log.debug("Adding contact canceled by user during user nickname entry."); return; } BiPredicate<String, String> dialog = (title, message) -> { log.fatal("showing dialog " + title + " - " + message); Integer integer; try { <START> integer = SafeDialogUtils.showYesNoDialog(project, message, title); <END> } catch (IllegalAWTContextException e) { log.error("Tried to run dialog in an illegal context", e); return false; } return integer != null && integer.equals(com.intellij.openapi.ui.Messages.YES); }; try { xmppContactsService.addContact(jid, nickname, dialog); } catch (OperationCanceledException e) { log.error("Adding contact failed", e); } }</code><technical_language>I do if is a good idea return null integer ? is null returned</technical_language>

Target:
private void showAddContactDialog() { JID jid; try { jid = getJID(); } catch (IllegalAWTContextException e) { log.error("Requesting JID for contact addition failed", e); showAccountCreationFailedErrorNotification(e); return; } if (jid == null) { log.debug("Adding contact canceled by user during user id entry."); return; } String nickname; try { nickname = getNickname(); } catch (IllegalAWTContextException e) { log.error("Requesting nickname for contact addition failed", e); showAccountCreationFailedErrorNotification(e); return; } if (nickname == null) { log.debug("Adding contact canceled by user during user nickname entry."); return; } addContact(jid, nickname); }
Source:
<code>public void testToString() { assertEquals("toString", "filename1:10 func1()", fCallsite1.toString()); assertEquals("toString", "filename2:25 func2()", fCallsite2.toString()); assertEquals("toString", "filename3:123", fCallsite3.toString()); <START> ITmfCallsite callsite = new TmfCallsite(null, fFunctionName1, fLine1); <END> assertEquals("toString", ":10 func1()", callsite.toString()); }</code><technical_language>filename null interface (or do want allow it?)</technical_language>

Target:
public void testToString() { assertEquals("toString", "filename1:10 func1()", fCallsite1.toString()); assertEquals("toString", "filename2:25 func2()", fCallsite2.toString()); assertEquals("toString", "filename3:123", fCallsite3.toString()); }
Source:
<code>public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_USER_ATTR_DEF); attr.setFriendlyName("gid-namespace"); <START> attr.setDisplayName("git-namespace"); <END> attr.setType(Integer.class.getName()); attr.setDescription("Gid namespace."); return attr; }</code><technical_language>"GID namespace" instead</technical_language>

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_USER_ATTR_DEF); attr.setFriendlyName("gid-namespace"); attr.setDisplayName("GID namespace"); attr.setType(Integer.class.getName()); attr.setDescription("Gid namespace."); return attr; }
Source:
<code>public void deleteAllStudentsInCourse(String courseId) { Assumption.assertNotNull(courseId); List<StudentAttributes> studentsInCourse = studentsLogic.getStudentsForCourse(courseId); for (StudentAttributes student : studentsInCourse) { studentsLogic.deleteStudentCascade(courseId, student.email); <START> } <END> }</code><technical_language>Logic is meant a facade class. such, put a method deleteAllStudentsInCourse in StudentsLogic this method call instead</technical_language>

Target:
public void deleteAllStudentsInCourse(String courseId) { Assumption.assertNotNull(courseId); studentsLogic.deleteAllStudentsInCourse(courseId); }
Source:
<code>public boolean verify(SessionContext session, byte[] sig) throws Exception { if (challengeDigest == null) { throw new IllegalStateException("initVerifier must be called before verify"); } ByteArrayBuffer data = new ByteArrayBuffer(sig); String keyType = data.getString(); if (!this.keyType.equals(keyType)) { return false; } byte[] rawSig = data.getBytes(); byte flags = data.getByte(); long counter = data.getUInt(); if ((flags & ~FLAG_USER_PRESENCE) != 0) { return false; } if ((flags & FLAG_USER_PRESENCE) != FLAG_USER_PRESENCE && !publicKey.isNoTouchRequired()) { return false; } ByteArrayBuffer encoded = new ByteArrayBuffer(); encoded.putString(getSignatureKeyType()); encoded.putBytes(rawSig); <START> MessageDigest md = MessageDigest.getInstance("SHA-256"); <END> byte[] appNameDigest = md.digest(publicKey.getAppName().getBytes(StandardCharsets.UTF_8)); byte[] challengeDigest = this.challengeDigest.digest(); ByteArrayBuffer counterData = new ByteArrayBuffer(Integer.BYTES, false); counterData.putInt(counter); Signature delegate = getDelegateSignature(); delegate.initVerifier(session, publicKey.getDelegatePublicKey()); delegate.update(session, appNameDigest); delegate.update(session, new byte[]{flags}); delegate.update(session, counterData.getCompactData()); delegate.update(session, challengeDigest); return delegate.verify(session, encoded.getCompactData()); }</code><technical_language>Please SecurityUtils.getMessageDigest</technical_language>

Target:
public boolean verify(SessionContext session, byte[] sig) throws Exception { if (challengeDigest == null) { throw new IllegalStateException("initVerifier must be called before verify"); } ByteArrayBuffer data = new ByteArrayBuffer(sig); String keyType = data.getString(); if (!this.keyType.equals(keyType)) { return false; } byte[] rawSig = data.getBytes(); byte flags = data.getByte(); long counter = data.getUInt(); if ((flags & ~FLAG_USER_PRESENCE) != 0) { return false; } if ((flags & FLAG_USER_PRESENCE) != FLAG_USER_PRESENCE && !publicKey.isNoTouchRequired()) { return false; } ByteArrayBuffer encoded = new ByteArrayBuffer(); encoded.putString(getSignatureKeyType()); encoded.putBytes(rawSig); MessageDigest md = SecurityUtils.getMessageDigest("SHA-256"); byte[] appNameDigest = md.digest(publicKey.getAppName().getBytes(StandardCharsets.UTF_8)); byte[] challengeDigest = this.challengeDigest.digest(); ByteArrayBuffer counterData = new ByteArrayBuffer(Integer.BYTES, false); counterData.putInt(counter); Signature delegate = getDelegateSignature(); delegate.initVerifier(session, publicKey.getDelegatePublicKey()); delegate.update(session, appNameDigest); delegate.update(session, new byte[]{flags}); delegate.update(session, counterData.getCompactData()); delegate.update(session, challengeDigest); return delegate.verify(session, encoded.getCompactData()); }
Source:
<code>private boolean bothWayMappingRequired(Object srcObject, String relationshipType, Object tgtObject, Relationship.Direction relationshipDirection) { boolean mapBothWays = false; ClassInfo tgtInfo = metaData.classInfo(tgtObject); if (tgtInfo == null) { LOGGER.warn("Unable to process on {}. Check the mapping.", relationshipType, srcObject.getClass()); return false; } for (FieldInfo tgtRelReader : tgtInfo.relationshipFields()) { Direction tgtRelationshipDirection = tgtRelReader.relationshipDirection(); <START> if ((tgtRelationshipDirection.equals(Direction.OUTGOING) || tgtRelationshipDirection <END> .equals(Direction.INCOMING)) && tgtRelReader.relationshipType().equals( relationshipType)) { if (relationshipDirection.equals(tgtRelationshipDirection)) { Object target = tgtRelReader.read(tgtObject); mapBothWays = targetEqualsSource(target, srcObject); } } if (mapBothWays) { break; } } return mapBothWays; }</code><technical_language>above, please prefer == for comparing enums</technical_language>

Target:
private boolean bothWayMappingRequired(Object srcObject, String relationshipType, Object tgtObject, Relationship.Direction relationshipDirection) { boolean mapBothWays = false; ClassInfo tgtInfo = metaData.classInfo(tgtObject); if (tgtInfo == null) { LOGGER.warn("Unable to process on {}. Check the mapping.", relationshipType, srcObject.getClass()); return false; } for (FieldInfo tgtRelReader : tgtInfo.relationshipFields()) { Direction tgtRelationshipDirection = tgtRelReader.relationshipDirection(); if (tgtRelationshipDirection != Direction.UNDIRECTED && tgtRelReader.relationshipType() .equals(relationshipType) && relationshipDirection.equals(tgtRelationshipDirection)) { Object target = tgtRelReader.read(tgtObject); mapBothWays = targetEqualsSource(target, srcObject); } if (mapBothWays) { break; } } return mapBothWays; }